Add support for localization hints in schema files (#8016)
This commit is contained in:
Родитель
5623d1ecf5
Коммит
6610004132
|
@ -188,6 +188,7 @@
|
|||
"env": {
|
||||
"type": "object",
|
||||
"description": "Custom variables that can be reused anywhere in this file using the ${variable} or ${env:variable} syntax.",
|
||||
"descriptionHint": "The word 'variable' within curly braces should also be translated. The \"env\" should not be translated, and the punctuation (\"${:}\") should be preserved.",
|
||||
"patternProperties": {
|
||||
"(?!^workspaceFolder$)(?!^workspaceRoot$)(?!^workspaceFolderBasename$)(?!^default$)(^.+$)": {
|
||||
"oneOf": [
|
||||
|
|
|
@ -219,8 +219,9 @@ const processJsonSchemaFiles = () => {
|
|||
};
|
||||
let descriptionCallback = (path, value, parent) => {
|
||||
let locId = filePath + "." + path;
|
||||
let locHint = parent.descriptionHint;
|
||||
localizationJsonContents[locId] = value;
|
||||
localizationMetadataContents.keys.push(locId);
|
||||
localizationMetadataContents.keys.push(locHint ? { key: locId, comment: [locHint] } : locId);
|
||||
localizationMetadataContents.messages.push(value);
|
||||
};
|
||||
traverseJson(jsonTree, descriptionCallback, "");
|
||||
|
|
Загрузка…
Ссылка в новой задаче