Crowdin OTA JS Client live demo
var otaClient = require("@crowdin/ota-client").default
const hash = '65f2bd41e74ca667bc4ba87uo3a';
const client = new otaClient(hash);
// will return all translation strings for all languages from all json files
client.getStrings()
.then(res => console.log(res))
.catch(error => console.error(error));
// or define global language and do not pass it everywhere
client.setCurrentLocale('uk');
client.getStringByKey(['home'])
.then(title => console.log(title))
.catch(error => console.error(error));
no comments