@@ -9,6 +9,9 @@ import { Uri, commands, scm, Disposable, SCMResourceGroup, SCMResource, window,
99import { IRef , RefType } from './git' ;
1010import { Model , Resource , Status } from './model' ;
1111import * as path from 'path' ;
12+ import * as nls from 'vscode-nls' ;
13+
14+ const localize = nls . loadMessageBundle ( ) ;
1215
1316function resolveGitURI ( uri : Uri ) : SCMResource | SCMResourceGroup | undefined {
1417 if ( uri . authority !== 'git' ) {
@@ -50,12 +53,16 @@ class CheckoutItem implements QuickPickItem {
5053
5154class CheckoutTagItem extends CheckoutItem {
5255
53- get description ( ) : string { return `Tag at ${ this . shortCommit } ` ; }
56+ get description ( ) : string {
57+ return localize ( 'tag at' , "Tag at {0}" , this . shortCommit ) ;
58+ }
5459}
5560
5661class CheckoutRemoteHeadItem extends CheckoutItem {
5762
58- get description ( ) : string { return `Remote branch at ${ this . shortCommit } ` ; }
63+ get description ( ) : string {
64+ return localize ( 'remote branch at' , "Remote branch at {0}" , this . shortCommit ) ;
65+ }
5966
6067 protected get treeish ( ) : string | undefined {
6168 if ( ! this . ref . name ) {
@@ -93,7 +100,7 @@ export class CommandCenter {
93100
94101 switch ( err . gitErrorCode ) {
95102 case 'DirtyWorkTree' :
96- message = ' Please clean your repository working tree before checkout.' ;
103+ message = localize ( 'clean repo' , " Please clean your repository working tree before checkout." ) ;
97104 break ;
98105 default :
99106 message = ( err . stderr || err . message ) . replace ( / ^ e r r o r : / , '' ) ;
@@ -106,7 +113,7 @@ export class CommandCenter {
106113 }
107114
108115 const outputChannel = this . outputChannel as OutputChannel ;
109- const openOutputChannelChoice = ' Open Git Log' ;
116+ const openOutputChannelChoice = localize ( 'open git log' , " Open Git Log" ) ;
110117 const choice = await window . showErrorMessage ( message , openOutputChannelChoice ) ;
111118
112119 if ( choice === openOutputChannelChoice ) {
@@ -270,9 +277,9 @@ export class CommandCenter {
270277 }
271278
272279 const basename = path . basename ( resource . uri . fsPath ) ;
273- const message = ` Are you sure you want to clean changes in ${ basename } ?` ;
274- const yes = 'Yes' ;
275- const no = 'No , keep them';
280+ const message = localize ( 'confirm clean' , " Are you sure you want to clean changes in {0}?" , basename ) ;
281+ const yes = localize ( 'yes' , "Yes" ) ;
282+ const no = localize ( 'no , keep them', "No, keep them" ) ;
276283 const pick = await window . showQuickPick ( [ yes , no ] , { placeHolder : message } ) ;
277284
278285 if ( pick !== yes ) {
@@ -285,9 +292,9 @@ export class CommandCenter {
285292 @CommandCenter . Command ( 'git.cleanAll' )
286293 @CommandCenter . CatchErrors
287294 async cleanAll ( ) : Promise < void > {
288- const message = ` Are you sure you want to clean all changes?` ;
289- const yes = 'Yes' ;
290- const no = 'No , keep them';
295+ const message = localize ( 'confirm clean all' , " Are you sure you want to clean all changes?" ) ;
296+ const yes = localize ( 'yes' , "Yes" ) ;
297+ const no = localize ( 'no , keep them', "No, keep them" ) ;
291298 const pick = await window . showQuickPick ( [ yes , no ] , { placeHolder : message } ) ;
292299
293300 if ( pick !== yes ) {
@@ -359,8 +366,8 @@ export class CommandCenter {
359366 @CommandCenter . CatchErrors
360367 async branch ( ) : Promise < void > {
361368 const result = await window . showInputBox ( {
362- placeHolder : 'Branch name',
363- prompt : ' Please provide a branch name'
369+ placeHolder : localize ( 'branch name', "Branch name" ) ,
370+ prompt : localize ( 'provide branch name' , " Please provide a branch name" )
364371 } ) ;
365372
366373 if ( ! result ) {
@@ -406,7 +413,7 @@ export class CommandCenter {
406413 async publish ( ) : Promise < void > {
407414 const branchName = this . model . HEAD && this . model . HEAD . name || '' ;
408415 const picks = this . model . remotes . map ( r => r . name ) ;
409- const placeHolder = ` Pick a remote to publish the branch '${ branchName } ' to:` ;
416+ const placeHolder = localize ( 'pick remote' , " Pick a remote to publish the branch '{0 }' to:" , branchName ) ;
410417 const choice = await window . showQuickPick ( picks , { placeHolder } ) ;
411418
412419 if ( ! choice ) {
0 commit comments