From 5d7c8d9212ede10c81a078857ca15e279445878a Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 4 Sep 2019 08:05:36 +0200 Subject: [PATCH] fix i18n for extensions --- build/gulpfile.vscode.js | 4 ++-- build/lib/i18n.js | 10 +++++----- build/lib/i18n.ts | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 6bb695db68cfe..c891b8f48e021 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -480,7 +480,7 @@ gulp.task(task.define( optimizeVSCodeTask, function () { const pathToMetadata = './out-vscode/nls.metadata.json'; - const pathToExtensions = './extensions/*'; + const pathToExtensions = '.build/extensions/*'; const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}'; return es.merge( @@ -501,7 +501,7 @@ gulp.task(task.define( optimizeVSCodeTask, function () { const pathToMetadata = './out-vscode/nls.metadata.json'; - const pathToExtensions = './extensions/*'; + const pathToExtensions = '.build/extensions/*'; const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}'; return es.merge( diff --git a/build/lib/i18n.js b/build/lib/i18n.js index 067e1e66889b2..f7302fc12eefc 100644 --- a/build/lib/i18n.js +++ b/build/lib/i18n.js @@ -580,7 +580,7 @@ function createXlfFilesForExtensions() { } return _xlf; } - gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe(event_stream_1.through(function (file) { + gulp.src([`.build/extensions/${extensionName}/package.nls.json`, `.build/extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe(event_stream_1.through(function (file) { if (file.isBuffer()) { const buffer = file.contents; const basename = path.basename(file.path); @@ -603,7 +603,7 @@ function createXlfFilesForExtensions() { } else if (basename === 'nls.metadata.json') { const json = JSON.parse(buffer.toString('utf8')); - const relPath = path.relative(`./extensions/${extensionName}`, path.dirname(file.path)); + const relPath = path.relative(`.build/extensions/${extensionName}`, path.dirname(file.path)); for (let file in json) { const fileContent = json[file]; getXlf().addFile(`extensions/${extensionName}/${relPath}/${file}`, fileContent.keys, fileContent.messages); @@ -906,8 +906,8 @@ function pullCoreAndExtensionsXlfFiles(apiHostname, username, password, language _coreAndExtensionResources.push(...json.workbench); // extensions let extensionsToLocalize = Object.create(null); - glob.sync('./extensions/**/*.nls.json').forEach(extension => extensionsToLocalize[extension.split('/')[2]] = true); - glob.sync('./extensions/*/node_modules/vscode-nls').forEach(extension => extensionsToLocalize[extension.split('/')[2]] = true); + glob.sync('.build/extensions/**/*.nls.json').forEach(extension => extensionsToLocalize[extension.split('/')[2]] = true); + glob.sync('.build/extensions/*/node_modules/vscode-nls').forEach(extension => extensionsToLocalize[extension.split('/')[2]] = true); Object.keys(extensionsToLocalize).forEach(extension => { _coreAndExtensionResources.push({ name: extension, project: extensionsProject }); }); @@ -1080,7 +1080,7 @@ function prepareI18nPackFiles(externalExtensions, resultingTranslationPaths, pse resultingTranslationPaths.push({ id: 'vscode', resourceName: 'main.i18n.json' }); this.queue(translatedMainFile); for (let extension in extensionsPacks) { - const translatedExtFile = createI18nFile(`./extensions/${extension}`, extensionsPacks[extension]); + const translatedExtFile = createI18nFile(`.build/extensions/${extension}`, extensionsPacks[extension]); this.queue(translatedExtFile); const externalExtensionId = externalExtensions[extension]; if (externalExtensionId) { diff --git a/build/lib/i18n.ts b/build/lib/i18n.ts index 9f53df17bad6d..81bf1d3991ba6 100644 --- a/build/lib/i18n.ts +++ b/build/lib/i18n.ts @@ -701,7 +701,7 @@ export function createXlfFilesForExtensions(): ThroughStream { } return _xlf; } - gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe(through(function (file: File) { + gulp.src([`.build/extensions/${extensionName}/package.nls.json`, `.build/extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe(through(function (file: File) { if (file.isBuffer()) { const buffer: Buffer = file.contents as Buffer; const basename = path.basename(file.path); @@ -721,7 +721,7 @@ export function createXlfFilesForExtensions(): ThroughStream { getXlf().addFile(`extensions/${extensionName}/package`, keys, messages); } else if (basename === 'nls.metadata.json') { const json: BundledExtensionFormat = JSON.parse(buffer.toString('utf8')); - const relPath = path.relative(`./extensions/${extensionName}`, path.dirname(file.path)); + const relPath = path.relative(`.build/extensions/${extensionName}`, path.dirname(file.path)); for (let file in json) { const fileContent = json[file]; getXlf().addFile(`extensions/${extensionName}/${relPath}/${file}`, fileContent.keys, fileContent.messages); @@ -1045,8 +1045,8 @@ export function pullCoreAndExtensionsXlfFiles(apiHostname: string, username: str // extensions let extensionsToLocalize = Object.create(null); - glob.sync('./extensions/**/*.nls.json').forEach(extension => extensionsToLocalize[extension.split('/')[2]] = true); - glob.sync('./extensions/*/node_modules/vscode-nls').forEach(extension => extensionsToLocalize[extension.split('/')[2]] = true); + glob.sync('.build/extensions/**/*.nls.json').forEach(extension => extensionsToLocalize[extension.split('/')[2]] = true); + glob.sync('.build/extensions/*/node_modules/vscode-nls').forEach(extension => extensionsToLocalize[extension.split('/')[2]] = true); Object.keys(extensionsToLocalize).forEach(extension => { _coreAndExtensionResources.push({ name: extension, project: extensionsProject }); @@ -1245,7 +1245,7 @@ export function prepareI18nPackFiles(externalExtensions: Map, resultingT this.queue(translatedMainFile); for (let extension in extensionsPacks) { - const translatedExtFile = createI18nFile(`./extensions/${extension}`, extensionsPacks[extension]); + const translatedExtFile = createI18nFile(`.build/extensions/${extension}`, extensionsPacks[extension]); this.queue(translatedExtFile); const externalExtensionId = externalExtensions[extension];