daniel-sc / ng-extract-i18n-merge

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

JSON export format #44

Open ricardosaracino opened 2 years ago

ricardosaracino commented 2 years ago

I noticed the native angular now supports exporting in JSON, and it would be nice if this did to. Great work on this this project thanks a ton.

daniel-sc commented 2 years ago

@ricardosaracino thanks for reaching out!

From what I read in https://github.com/angular/angular/issues/45465 the json format is not really final/stable.

Furthermore the current format (without translation state and without source text) is barely usable in reality (I suspect). And with the current implementation the merge is not as simple..

Based on this, I'd rather postpone this. Of course if you (or others) would like to contribute, I'd be happy to include this!

chirag-shastri commented 1 year ago

Hi, its over 1 year now since started talking on this. Does angular i18n json translation format support now single string value and an object with the value?

daniel-sc commented 1 year ago

@chirag-shastri as you probably have noticed, this depends on the angular i18n-extract support for json format, which is tracked in the upstream issue linked above. As long as this is not addressed, there is not much this lib can do.

co-dax commented 9 months ago

@daniel-sc Angular is now allowing extraction to .arb format which is essentially a json and it seems it has all the same infor as .xlf format. Documentation is here https://angular.io/guide/i18n-common-translation-files#change-the-source-language-file-format and from there there is reference to .arb schema/format https://github.com/google/app-resource-bundle/wiki/ApplicationResourceBundleSpecification.

Am I missing something?

spock123 commented 8 months ago

We've been using i18n with json for a long time now, so it's definitely stable and supported. Would be super nice if support for this. could be added here

jonnomk commented 1 week ago

Is it likely JSON support will be added? If not, is there an alternative package that can support extract and merge with JSON?

We need JSON for runtime language switching, which works well, but right now we're having to update the language files manually after using Angular's out of box extract-i18n.

Hats off and thanks for the solution as is - but JSON support would be great.

daniel-sc commented 1 week ago

@jonnomk json support could be added. As I probably won't have time for this soon, it'd be cool if someone could contribute this!