0

I am unable to find language code "ch", or to be more generic can we use our own language with react-intl

As a work around, i used another language's local data for warping

  • React-intl is based on underlying browser API. Basically, all numbers, pluralization rules etc, are stored in a browser: (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl) Theoretically, you can implement your own Intl polyfill containing all localization rules. There is some documentation how to do so (https://formatjs.io/guides/runtime-environments/), but I don't think it is a good idea =) – Daydreaming Duck Aug 08 '19 at 09:55
  • so probably we need to define our own rule set for language, and all the way back, to use in our app. is it so...? – Shivam Baghla Aug 08 '19 at 10:39

1 Answers1

0

You can, it'll fallback to your browser's language. For example, new Intl.NumberFormat('xx') works just fine.

Long Ho
  • 599
  • 4
  • 15