daniel-sc / ng-extract-i18n-merge

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

Further documentation: does this support merging multiple translation files? #69

Closed CMadden8 closed 1 year ago

CMadden8 commented 1 year ago

Is your feature request related to a problem? Please describe.

I'm looking for a tool that merges multiple translation files, specifically for use with a) an NXmono-repo; and b) ngx translate. In NX, I need to create a 'shared translations' library that contains common translations across all apps. Currently, for example, translations such as common server errors are being copy and pasted across several en.json files in each app. Ideally there would be a 'shared' en.json in the shared translation lib that would be merged with the app-specific translation files.

Describe the solution you'd like

It almost seems that what I described is already a feature of this package. But I can't understand how you would go about doing any of this. I think some very simple examples are needed. Ie - I'm imagining you might add a configuration to angular.json that describes the path of the 'app-level' en.json file and then the path of the 'shared' en.json and they are then merged to a specified location is the app's assets folder. But I don't understand how you'd do it, or if that's even supported.

Describe alternatives you've considered

ng-i18n-merge-files

I've looked at this package and the documentation does clearly describe a similar feature (merging multiple component translation files). But it appears to be long-abandoned. And it also doesn't apply to the NXissue - ie, the path to shared en.json would be outside the app itself in a lib.

Additional context

No further additional context.

CMadden8 commented 1 year ago

I found the answer to this problem with ngx-translate-multi-http-loader.