React Native
Installation
- npm
- Yarn
- pnpm
npm install @crowdin/ota-client
yarn add @crowdin/ota-client
pnpm add @crowdin/ota-client
Client initialization
import OtaClient from '@crowdin/ota-client';
const otaClient = new OtaClient('{distribution_hash}');
Integration with react-native-localization
import LocalizedStrings from 'react-native-localization';
//localizedStrings is an instance of translations which is used across whole application
async function build(localizedStrings: LocalizedStrings) {
const translations = await otaClient.getStrings();
localizedStrings.setContent(translations);
}