daniel-sc / ng-extract-i18n-merge

Extract and merge i18n xliff translation files for angular projects.
MIT License
170 stars 18 forks source link

Add option to include only translation units with given prefix #86

Closed geertplaisier closed 9 months ago

geertplaisier commented 9 months ago

With this PR I would like to add an option to the configuration to include only translation units with a certain prefix.

Currently, in our projects we have multiple libraries in a single monorepo. We now have an extract configuration for each of the different libraries. In those configurations we are using the removeIdsWithPrefix option to create separate translations files for each of the libraries. Everytime we add another library we have to extend the removeIdsWithPrefix list for each of the configurations to make sure each library just contains their own translations.

By adding an option to configure just the prefix that is needed for a certain library this process can be simplified a lot. Hopefully this can be useful for others as well.

geertplaisier commented 9 months ago

@daniel-sc Thanks for checking, good points, missed those when changing to string[]. Included your changes.