stefalda / react-localization

Simple module to localize the React interface using the same syntax used in the ReactNativeLocalization module.
MIT License
373 stars 58 forks source link

Hyphenated language codes #104

Closed mattyvp closed 4 years ago

mattyvp commented 4 years ago

I'm looking for some more control in the strings object based on a user's country. Is it possible to format the input object with country codes?

For example, pt vs pt-BR:

export const data = {
  ptBr: {
    reception: 'recepção'
  },
  pt: {
    reception: 'receção'
}
stefalda commented 4 years ago

Hi, yes it's supported. The format should be pt-BR (but check what the library returns as current format).

mattyvp commented 4 years ago

Thanks, will check it out.