is there a way in React Native that I can define on a global variable all the strings that I will be using like in Android Development there is a String.xml where you can put al
If you want to switch between languages depening on platform localisation.
fetch node_module via npm
npm i react-native-localization --save
Define variables in class:
// Localisation.js
let LocalizedStrings = require ('react-native-localization');
let strings = new LocalizedStrings ({
en: {
loginTitle: "Login",
},
de: {
loginTitle: "Anmelden",
}
})
When you need the strings:
var STRINGS = require ('./Localization');
{STRINGS.loginTitle}