globalizejs / globalize

A JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data
https://globalizejs.com
MIT License
4.8k stars 605 forks source link

Doesn't loadMessages stumble on { } in message value? #592

Closed Setogit closed 8 years ago

Setogit commented 8 years ago

query/globalize v1.1.1

loadMessages fails to load a certain message. Not fully debugged yet, but simply removing { } characters from the message VALUE helps; at least, the message (without { }) is loaded.

Is this a known issue? I know {} cannot be used in KEY: https://github.com/jquery/globalize/blob/master/doc/api/message/load-messages.md:

JSON object of messages data. Keys can use any character, except /, { and }. Values (i.e., the message content itself) can contain any character.

rxaviers commented 8 years ago

{} are reserved characters of ICU MessageFormat. Read on SlexAxton/messageFormatter.js for more information on regard. Anyway, please could you provide examples of what you're trying to load and what error you get?

Setogit commented 8 years ago

Got that: "{} are reserved characters of ICU MessageFormat." Came up with a design B on my side. closing.

rxaviers commented 8 years ago

Ok. Please would you change anything in the docs to make that clear and other users avoid this problem?