6
6
'use strict' ;
7
7
8
8
const gulp = require ( 'gulp' ) ;
9
+ const merge = require ( 'gulp-merge-json' ) ;
9
10
const fs = require ( 'fs' ) ;
10
11
const os = require ( 'os' ) ;
11
12
const cp = require ( 'child_process' ) ;
@@ -393,6 +394,8 @@ BUILD_TARGETS.forEach(buildTarget => {
393
394
}
394
395
} ) ;
395
396
397
+ // #region nls
398
+
396
399
const innoSetupConfig = {
397
400
'zh-cn' : { codePage : 'CP936' , defaultInfo : { name : 'Simplified Chinese' , id : '$0804' , } } ,
398
401
'zh-tw' : { codePage : 'CP950' , defaultInfo : { name : 'Traditional Chinese' , id : '$0404' } } ,
@@ -408,60 +411,30 @@ const innoSetupConfig = {
408
411
'tr' : { codePage : 'CP1254' }
409
412
} ;
410
413
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
-
438
414
gulp . task ( task . define (
439
415
'vscode-translations-export' ,
440
416
task . series (
441
- compileBuildTask ,
417
+ core ,
442
418
compileExtensionsBuildTask ,
443
- optimizeVSCodeTask ,
444
419
function ( ) {
445
420
const pathToMetadata = './out-vscode/nls.metadata.json' ;
421
+ const pathToRehWebMetadata = './out-vscode-reh-web/nls.metadata.json' ;
446
422
const pathToExtensions = '.build/extensions/*' ;
447
423
const pathToSetup = 'build/win32/i18n/messages.en.isl' ;
448
424
449
425
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 ( ) ) ,
451
431
gulp . src ( pathToSetup ) . pipe ( i18n . createXlfFilesForIsl ( ) ) ,
452
432
gulp . src ( pathToExtensions ) . pipe ( i18n . createXlfFilesForExtensions ( ) )
453
433
) . pipe ( vfs . dest ( '../vscode-translations-export' ) ) ;
454
434
}
455
435
)
456
436
) ) ;
457
437
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
-
465
438
gulp . task ( 'vscode-translations-import' , function ( ) {
466
439
const options = minimist ( process . argv . slice ( 2 ) , {
467
440
string : 'location' ,
@@ -476,3 +449,5 @@ gulp.task('vscode-translations-import', function () {
476
449
. pipe ( vfs . dest ( `./build/win32/i18n` ) ) ;
477
450
} ) ) ;
478
451
} ) ;
452
+
453
+ // #endregion
0 commit comments