i18next / i18next-parser

Parse your code to extract translation keys/values and manage your catalog files
MIT License
486 stars 198 forks source link

Fix JSX key attribute clobbering detected value #1042

Open comp615 opened 3 months ago

comp615 commented 3 months ago

Why am I submitting this PR

React components have a protected attribute "key" which can seemingly clobber the detected/parsed i18n key due to a naming conflict.

Does it fix an existing ticket?

Yes #1038

Checklist

codecov-commenter commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.35%. Comparing base (168c8d5) to head (a95a76b). Report is 57 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1042 +/- ## ========================================== - Coverage 95.40% 95.35% -0.05% ========================================== Files 11 10 -1 Lines 1937 1918 -19 ========================================== - Hits 1848 1829 -19 Misses 89 89 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

karellm commented 3 months ago

@comp615 I have mixed feeling about this as some people might be relying on the key attribute. I'd prefer a fix that ignores the key attribute only if the i18nKey one is present. Can you update the PR?