Skip to content

Commit 2571e86

Browse files
update reading of loc files (#4495)
1 parent 78e9ce3 commit 2571e86

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Bug Fixes:
3131
- Fix repeat execution option in test presets [#4443](https://github.com/microsoft/vscode-cmake-tools/issues/4443)
3232
- Fix bug that makes some build hang [#4424](https://github.com/microsoft/vscode-cmake-tools/issues/4424) and [#4465](https://github.com/microsoft/vscode-cmake-tools/issues/4465)
3333
- Fix issue with switching to presets during Quick Start. [#4409](https://github.com/microsoft/vscode-cmake-tools/issues/4409)
34+
- Fix bug that shows empty lines in Pinned Commands view. [#4406](https://github.com/microsoft/vscode-cmake-tools/issues/4406)
3435

3536
## 1.20.53
3637

src/util.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,17 @@ export async function getExtensionLocalizedPackageJson(): Promise<{[key: string]
612612
localizedFilePath = path.join(thisExtensionPath(), "package.nls.json");
613613
}
614614
const localizedStrings = fs.readFileSync(localizedFilePath, "utf8");
615-
return JSON.parse(localizedStrings);
615+
616+
// Parse the JSON. Then, some package.nls.json entries have an object with this format:
617+
// { "message": <content>, "comment": [<locComments>]}
618+
// To handle this, we will pull out the content of the "message" field
619+
const parseJSON = JSON.parse(localizedStrings);
620+
for (const key in parseJSON) {
621+
if (parseJSON[key].hasOwnProperty("message")) {
622+
parseJSON[key] = parseJSON[key].message;
623+
}
624+
}
625+
return parseJSON;
616626
}
617627

618628
interface CommandPalette {

0 commit comments

Comments
 (0)