UNPKG

crowdfree

Version:

A crowdin compatible tool for translation and localisation of websites and applications

26 lines (18 loc) 820 B
/* Simple interactive CLI tool for quick translations. Usefull for small additions or newer projects. */ const { getTranslations } = require("./main") const { saveLocale, findLocaleFolder } = require("./localeTools") ; (async () => { // Parse CLI arguments const node_path = process.argv.shift() const index_location = process.argv.shift() const working_directory = process.argv.shift() || "." const localeFolder = await findLocaleFolder("./", working_directory) const { translations, locales } = await getTranslations(localeFolder) const toTranslate = translations.filter(x => Object.keys(x.value).length < locales.length) console.log("To translate: ",JSON.stringify(toTranslate, null, 2)) // Create interactive prompt for localizing })()