Add support for localization hints in schema files (#8016)

This commit is contained in:
Colen Garoutte-Carson 2021-08-23 12:25:03 -07:00 коммит произвёл GitHub
Родитель 5623d1ecf5
Коммит 6610004132
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -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, "");