i18next / i18next-parser

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

Compat: Make tests work on Windows with non-English locale #931

Closed woutervanvliet closed 1 year ago

woutervanvliet commented 1 year ago

Why am I submitting this PR

I originally started investigating the Broccoli problems mentioned in #684 on a Windows computer, running with some Danish locale settings. This caused a number of problems, from my editor opening bin/cli.js instead of running the code to sorting and line-ending issues with some tests.

Assuming the assertions to be the one source of truth, I've added a locale parameter in localeCompare for the default comparison function. lineEndings are set to lf for a test that checks the entire contents of a generated JSON file.

Does it fix an existing ticket?

No

Checklist

codecov-commenter commented 1 year ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Files Coverage Δ
src/helpers.js 92.39% <100.00%> (ø)

... and 1 file with indirect coverage changes

:loudspeaker: Thoughts on this report? Let us know!.