You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm changing the i18n implementation of a fairly large app and transloco has been great so far. I only have a slight issue with translation generation for dynamic keys.
The number of dynamic translations required is pretty big, and adding explicit comments with every key to the templates is rough. However, one of my translation files already has a bunch of the missing keys missing from other files.
e.g.
File Name
Missing Keys
Extra Keys
en
--
static, ok, error, ...
de
--
--
Describe the solution you'd like
I'd like to propose another flag --merge-extra-keys (or something) to be used in conjunction with --add-missing-keys. This flag would cause the detective to add the so-called "extra keys" to i18n files where they are missing.
Alternatively we could have an --add-extra-keys flag to use instead of the two above together.
Before:
File Name
Missing Keys
Extra Keys
en
--
static, ok, error, ...
de
--
--
After:
File Name
Missing Keys
Extra Keys
en
--
static, ok, error, ...
de
--
static, ok, error, ...
Describe alternatives you've considered
A small script to identify keys present in one file and missing in another one and updating the lacking file is pretty trivial, but I'd rather the library itself supported this.
Current behavior
"Extra" keys present in one file aren't added to one that doesn't have them.
Expected behavior
When using --add-missing-keysand also--merge-extra-keys "extra" keys should be added to files where they don't exist
Additional context
Copy-pasting is boring
Contribution
I want to make a pull request for this feature:
[ ] Yes! 🚀
[X] Maybe next time
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I'm changing the i18n implementation of a fairly large app and transloco has been great so far. I only have a slight issue with translation generation for dynamic keys.
The number of dynamic translations required is pretty big, and adding explicit comments with every key to the templates is rough. However, one of my translation files already has a bunch of the missing keys missing from other files.
e.g.
Describe the solution you'd like
I'd like to propose another flag
--merge-extra-keys
(or something) to be used in conjunction with--add-missing-keys
. This flag would cause the detective to add the so-called "extra keys" to i18n files where they are missing.Alternatively we could have an
--add-extra-keys
flag to use instead of the two above together.Before:
After:
Describe alternatives you've considered
A small script to identify keys present in one file and missing in another one and updating the lacking file is pretty trivial, but I'd rather the library itself supported this.
Current behavior
"Extra" keys present in one file aren't added to one that doesn't have them.
Expected behavior
When using
--add-missing-keys
and also--merge-extra-keys
"extra" keys should be added to files where they don't existAdditional context
Copy-pasting is boring
Contribution
I want to make a pull request for this feature:
[ ] Yes! 🚀
[X] Maybe next time
The text was updated successfully, but these errors were encountered: