@@ -180,6 +180,23 @@ const libraryTargets = librarySourceMap.map(function(f) {
180
180
return path . join ( builtLocalDirectory , f . target ) ;
181
181
} ) ;
182
182
183
+ /**
184
+ * .lcg file is what localization team uses to know what messages to localize.
185
+ * The file is always generated in 'enu\diagnosticMessages.generated.json.lcg'
186
+ */
187
+ const generatedLCGFile = path . join ( builtLocalDirectory , "enu" , "diagnosticMessages.generated.json.lcg" ) ;
188
+
189
+ /**
190
+ * The localization target produces the two following transformations:
191
+ * 1. 'src\loc\lcl\<locale>\diagnosticMessages.generated.json.lcl' => 'built\local\<locale>\diagnosticMessages.generated.json'
192
+ * convert localized resources into a .json file the compiler can understand
193
+ * 2. 'src\compiler\diagnosticMessages.generated.json' => 'built\local\ENU\diagnosticMessages.generated.json.lcg'
194
+ * generate the lcg file (source of messages to localize) from the diagnosticMessages.generated.json
195
+ */
196
+ const localizationTargets = [ "cs" , "de" , "es" , "fr" , "it" , "ja" , "ko" , "pl" , "pt-BR" , "ru" , "tr" , "zh-CN" , "zh-TW" ] . map ( function ( f ) {
197
+ return path . join ( builtLocalDirectory , f , "diagnosticMessages.generated.json" ) ;
198
+ } ) . concat ( generatedLCGFile ) ;
199
+
183
200
for ( const i in libraryTargets ) {
184
201
const entry = librarySourceMap [ i ] ;
185
202
const target = libraryTargets [ i ] ;
@@ -398,7 +415,6 @@ gulp.task(generateLocalizedDiagnosticMessagesJs, /*help*/ false, [], () => {
398
415
} ) ;
399
416
400
417
// Localize diagnostics
401
- const generatedLCGFile = path . join ( builtLocalDirectory , "enu" , "diagnosticMessages.generated.json.lcg" ) ;
402
418
gulp . task ( generatedLCGFile , [ generateLocalizedDiagnosticMessagesJs , diagnosticInfoMapTs ] , ( done ) => {
403
419
if ( fs . existsSync ( builtLocalDirectory ) && needsUpdate ( generatedDiagnosticMessagesJSON , generatedLCGFile ) ) {
404
420
exec ( host , [ generateLocalizedDiagnosticMessagesJs , lclDirectory , builtLocalDirectory , generatedDiagnosticMessagesJSON ] , done , done ) ;
@@ -576,8 +592,7 @@ gulp.task("dontUseDebugMode", /*help*/ false, [], (done) => { useDebugMode = fal
576
592
gulp . task ( "VerifyLKG" , /*help*/ false , [ ] , ( ) => {
577
593
const expectedFiles = [ builtLocalCompiler , servicesFile , serverFile , nodePackageFile , nodeDefinitionsFile , standaloneDefinitionsFile , tsserverLibraryFile , tsserverLibraryDefinitionFile , typingsInstallerJs , cancellationTokenJs ] . concat ( libraryTargets ) ;
578
594
const missingFiles = expectedFiles .
579
- concat ( fs . readdirSync ( lclDirectory ) . map ( function ( d ) { return path . join ( builtLocalDirectory , d , "diagnosticMessages.generated.json" ) ; } ) ) .
580
- concat ( generatedLCGFile ) .
595
+ concat ( localizationTargets ) .
581
596
filter ( f => ! fs . existsSync ( f ) ) ;
582
597
if ( missingFiles . length > 0 ) {
583
598
throw new Error ( "Cannot replace the LKG unless all built targets are present in directory " + builtLocalDirectory +
0 commit comments