React Native Localization

If you're going to be serious with your app, chances are you're going to localize it for different languages support.

Stefano Falda has got you covered with its

ReactNativeLocalization

The Javascript library uses a native library (ReactLocalization) to get the current interface language, then it loads and displays the strings matching the current interface locale or the default language (the first one if a match is not found) if a specific localization can't be found.

It's possible to force a language different from the interface one.

var LocalizedStrings = require("./node_modules/react-native-localization/LocalizedStrings");

var strings = new LocalizedStrings({
  en: {
    how: "How do you want your egg today?",
    boiledEgg: "Boiled egg",
    softBoiledEgg: "Soft-boiled egg",
    choice: "How to choose the egg",
  },
  it: {
    how: "Come vuoi il tuo uovo oggi?",
    boiledEgg: "Uovo sodo",
    softBoiledEgg: "Uovo alla coque",
    choice: "Come scegliere l'uovo",
  },
});