Add feature to skip identical keys for specified locales#1057
Add feature to skip identical keys for specified locales#1057Aryan-mor wants to merge 2 commits intoi18next:masterfrom
Conversation
Implemented logic to skip keys with identical values for specified locales in the i18next parser. Added tests to verify behavior and updated existing code to accommodate the new feature.
Enhanced the translation skipping functionality to handle plural forms. Added new test cases for plural translations in 'ar' and 'fr' locales. Updated helpers and transformation logic to identify and process plural keys correctly.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1057 +/- ##
==========================================
+ Coverage 95.40% 95.47% +0.06%
==========================================
Files 11 10 -1
Lines 1937 1965 +28
==========================================
+ Hits 1848 1876 +28
Misses 89 89 ☔ View full report in Codecov by Sentry. |
|
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 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 We can rename the name |
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)