When I insert text, eg:
<Text>Maçã</Text>
It does not recognize! I know it's the utf8 goal, but I do not know where to insert it! Thank you in advance!
When I insert text, eg:
<Text>Maçã</Text>
It does not recognize! I know it's the utf8 goal, but I do not know where to insert it! Thank you in advance!
From what I understand, you want to internationalize your application, correct? You'll need a plugin, like the:
npm install --save react-native-languages
react-native link react-native-languages
Usage:
import RNLanguages from 'react-native-languages';
// Current device language
console.log('language', RNLanguages.language);
// User preferred languages (in order)
console.log('languages', RNLanguages.languages);
// Listening for languages changes (on Android)
RNLanguages.addEventListener('change', ({ language, languages }) => {
// Do languages related things…
});
You also have link
npm install react-native-localization --save
react-native link react-native-localization
And you can use creating components for the location
// ES6 module syntax
import LocalizedStrings from 'react-native-localization';
// CommonJS syntax
// let LocalizedStrings = require ('react-native-localization');
let strings = new LocalizedStrings({
"en-US":{
how:"How do you want your egg today?",
boiledEgg:"Boiled egg",
softBoiledEgg:"Soft-boiled egg",
choice:"How to choose the egg"
},
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"
}
});
And call
<Text style={styles.title}>
{strings.how}
</Text>
Solved! My publisher configuration was not for utf8! As soon as I set it to utf8 , the characters appeared. Thanks for the help!