react-localization icon indicating copy to clipboard operation
react-localization copied to clipboard

Translation for english countries like Canada or US.

Open max-lynn opened this issue 5 years ago • 2 comments

I'm trying to add translations for prices for canada and the US using the abbreviations en-CA and en-US but this is causing an error because of the dash.

Is there something else I need to do to have translation for these regions?

max-lynn avatar Jul 15 '20 11:07 max-lynn

Try to wrap the language code in quotes:

{
  "en-CA":{
                  hello: "Hello"
          }
}

And you can access it with strings["en-CA"].

stefalda avatar Jul 15 '20 12:07 stefalda

Ideally there would be an implementation like this:

{ en: { hello: "Hello", goodbye: "Goodbye", } "en-CA":{ hello: "Howdy" } }

Where if I set my language to en-US or en-GB, it would return 'Hello', but if I set it to en-CA it returns 'Howdy' for hello, but if I ask for goodbye, on not finding that entry in en-CA, it defaults to looking in en. That way only different translations have to be inputted for regional languages

MarkJDocumentaal avatar Nov 09 '23 09:11 MarkJDocumentaal