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 --fail-on-update false negatives from new sort code. #957

Closed tec27 closed 10 months ago

tec27 commented 10 months ago

This replaces the code that previously tried to check for sorting via a wrapped compare function with a much simpler approach: JSON encode the old and (sorted) new version and see if they match. This code only runs if we have not already seen an update to the keys/contents before, so the performance implications are minimal.

This also adds a test to ensure that false negatives don't occur (i.e. it checks the --fail-on-update behavior against a file that is not being updated and was already sorted).

Fixes #955.

Why am I submitting this PR

The previous update broke --fail-on-update, making it always fail if sorting was configured.

Does it fix an existing ticket?

Yes #955

Checklist

karellm commented 10 months ago

Thanks for the PR, this is deployed as 8.12.0