Skip to content

Commit

Permalink
Merge remote-tracking branch 'ze/main' into webviewlocalization
Browse files Browse the repository at this point in the history
Signed-off-by: likhithanimma1 <142219673+likhithanimma1@users.noreply.github.com>
  • Loading branch information
likhithanimma1 committed Oct 14, 2024
2 parents 9448f1c + 525d29d commit 223a0a2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '20.x'

# use pnpm version 8 until Octorelease supports pnpm@9
- name: Install pnpm and Lerna
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 18
node-version: lts/*

- run: |
npm install -g pnpm@8
Expand Down
1 change: 0 additions & 1 deletion packages/zowe-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1795,7 +1795,6 @@
"pretty": "prettier --write .",
"generateLocalization": "pnpm dlx @vscode/l10n-dev export --o ./l10n ./src && node ./scripts/generatePoeditorJson.js",
"copy-secrets": "node ./scripts/getSecretsPrebuilds.js",
"strip-l10n": "node ./scripts/stripL10nComments.js",
"build:nlsExtract": "pnpm dlx @vscode/l10n-dev export --outDir ./l10n ./src",
"build:nlsPseudo": "pnpm dlx @vscode/l10n-dev generate-pseudo -o ./l10n/ ./l10n/bundle.l10n.json ./package.nls.json",
"build:nls": "pnpm run build:nlsExtract && pnpm run build:nlsPseudo"
Expand Down
15 changes: 14 additions & 1 deletion packages/zowe-explorer/scripts/generatePoeditorJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

const fs = require("fs");
const langId = process.argv[2];
const langId = process.argv.slice(2).find(arg => !arg.startsWith("-"));
const fileSuffix = langId ? `${langId}.json` : "json";
const poeditorJson = {};
const packageNls = require(__dirname + "/../package.nls." + fileSuffix);
Expand All @@ -25,3 +25,16 @@ for (const [k, v] of Object.entries(l10nBundle)) {
}
}
fs.writeFileSync(__dirname + "/../l10n/poeditor." + fileSuffix, JSON.stringify(poeditorJson, null, 2) + "\n");

if (process.argv.includes("--strip")) {
// Strip comments out of bundle.l10n.json and sort properties by key
const jsonFilePath = __dirname + "/../l10n/bundle.l10n.json";
let l10nBundle = JSON.parse(fs.readFileSync(jsonFilePath, "utf-8"));
for (const [k, v] of Object.entries(l10nBundle)) {
if (typeof v === "object") {
l10nBundle[k] = l10nBundle[k].message;
}
}
l10nBundle = Object.fromEntries(Object.entries(l10nBundle).sort(([a], [b]) => a.localeCompare(b)));
fs.writeFileSync(jsonFilePath, JSON.stringify(l10nBundle, null, 2) + "\n");
}
11 changes: 0 additions & 11 deletions packages/zowe-explorer/scripts/stripL10nComments.js

This file was deleted.

0 comments on commit 223a0a2

Please sign in to comment.