diff --git a/build/azure-pipelines/upload-nlsmetadata.js b/build/azure-pipelines/upload-nlsmetadata.js index 59ebdfcef03..24d7b011ddf 100644 --- a/build/azure-pipelines/upload-nlsmetadata.js +++ b/build/azure-pipelines/upload-nlsmetadata.js @@ -13,7 +13,7 @@ const azure = require('gulp-azure-storage'); const root = path.dirname(path.dirname(__dirname)); const commit = util.getVersion(root); function main() { - return es.merge(vfs.src('out-vscode-min/nls.metadata.json', { base: 'out-vscode-min' }), vfs.src('.build/extensions/**/nls.metadata.json', { base: '.build/extensions' })) + return es.merge(vfs.src('out-vscode-min/nls.metadata.json', { base: 'out-vscode-min' }), vfs.src('.build/extensions/**/nls.metadata.json', { base: '.build/extensions' }), vfs.src('.build/extensions/**/package.nls.json', { base: '.build/extensions' })) .pipe(merge({ fileName: 'combined.nls.metadata.json', edit: (parsedJson, file) => { @@ -23,7 +23,19 @@ function main() { key = 'vscode'; } else { - key = file.relative.split('/')[0]; + if (file.relative.endsWith('package.nls.json')) { + // put package.nls.json content in ExtensionNlsMetadata format + const convertedJson = { + messages: [], + keys: [] + }; + for (const key of Object.keys(parsedJson)) { + convertedJson.keys.push(key); + convertedJson.messages.push(parsedJson[key]); + } + parsedJson = { package: parsedJson }; + } + key = 'vscode.' + file.relative.split('/')[0]; } return { [key]: parsedJson }; }, diff --git a/build/azure-pipelines/upload-nlsmetadata.ts b/build/azure-pipelines/upload-nlsmetadata.ts index 2a83e881f82..8d16b2e680f 100644 --- a/build/azure-pipelines/upload-nlsmetadata.ts +++ b/build/azure-pipelines/upload-nlsmetadata.ts @@ -16,10 +16,16 @@ const azure = require('gulp-azure-storage'); const root = path.dirname(path.dirname(__dirname)); const commit = util.getVersion(root); +interface PackageNlsJson { + messages: string[]; + keys: Array; +} + function main() { return es.merge( vfs.src('out-vscode-min/nls.metadata.json', { base: 'out-vscode-min' }), - vfs.src('.build/extensions/**/nls.metadata.json', { base: '.build/extensions' })) + vfs.src('.build/extensions/**/nls.metadata.json', { base: '.build/extensions' }), + vfs.src('.build/extensions/**/package.nls.json', { base: '.build/extensions' })) .pipe(merge({ fileName: 'combined.nls.metadata.json', edit: (parsedJson: any, file: any) => { @@ -28,7 +34,19 @@ function main() { if (file.base === 'out-vscode-min') { key = 'vscode'; } else { - key = file.relative.split('/')[0]; + if (file.relative.endsWith('package.nls.json')) { + // put package.nls.json content in ExtensionNlsMetadata format + const convertedJson: PackageNlsJson = { + messages: [], + keys: [] + }; + for (const key of Object.keys(parsedJson)) { + convertedJson.keys.push(key); + convertedJson.messages.push(parsedJson[key]); + } + parsedJson = { package: parsedJson }; + } + key = 'vscode.' + file.relative.split('/')[0]; } return { [key]: parsedJson }; },