Open Aryan-mor opened 3 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 95.47%. Comparing base (
168c8d5
) to head (2a02abc
). Report is 65 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I'm a bit puzzled by this use case but I don't really like the implementation.
First it looks very specific to a use case you have (not something many people would need). Second the option name skipIdenticals
shouldn't remove empty values imo. That said, I don't want to make the API too complex with an extra skipEmtpy
.
I actually think that the best solution here is to add hooks. We could have an hook to update the catalog before it is written to file. You could then add the logic you need in there.
What do you think?
@karellm I can answer about the use case. If you have worked with gettext (i18next has gettext tag on npm) you know in gettext, you write translations like t('The Default Language Text')
and mostly the default language (which is EN by default) translation file is almost empty.
We can rename the name skipIdentical
to elaborate the use case.
I agree, and we can have another array for skipEmpty
to skip empties in some languages.
On the other hand, it can be more objective, like refer to defaultLanguages
.
Implemented logic to skip keys with identical values for specified locales in the i18next parser. Fixes #1036
Why am I submitting this PR
Please refer to #1036
Does it fix an existing ticket?
Yes #1036
Checklist
yarn test
(see details here)