sync i18n script

This commit is contained in:
lotte
2020-04-23 14:14:29 +02:00
parent ce9fed7507
commit f1d1761fd7
3 changed files with 16 additions and 7 deletions

View File

@@ -39,7 +39,8 @@
"clean:node": "rimraf node_modules", "clean:node": "rimraf node_modules",
"clean:prod": "yarn run clean:coverage && yarn run clean:doc && yarn run clean:dist && yarn run clean:log && yarn run clean:json && yarn run clean:bld", "clean:prod": "yarn run clean:coverage && yarn run clean:doc && yarn run clean:dist && yarn run clean:log && yarn run clean:json && yarn run clean:bld",
"clean": "yarn run clean:prod && yarn run clean:node && yarn run clean:env", "clean": "yarn run clean:prod && yarn run clean:node && yarn run clean:env",
"clean:env": "rimraf src/environments/environment.ts" "clean:env": "rimraf src/environments/environment.ts",
"sync-i18n": "ts-node --project ./tsconfig.ts-node.json scripts/sync-i18n-files.ts"
}, },
"browser": { "browser": {
"fs": false, "fs": false,
@@ -76,6 +77,7 @@
"bootstrap": "4.3.1", "bootstrap": "4.3.1",
"caniuse-lite": "^1.0.30000697", "caniuse-lite": "^1.0.30000697",
"cerialize": "0.1.18", "cerialize": "0.1.18",
"cli-progress": "^3.8.0",
"cookie-parser": "1.4.3", "cookie-parser": "1.4.3",
"core-js": "^3.6.4", "core-js": "^3.6.4",
"debug-loader": "^0.0.1", "debug-loader": "^0.0.1",

View File

@@ -1,10 +1,9 @@
#!/usr/bin/env node import { projectRoot} from '../webpack/helpers';
const commander = require('commander'); const commander = require('commander');
const fs = require('fs'); const fs = require('fs');
const JSON5 = require('json5'); const JSON5 = require('json5');
const _cliProgress = require('cli-progress'); const _cliProgress = require('cli-progress');
const _ = require('lodash'); const _ = require('lodash');
const {projectRoot} = require('../webpack/helpers');
const program = new commander.Command(); const program = new commander.Command();
program.version('1.0.0', '-v, --version'); program.version('1.0.0', '-v, --version');
@@ -13,8 +12,8 @@ const NEW_MESSAGE_TODO = '// TODO New key - Add a translation';
const MESSAGE_CHANGED_TODO = '// TODO Source message changed - Revise the translation'; const MESSAGE_CHANGED_TODO = '// TODO Source message changed - Revise the translation';
const COMMENTS_CHANGED_TODO = '// TODO Source comments changed - Revise the translation'; const COMMENTS_CHANGED_TODO = '// TODO Source comments changed - Revise the translation';
const DEFAULT_SOURCE_FILE_LOCATION = 'resources/i18n/en.json5'; const DEFAULT_SOURCE_FILE_LOCATION = 'src/assets/i18n/en.json5';
const LANGUAGE_FILES_LOCATION = 'resources/i18n'; const LANGUAGE_FILES_LOCATION = 'src/assets/i18n';
parseCliInput(); parseCliInput();

View File

@@ -2595,6 +2595,14 @@ cli-cursor@^3.1.0:
dependencies: dependencies:
restore-cursor "^3.1.0" restore-cursor "^3.1.0"
cli-progress@^3.8.0:
version "3.8.0"
resolved "https://registry.yarnpkg.com/cli-progress/-/cli-progress-3.8.0.tgz#81ba8cf008b9b211805f3396b8cfcd0283646d6e"
integrity sha512-3e+m7ecKbVTF2yo186vrrt/5217ZwE64z61kMwhSFmgrF3qZiTUuV9Fdh2RyzSkhLRfsqFf721KiUDEAJlP5pA==
dependencies:
colors "^1.1.2"
string-width "^4.2.0"
cli-width@^2.0.0: cli-width@^2.0.0:
version "2.2.0" version "2.2.0"
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639"
@@ -2744,7 +2752,7 @@ colors@1.1.2:
resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63"
integrity sha1-FopHAXVran9RoSzgyXv6KMCE7WM= integrity sha1-FopHAXVran9RoSzgyXv6KMCE7WM=
colors@^1.1.0: colors@^1.1.0, colors@^1.1.2:
version "1.4.0" version "1.4.0"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78"
integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==
@@ -9875,7 +9883,7 @@ string-width@^3.0.0, string-width@^3.1.0:
is-fullwidth-code-point "^2.0.0" is-fullwidth-code-point "^2.0.0"
strip-ansi "^5.1.0" strip-ansi "^5.1.0"
string-width@^4.1.0: string-width@^4.1.0, string-width@^4.2.0:
version "4.2.0" version "4.2.0"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5"
integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==