From 1c6ec0f8e34e73a05dd14ea833576ee972084448 Mon Sep 17 00:00:00 2001 From: Nybkox Date: Wed, 19 Feb 2025 12:19:18 +0100 Subject: [PATCH] refactor: add index.js to translations-cli, add translations:extract to package.json --- common/translations-cli/index.js | 3 +++ common/translations-cli/program.js | 4 ++-- package.json | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 common/translations-cli/index.js diff --git a/common/translations-cli/index.js b/common/translations-cli/index.js new file mode 100644 index 000000000..db840a088 --- /dev/null +++ b/common/translations-cli/index.js @@ -0,0 +1,3 @@ +const { program } = require('./program'); + +program.parse(); diff --git a/common/translations-cli/program.js b/common/translations-cli/program.js index 1ff90b119..15ba3a2ac 100644 --- a/common/translations-cli/program.js +++ b/common/translations-cli/program.js @@ -19,7 +19,7 @@ const { extractAllTranslations } = require('./extract'); const defaultConfig = { extensions: ['.js', '.ts', '.svelte'], directories: ['app', 'packages/web'], - outputFile: './translations/en.json', + outputFile: './translations/en-US.json', }; program.name('dbgate-translations-cli').description('CLI tool for managing translation').version('1.0.0'); @@ -86,4 +86,4 @@ program } }); -program.parse(); +module.exports = { program }; diff --git a/package.json b/package.json index b57953ab0..85f3d8e2c 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "dbgate-serve": "node packages/dbgate/bin/dbgate-serve.js", "workflows": "node common/processWorkflows.js", "cy:open": "cd e2e-tests && yarn cy:open" + "translations:extract": "node common/translations-cli/index.js extract" }, "dependencies": { "concurrently": "^5.1.0",