$ npm i @derpierre65/crowdin-updater
const CrowdinUpdater = require('@derpierre65/crowdin-updater');
const updater = new CrowdinUpdater({
projectId: 12345,
crowdinMainFile: 'my-default.json',
tempDirectory: path.resolve('./temp-translation.zip'),
localeDirectory: path.resolve('./static/assets/locales/'),
logPath: path.resolve('./crowdin.log'),
authorizationKey: 'Bearer API-TOKEN',
jsonIndent: '\t',
referenceLocale: 'en',
locales: [
{ iso: 'de', file: 'de.json' },
{ iso: 'en', file: 'en.json' },
],
});
updater.update().catch(console.error);
const CrowdinUpdater = require('@derpierre65/crowdin-updater');
const updater = new CrowdinUpdater({
projectId: 12345,
crowdinMainFile: 'my-directory/',
// for all crowdin files:
// crowdinMainFile: '',
tempDirectory: path.resolve('./temp-translation.zip'),
localeDirectory: path.resolve('./static/assets/locales/'),
logPath: path.resolve('./crowdin.log'),
authorizationKey: 'Bearer API-TOKEN',
jsonIndent: '\t',
referenceLocale: 'en',
locales: [
'de',
'en',
],
});
updater.update().catch(console.error);
const updater = new CrowdinUpdater({
projectId: 12345,
crowdinMainFile: 'my-default.json',
tempDirectory: path.resolve('./temp-translation.zip'),
localeDirectory: path.resolve('./static/assets/locales/'),
logPath: path.resolve('./crowdin.log'),
authorizationKey: 'Bearer API-TOKEN',
jsonIndent: '\t',
referenceLocale: 'en',
locales: [
{ iso: 'de', file: 'de.json' },
{ iso: 'en', file: 'en.json' },
],
});
updater
.createBuild()
.then(() => updater.update())
.catch((error) => {
console.error(error);
});