I read the following documentation page: learn.microsoft.com/.../localize-module
I'm using the CLI command for generating the (master) global.json file. This command is an nice and automatic way to get all language strings out of custom modules: https://learn.microsoft.com/en-us/dynamics365/commerce/e-commerce-extensibility/localize-module#generate-a-resource-globaljson-file
For *.definition.json files it works fine, it extracts automatically all keys under "resources".
But now I want to extend an OOTB module with additional resource keys: Therefore I created an <module-name>.definition.ext.json (f.e. buybox.definition.ext.json) inside of <src>/themes/<my-theme-name>/definition-extensions and added my new resource:
{ "$type": "definitionExtension", "resources": { "test": { "value": "Test" } } }
But it looks like. the cli command yarn msdyn365 generate-resources src ignores *.ext.json files. Means the "test" string is not added to the global.json.
One workaround for now:
Add/duplicate the resource key also into the <my-theme-name>.definition.json.
Down side: I need to maintain the localization in two places and I'm breaking completely the modularization approach because all keys/translation overrides are located in one big file.