Skip to content

Commit 1089169

Browse files
Pull in web strings into Language Pack (microsoft#158053)
remove old tasks and include web strings in export
1 parent 5864b1f commit 1089169

File tree

3 files changed

+20
-39
lines changed

3 files changed

+20
-39
lines changed

build/gulpfile.vscode.js

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
'use strict';
77

88
const gulp = require('gulp');
9+
const merge = require('gulp-merge-json');
910
const fs = require('fs');
1011
const os = require('os');
1112
const cp = require('child_process');
@@ -393,6 +394,8 @@ BUILD_TARGETS.forEach(buildTarget => {
393394
}
394395
});
395396

397+
// #region nls
398+
396399
const innoSetupConfig = {
397400
'zh-cn': { codePage: 'CP936', defaultInfo: { name: 'Simplified Chinese', id: '$0804', } },
398401
'zh-tw': { codePage: 'CP950', defaultInfo: { name: 'Traditional Chinese', id: '$0404' } },
@@ -408,60 +411,30 @@ const innoSetupConfig = {
408411
'tr': { codePage: 'CP1254' }
409412
};
410413

411-
// Transifex Localizations
412-
413-
const apiHostname = process.env.TRANSIFEX_API_URL;
414-
const apiName = process.env.TRANSIFEX_API_NAME;
415-
const apiToken = process.env.TRANSIFEX_API_TOKEN;
416-
417-
gulp.task(task.define(
418-
'vscode-translations-push',
419-
task.series(
420-
compileBuildTask,
421-
compileExtensionsBuildTask,
422-
optimizeVSCodeTask,
423-
function () {
424-
const pathToMetadata = './out-vscode/nls.metadata.json';
425-
const pathToExtensions = '.build/extensions/*';
426-
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
427-
428-
return es.merge(
429-
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
430-
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
431-
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
432-
).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken)
433-
).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken));
434-
}
435-
)
436-
));
437-
438414
gulp.task(task.define(
439415
'vscode-translations-export',
440416
task.series(
441-
compileBuildTask,
417+
core,
442418
compileExtensionsBuildTask,
443-
optimizeVSCodeTask,
444419
function () {
445420
const pathToMetadata = './out-vscode/nls.metadata.json';
421+
const pathToRehWebMetadata = './out-vscode-reh-web/nls.metadata.json';
446422
const pathToExtensions = '.build/extensions/*';
447423
const pathToSetup = 'build/win32/i18n/messages.en.isl';
448424

449425
return es.merge(
450-
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
426+
gulp.src([pathToRehWebMetadata]).pipe(merge({
427+
fileName: 'nls.metadata.json',
428+
jsonSpace: '',
429+
concatArrays: true
430+
})).pipe(i18n.createXlfFilesForCoreBundle()),
451431
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
452432
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
453433
).pipe(vfs.dest('../vscode-translations-export'));
454434
}
455435
)
456436
));
457437

458-
gulp.task('vscode-translations-pull', function () {
459-
return es.merge([...i18n.defaultLanguages, ...i18n.extraLanguages].map(language => {
460-
const includeDefault = !!innoSetupConfig[language.id].defaultInfo;
461-
return i18n.pullSetupXlfFiles(apiHostname, apiName, apiToken, language, includeDefault).pipe(vfs.dest(`../vscode-translations-import/${language.id}/setup`));
462-
}));
463-
});
464-
465438
gulp.task('vscode-translations-import', function () {
466439
const options = minimist(process.argv.slice(2), {
467440
string: 'location',
@@ -476,3 +449,5 @@ gulp.task('vscode-translations-import', function () {
476449
.pipe(vfs.dest(`./build/win32/i18n`));
477450
}));
478451
});
452+
453+
// #endregion

build/lib/i18n.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ function processNlsFiles(opts) {
491491
});
492492
}
493493
exports.processNlsFiles = processNlsFiles;
494-
const editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench', extensionsProject = 'vscode-extensions', setupProject = 'vscode-setup';
494+
const editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench', extensionsProject = 'vscode-extensions', setupProject = 'vscode-setup', serverProject = 'vscode-server';
495495
function getResource(sourceFile) {
496496
let resource;
497497
if (/^vs\/platform/.test(sourceFile)) {
@@ -509,6 +509,9 @@ function getResource(sourceFile) {
509509
else if (/^vs\/code/.test(sourceFile)) {
510510
return { name: 'vs/code', project: workbenchProject };
511511
}
512+
else if (/^vs\/server/.test(sourceFile)) {
513+
return { name: 'vs/server', project: serverProject };
514+
}
512515
else if (/^vs\/workbench\/contrib/.test(sourceFile)) {
513516
resource = sourceFile.split('/', 4).join('/');
514517
return { name: resource, project: workbenchProject };

build/lib/i18n.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,8 @@ export function processNlsFiles(opts: { fileHeader: string; languages: Language[
611611
const editorProject: string = 'vscode-editor',
612612
workbenchProject: string = 'vscode-workbench',
613613
extensionsProject: string = 'vscode-extensions',
614-
setupProject: string = 'vscode-setup';
614+
setupProject: string = 'vscode-setup',
615+
serverProject: string = 'vscode-server';
615616

616617
export function getResource(sourceFile: string): Resource {
617618
let resource: string;
@@ -626,6 +627,8 @@ export function getResource(sourceFile: string): Resource {
626627
return { name: 'vs/base', project: editorProject };
627628
} else if (/^vs\/code/.test(sourceFile)) {
628629
return { name: 'vs/code', project: workbenchProject };
630+
} else if (/^vs\/server/.test(sourceFile)) {
631+
return { name: 'vs/server', project: serverProject };
629632
} else if (/^vs\/workbench\/contrib/.test(sourceFile)) {
630633
resource = sourceFile.split('/', 4).join('/');
631634
return { name: resource, project: workbenchProject };

0 commit comments

Comments
 (0)