Fixes for locale matching
This commit is contained in:
parent
f42192fb5a
commit
0032d49e23
8 changed files with 179 additions and 5890 deletions
|
@ -4,6 +4,7 @@
|
|||
import { execSync } from 'child_process';
|
||||
import fsExtra from 'fs-extra';
|
||||
import path from 'path';
|
||||
import fastGlob from 'fast-glob';
|
||||
|
||||
const { SMARTLING_USER, SMARTLING_SECRET } = process.env;
|
||||
|
||||
|
@ -16,6 +17,16 @@ if (!SMARTLING_SECRET) {
|
|||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log('Cleaning _locales directory...');
|
||||
const dirEntries = fastGlob.sync(['_locales/*', '!_locales/en'], {
|
||||
onlyDirectories: true,
|
||||
absolute: true,
|
||||
});
|
||||
|
||||
for (const dirEntry of dirEntries) {
|
||||
fsExtra.rmdirSync(dirEntry, { recursive: true });
|
||||
}
|
||||
|
||||
console.log('Fetching latest strings!');
|
||||
console.log();
|
||||
execSync(
|
||||
|
@ -51,6 +62,9 @@ rename('zh-YU', 'yue');
|
|||
// we need to rename it to "zh-Hant" explicitly to make it work.
|
||||
rename('zh-TW', 'zh-Hant');
|
||||
|
||||
// "YR" is not a valid region subtag. Smartling made it up.
|
||||
rename('sr-YR', 'sr');
|
||||
|
||||
console.log('Formatting newly-downloaded strings!');
|
||||
console.log();
|
||||
execSync('yarn format', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue