Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hiaw/rn-translate-template
I18n template
https://github.com/hiaw/rn-translate-template
Last synced: 7 days ago
JSON representation
I18n template
- Host: GitHub
- URL: https://github.com/hiaw/rn-translate-template
- Owner: hiaw
- Created: 2016-08-16T22:49:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-21T22:15:16.000Z (about 8 years ago)
- Last Synced: 2024-08-15T00:20:10.229Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 92.8 KB
- Stars: 22
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-react-native - rn-translate-template ★18 - I18n template for all iOS and Android supported languages (Components / Internationalization)
- awesome-react-native - rn-translate-template ★18 - I18n template for all iOS and Android supported languages (Components / Internationalization)
- awesome-react-native - rn-translate-template ★18 - I18n template for all iOS and Android supported languages (Components / Internationalization)
- awesome-react-native-ui - rn-translate-template ★11 - I18n template for all iOS and Android supported languages (Components / Internationalization)
- awesome-react-native - rn-translate-template ★18 - I18n template for all iOS and Android supported languages (Components / Internationalization)
README
# Idea
Shipping app with localization for all available languages. The main idea here is to minimise the memory required of other languages that is not used by the platform.
For example if the phone is localized in French, then this will only load the French and English translations into memory and ignore the 30+ other languages available.
English translation is set as default fallback in case some translations are not available in the chosen language.
# Installation
First install i18n into your react native project
npm install --save react-native-i18n
react-native linkThen clone this project to your within your project, removing the git repo and example afterwards.
git clone --depth 1 https://github.com/hiaw/rn-translate-template I18n
rm -rf I18n/.git I18n/exampleThen require the `I18n.js` file within your main `App.js` file
require('./I18n/I18n.js');
To use the translation in app.
import I18n from 'react-native-i18n';
render() {
...
{ I18n.t('welcome') }
...
}