-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3130 from zowe/chore/update-dev-deps
Update dev deps and fix code smells for V3
- Loading branch information
Showing
17 changed files
with
561 additions
and
1,607 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,32 @@ | ||
/** | ||
* Merges package.nls.json and bundle.l10n.json into a key-value JSON file that | ||
* can be imported into POEditor. | ||
* can be imported into POEditor. Run this script without any arguments to | ||
* merge l10n templates, or specify a language ID to merge translation files. | ||
*/ | ||
|
||
const fs = require("fs"); | ||
const langId = process.argv[2]; | ||
const poeditorJson = {}; | ||
const packageNls = require(__dirname + "/../package.nls.json"); | ||
for (const [k, v] of Object.entries(packageNls)) { | ||
poeditorJson[k] = { [v]: "" }; | ||
if (!langId) { | ||
for (const [k, v] of Object.entries(packageNls)) { | ||
poeditorJson[k] = { [v]: "" }; | ||
} | ||
} else { | ||
const packageNls2 = require(__dirname + "/../package.nls." + langId + ".json"); | ||
for (const [k, v] of Object.entries(packageNls)) { | ||
poeditorJson[k] = packageNls2[k] ? { [v]: packageNls2[k] } : undefined; | ||
} | ||
} | ||
const l10nBundle = require(__dirname + "/../l10n/bundle.l10n.json"); | ||
for (const [k, v] of Object.entries(l10nBundle)) { | ||
poeditorJson[typeof v === "string" ? k : v.message] = ""; | ||
if (!langId) { | ||
for (const [k, v] of Object.entries(l10nBundle)) { | ||
poeditorJson[typeof v === "string" ? k : v.message] = ""; | ||
} | ||
} else { | ||
const l10nBundle2 = require(__dirname + "/../l10n/bundle.l10n." + langId + ".json"); | ||
for (const [k, v] of Object.entries(l10nBundle)) { | ||
poeditorJson[typeof v === "string" ? k : v.message] = l10nBundle2[k]?.message || l10nBundle2[k]; | ||
} | ||
} | ||
fs.writeFileSync(__dirname + "/../l10n/poeditor.json", JSON.stringify(poeditorJson, null, 2) + "\n"); | ||
fs.writeFileSync(__dirname + "/../l10n/poeditor." + (langId ? `${langId}.json` : "json"), JSON.stringify(poeditorJson, null, 2) + "\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.