Skip to content

Conversation

MichaelHoste
Copy link

@MichaelHoste MichaelHoste commented Jan 17, 2023

We noticed that an ICU message looking like this is wrongly considered as a valid message:

{ count, plural, one {{results.length} result} other {{results.length} results} }

Note the use of the variable {results.length} instead of {count}, it could happen if the developer make a mistake while writing the ICU.

We checked and the same ICU triggers an error when parsed by the JS library @formatjs/icu-messageformat-parser

We improved a bit the parse_arg_id method to also raise an exception when dot (.) is found in a variable.
I hope it made sense.


Thank you for this gem that is really useful to us at Translation.io 🙂

`{ count, plural, one {{results.length} result} other {{results.length} results} }` was wrongly considered as a valid ICU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant