@@ -15,6 +15,10 @@ import * as configs from './configurations';
1515import * as ext from './extension' ;
1616import * as cp from "child_process" ;
1717import { OtherSettings } from './settings' ;
18+ import * as nls from 'vscode-nls' ;
19+
20+ nls . config ( { messageFormat : nls . MessageFormat . bundle , bundleFormat : nls . BundleFormat . standalone } ) ( ) ;
21+ const localize : nls . LocalizeFunc = nls . loadMessageBundle ( ) ;
1822
1923export interface CppBuildTaskDefinition extends TaskDefinition {
2024 type : string ;
@@ -156,7 +160,7 @@ export class CppBuildTaskProvider implements TaskProvider {
156160
157161 if ( ! definition ) {
158162 const taskLabel : string = ( ( appendSourceToName && ! compilerPathBase . startsWith ( CppBuildTaskProvider . CppBuildSourceStr ) ) ?
159- CppBuildTaskProvider . CppBuildSourceStr + ": " : "" ) + compilerPathBase + " build active file" ;
163+ CppBuildTaskProvider . CppBuildSourceStr + ": " : "" ) + compilerPathBase + " " + localize ( "build_active_file" , " build active file") ;
160164 const filePath : string = path . join ( '${fileDirname}' , '${fileBasenameNoExtension}' ) ;
161165 const isWindows : boolean = os . platform ( ) === 'win32' ;
162166 let args : string [ ] = isCl ? [ '/Zi' , '/EHsc' , '/Fe:' , filePath + '.exe' , '${file}' ] : [ '-g' , '${file}' , '-o' , filePath + ( isWindows ? '.exe' : '' ) ] ;
@@ -191,7 +195,7 @@ export class CppBuildTaskProvider implements TaskProvider {
191195 ) , isCl ? '$msCompile' : '$gcc' ) ;
192196
193197 task . group = TaskGroup . Build ;
194- task . detail = detail ? detail : " compiler: " + resolvedcompilerPath ;
198+ task . detail = detail ? detail : localize ( "compiler_details" , " compiler:" ) + " " + resolvedcompilerPath ;
195199
196200 return task ;
197201 } ;
@@ -255,7 +259,7 @@ export class CppBuildTaskProvider implements TaskProvider {
255259 ...selectedTask . definition ,
256260 problemMatcher : selectedTask . problemMatchers ,
257261 group : { kind : "build" , "isDefault" : true } ,
258- detail : "Generated task by Debugger"
262+ detail : localize ( "task_generated_by_debugger" , "Task generated by Debugger." )
259263 } ;
260264 rawTasksJson . tasks . push ( newTask ) ;
261265 }
@@ -336,7 +340,7 @@ class CustomBuildTaskTerminal implements Pseudoterminal {
336340 async open ( _initialDimensions : TerminalDimensions | undefined ) : Promise < void > {
337341 telemetry . logLanguageServerEvent ( "cppBuildTaskStarted" ) ;
338342 // At this point we can start using the terminal.
339- this . writeEmitter . fire ( ` Starting build...${ this . endOfLine } ` ) ;
343+ this . writeEmitter . fire ( localize ( "starting_build" , " Starting build..." ) + this . endOfLine ) ;
340344 await this . doBuild ( ) ;
341345 }
342346
@@ -369,13 +373,13 @@ class CustomBuildTaskTerminal implements Pseudoterminal {
369373 if ( _error ) {
370374 telemetry . logLanguageServerEvent ( "cppBuildTaskError" ) ;
371375 const dot : string = ( stdout || _stderr ) ? ":" : "." ;
372- this . writeEmitter . fire ( ` Build finished with error${ dot } ${ this . endOfLine } ` ) ;
376+ this . writeEmitter . fire ( localize ( "build_finished_with_error" , " Build finished with error(s)" ) + dot + this . endOfLine ) ;
373377 splitWriteEmitter ( stdout ) ;
374378 splitWriteEmitter ( _stderr ) ;
375379 resolve ( - 1 ) ;
376380 } else {
377381 splitWriteEmitter ( stdout ) ;
378- this . writeEmitter . fire ( ` Build finished successfully.${ this . endOfLine } ` ) ;
382+ this . writeEmitter . fire ( localize ( "build_finished_successfully" , " Build finished successfully." ) + this . endOfLine ) ;
379383 resolve ( 0 ) ;
380384 }
381385 } ) ;
0 commit comments