0.0.2 • Published 7 years ago

react-native-translate v0.0.2

Weekly downloads
10
License
MIT
Repository
github
Last release
7 years ago

React Native Translate

Usage

  1. yarn add react-native-translate
  2. Create json file with your translation like this:
{
  "email": "Електронна пошта"
}
  1. Set localization file in your index.js:
import ukTranslation from './src/localization/uk.json';
import { setLocalization } from 'react-native-translate';

setLocalization(ukTranslation);
  1. Use translation:
import { translate, Translate } from 'react-native-translate';

translate('email') // returns 'Електронна пошта'
// Or
<Translate value="email" /> // renders <Text>Електронна пошта</Text>
  1. If you want to run tests: npm test or npm run testonly or npm run test-watch.
  2. If you want to run linting: npm test or npm run lint. Fix bugs: npm run lint-fix.
  3. If you want to run transpilation to ES5 in dist folder: npm run prepublish (standard npm hook).

License

MIT