onesky-fetch
Version:
Fetch and upload translation files from www.oneskyapp.com working in node.js and browser apps.
31 lines (25 loc) • 873 B
JavaScript
/**
* Created by rkretzschmar on 27.02.17.
*/
const oneSkyFetch = require('./distribution/node.index');
const oneSkyConfig = {
"secret": "I0Ga9QSk9PIh2P705p2r05tVvL5xY7sw",
"apiKey": "YYxXEf7DVGLNlJDgYwyOrRzNtvbhttEh",
"projectId": "98427",
"fileName": "strings.json",
"fileFormat": "HIERARCHICAL_JSON",
"baseLanguage": "de"
};
const osf = oneSkyFetch(oneSkyConfig);
osf.uploadFile(
'{"confirmAdvanceStatusMessage":"confirmAdvanceStatusMessage TEST XXX 2018"}',
oneSkyConfig.fileName,
oneSkyConfig.fileFormat,
{locale:'en', is_keeping_all_strings: true})
.then(result => console.log(result.status));
// osf.fetchLanguages()
// .then(languages => console.log(languages))
// .catch(err => console.error(err));
// osf.fetchAllTranslations('strings.json')
// .then(languages => console.log(languages))
// .catch(err => console.error(err));