diff --git a/Extension/c_cpp_properties.schema.json b/Extension/c_cpp_properties.schema.json index bc0b31fdf..a63ba8324 100644 --- a/Extension/c_cpp_properties.schema.json +++ b/Extension/c_cpp_properties.schema.json @@ -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": [ diff --git a/Extension/gulpfile.js b/Extension/gulpfile.js index aec7ffd83..803eba83c 100644 --- a/Extension/gulpfile.js +++ b/Extension/gulpfile.js @@ -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, "");