removed legacy translations
This commit is contained in:
@@ -81,7 +81,6 @@
|
|||||||
"copy-webpack-plugin": "^11.0.0",
|
"copy-webpack-plugin": "^11.0.0",
|
||||||
"cssnano": "^5.1.14",
|
"cssnano": "^5.1.14",
|
||||||
"glob": "^8.0.3",
|
"glob": "^8.0.3",
|
||||||
"mkdirp": "^1.0.4",
|
|
||||||
"postcss": "^8.4.19",
|
"postcss": "^8.4.19",
|
||||||
"postcss-cli": "^10.0.0",
|
"postcss-cli": "^10.0.0",
|
||||||
"webpack": "^5.75.0",
|
"webpack": "^5.75.0",
|
||||||
|
|||||||
+1
-7
@@ -5,13 +5,11 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const globSync = require('glob').sync;
|
const globSync = require('glob').sync;
|
||||||
const mkdirpSync = require('mkdirp').sync;
|
|
||||||
|
|
||||||
const EXTRACTED_STRINGS = './src/i18n/ex/base-en.json';
|
const EXTRACTED_STRINGS = './src/i18n/ex/base-en.json';
|
||||||
const BASE_LANG = 'en';
|
const BASE_LANG = 'en';
|
||||||
const LANG_PATTERN = './src/i18n/*.json';
|
const LANG_PATTERN = './src/i18n/*.json';
|
||||||
const LANG_PATTERN_ONE = './src/i18n/%s.json';
|
const LANG_PATTERN_ONE = './src/i18n/%s.json';
|
||||||
const FINAL_FILE = './src/messages.json';
|
|
||||||
const OUTPUT_PATTERN = './src/i18n.min/%s.json';
|
const OUTPUT_PATTERN = './src/i18n.min/%s.json';
|
||||||
|
|
||||||
const args = process.argv.slice(2);
|
const args = process.argv.slice(2);
|
||||||
@@ -123,11 +121,7 @@ const messages = globSync(LANG_PATTERN)
|
|||||||
return { ...collection, ...descriptors };
|
return { ...collection, ...descriptors };
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
// Legacy: Write a single file with all translations combined.
|
// Write minified translation files, one per language.
|
||||||
//mkdirpSync(path.dirname(FINAL_FILE));
|
|
||||||
//fs.writeFileSync(FINAL_FILE, JSON.stringify(messages));
|
|
||||||
|
|
||||||
// New way: write minified ptraslation files.
|
|
||||||
for (let lang in messages) {
|
for (let lang in messages) {
|
||||||
fs.writeFileSync(printf(OUTPUT_PATTERN, lang), JSON.stringify(messages[lang]));
|
fs.writeFileSync(printf(OUTPUT_PATTERN, lang), JSON.stringify(messages[lang]));
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user