From 6ca1e1f60b6ec551f3d7754b94c93ff8b9b32e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=BF=20corey=20=28they/them=29?= Date: Mon, 20 Mar 2023 17:35:39 -0700 Subject: [PATCH] Add TODO and rebuild --- dist/check-i18n-variables | 10 ++++++++-- dist/check-i18n-variables.js | 0 dist/check-i18next-icu-parser.js | 0 dist/check-missing-translations.js | 0 dist/helpers.js | 13 ------------- src/check-i18n-variables | 10 +++++++++- 6 files changed, 17 insertions(+), 16 deletions(-) mode change 100755 => 100644 dist/check-i18n-variables.js mode change 100755 => 100644 dist/check-i18next-icu-parser.js mode change 100755 => 100644 dist/check-missing-translations.js diff --git a/dist/check-i18n-variables b/dist/check-i18n-variables index edfb13a..c2f8e97 100755 --- a/dist/check-i18n-variables +++ b/dist/check-i18n-variables @@ -16,9 +16,15 @@ const { } = require('./translation-extraction.js') const {getFiles, filterJsFiles, supportedLngs} = require('./helpers.js') -const projects = process.argv.slice(2) +const [_nodeBin, _scriptPath, ...projects] = process.argv -console.log(projects) +if (projects.length < 1) { + console.log('Usage: check-i18n-variables ') + return +} + +// TODO: Pass in via ENV? +const ns = ['school', 'student', 'console', 'classroom', 'common'] const translationKeysWithKnownVariablesInProject = async project => { const files = await getFiles(project) diff --git a/dist/check-i18n-variables.js b/dist/check-i18n-variables.js old mode 100755 new mode 100644 diff --git a/dist/check-i18next-icu-parser.js b/dist/check-i18next-icu-parser.js old mode 100755 new mode 100644 diff --git a/dist/check-missing-translations.js b/dist/check-missing-translations.js old mode 100755 new mode 100644 diff --git a/dist/helpers.js b/dist/helpers.js index f0982c5..8a3a46a 100644 --- a/dist/helpers.js +++ b/dist/helpers.js @@ -29,19 +29,6 @@ const filterJsFiles = f => module.exports.filterJsFiles = filterJsFiles -const projects = [ - 'core', - 'student-materials', - 'educator-materials', - 'entities', - 'school', - 'student', - 'console', - 'classroom' -] - -module.exports.projects = projects - const supportedLngs = ['es', 'en', 'en-GB'] module.exports.supportedLngs = supportedLngs diff --git a/src/check-i18n-variables b/src/check-i18n-variables index 14de2ff..c2f8e97 100755 --- a/src/check-i18n-variables +++ b/src/check-i18n-variables @@ -16,7 +16,15 @@ const { } = require('./translation-extraction.js') const {getFiles, filterJsFiles, supportedLngs} = require('./helpers.js') -const projects = process.argv.slice(2) +const [_nodeBin, _scriptPath, ...projects] = process.argv + +if (projects.length < 1) { + console.log('Usage: check-i18n-variables ') + return +} + +// TODO: Pass in via ENV? +const ns = ['school', 'student', 'console', 'classroom', 'common'] const translationKeysWithKnownVariablesInProject = async project => { const files = await getFiles(project)