-
Notifications
You must be signed in to change notification settings - Fork 77
Document behavior when locales parameter is an array #100
Comments
yeah, we want to improve the docs, thanks for the suggestions, we will look at it. as for the locales, this is propagated down to the primitives defined in ECMA-402, more details here: Now, loading
That's the reason why your application can use |
to be clear, you normally don't need to worry much about this, and you just pass one locale in that array, and it will resolve the best match based on the locale data known by the library and the browser in case of primitives. |
thanks So i guess i'll only use one then :) |
I will keep this open until we update the documentation. |
Hi,
This is quite confusing to me and it does not seem to be well explained in the documentation, as all the exemples only always have a single locale.
I had to check the sources to understand.
What I understand is that it take the first locale in the array for which the language match a registered "CLDR data" (I guess it means fr.js / en.js)
So basically it seems that if you are sure you have appropriately loaded the "CLDR data" for a given locale, you do not have to care about the array.
I think it should be clearer because it is quite confusing. It would be far less confusing if the documentation was using "locale" wording instead of "locales", with a note on using an array instead of a single locale string.
See formatjs/formatjs#81
The text was updated successfully, but these errors were encountered: