Created
July 1, 2019 09:24
-
-
Save FreddyPoly/5332ba966478a9c782b806bc84adc474 to your computer and use it in GitHub Desktop.
[REACT NATIVE] i18n setup example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as RNLocalize from "react-native-localize" | |
import i18n from "i18n-js" | |
const en = require("./en") | |
const ja = require("./ja") | |
i18n.fallbacks = true | |
i18n.translations = { en, ja } | |
const fallback = { languageTag: "en", isRTL: false } | |
const { languageTag } = RNLocalize.findBestAvailableLanguage(Object.keys(i18n.translations)) || fallback | |
i18n.locale = languageTag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment