diff --git a/examples-translations/crowdin.yaml b/examples-translations/crowdin.yaml new file mode 100644 index 0000000000..e3bd756a7d --- /dev/null +++ b/examples-translations/crowdin.yaml @@ -0,0 +1,49 @@ +project_identifier_env: CROWDIN_PROJECT_ID +api_key_env: CROWDIN_API_KEY +base_path: "./" +preserve_hierarchy: true + +files: + - + source: '/docs/en/*.md' + translation: '/docs/%locale%/%original_file_name%' + languages_mapping: &anchor + locale: + 'af': 'af' + 'ar': 'ar' + 'bs-BA': 'bs-BA' + 'ca': 'ca' + 'cs': 'cs' + 'da': 'da' + 'de': 'de' + 'el': 'el' + 'es-ES': 'es-ES' + 'fa': 'fa-IR' + 'fi': 'fi' + 'fr': 'fr' + 'he': 'he' + 'hu': 'hu' + 'id': 'id-ID' + 'it': 'it' + 'ja': 'ja' + 'ko': 'ko' + 'mr': 'mr-IN' + 'nl': 'nl' + 'no': 'no-NO' + 'pl': 'pl' + 'pt-BR': 'pt-BR' + 'pt-PT': 'pt-PT' + 'ro': 'ro' + 'ru': 'ru' + 'sk': 'sk-SK' + 'sr': 'sr' + 'sv-SE': 'sv-SE' + 'tr': 'tr' + 'uk': 'uk' + 'vi': 'vi' + 'zh-CN': 'zh-Hans' + 'zh-TW': 'zh-Hant' + - + source: '/website/i18n/en.json' + translation: '/website/i18n/%locale%.json' + languages_mapping: *anchor diff --git a/examples/languages.js b/examples-translations/languages.js similarity index 100% rename from examples/languages.js rename to examples-translations/languages.js diff --git a/lib/copy-examples.js b/lib/copy-examples.js index 7bb893d1cd..d4f7f2fd15 100644 --- a/lib/copy-examples.js +++ b/lib/copy-examples.js @@ -12,4 +12,10 @@ const CWD = process.cwd(); const fs = require("fs-extra"); -fs.copySync(__dirname + "/../examples/", CWD, { overwrite: false }); +if (process.argv.indexOf("translations") !== -1) { + fs.copySync(__dirname + "/../examples-translations/", CWD, { + overwrite: false + }); +} else { + fs.copySync(__dirname + "/../examples/", CWD, { overwrite: false }); +}