@@ -13,31 +13,6 @@ class Window : BaseWindow
1313 private const string Menu_Window_GitHub = "Window/GitHub" ;
1414 private const string Menu_Window_GitHub_Command_Line = "Window/GitHub Command Line" ;
1515 private const string BadNotificationDelayError = "A delay of {0} is shorter than the default delay and thus would get pre-empted." ;
16- private const string InitializeTitle = "Initialize" ;
17- private const string HistoryTitle = "History" ;
18- private const string ChangesTitle = "Changes" ;
19- private const string BranchesTitle = "Branches" ;
20- private const string SettingsTitle = "Settings" ;
21- private const string DefaultRepoUrl = "No remote configured" ;
22- private const string Window_RepoUrlTooltip = "Url of the {0} remote" ;
23- private const string Window_RepoNoUrlTooltip = "Add a remote in the Settings tab" ;
24- private const string Window_RepoBranchTooltip = "Active branch" ;
25- private const string FetchActionTitle = "Fetch Changes" ;
26- private const string FetchButtonText = "Fetch" ;
27- private const string FetchFailureDescription = "Could not fetch changes" ;
28- private const string PullButton = "Pull" ;
29- private const string PullButtonCount = "Pull (<b>{0}</b>)" ;
30- private const string PushButton = "Push" ;
31- private const string PushButtonCount = "Push (<b>{0}</b>)" ;
32- private const string PullConfirmTitle = "Pull Changes?" ;
33- private const string PullConfirmDescription = "Would you like to pull changes from remote '{0}'?" ;
34- private const string PullConfirmYes = "Pull" ;
35- private const string PullConfirmCancel = "Cancel" ;
36- private const string PushConfirmTitle = "Push Changes?" ;
37- private const string PushConfirmDescription = "Would you like to push changes to remote '{0}'?" ;
38- private const string PushConfirmYes = "Push" ;
39- private const string PushConfirmCancel = "Cancel" ;
40- private const string PublishButton = "Publish" ;
4116
4217 [ NonSerialized ] private bool currentBranchAndRemoteHasUpdate ;
4318 [ NonSerialized ] private bool currentTrackingStatusHasUpdate ;
@@ -295,7 +270,7 @@ private void MaybeUpdateData()
295270 }
296271
297272 string updatedRepoRemote = null ;
298- string updatedRepoUrl = DefaultRepoUrl ;
273+ string updatedRepoUrl = Localization . DefaultRepoUrl ;
299274
300275 var shouldUpdateContentFields = false ;
301276
@@ -369,24 +344,24 @@ private void MaybeUpdateData()
369344 shouldUpdateContentFields = true ;
370345 }
371346
372- if ( currentRemoteUrl != DefaultRepoUrl )
347+ if ( currentRemoteUrl != Localization . DefaultRepoUrl )
373348 {
374- currentRemoteUrl = DefaultRepoUrl ;
349+ currentRemoteUrl = Localization . DefaultRepoUrl ;
375350 shouldUpdateContentFields = true ;
376351 }
377352 }
378353
379354 if ( shouldUpdateContentFields || currentBranchContent == null || currentRemoteUrlContent == null )
380355 {
381- currentBranchContent = new GUIContent ( currentBranch , Window_RepoBranchTooltip ) ;
356+ currentBranchContent = new GUIContent ( currentBranch , Localization . Window_RepoBranchTooltip ) ;
382357
383358 if ( currentRemoteName != null )
384359 {
385- currentRemoteUrlContent = new GUIContent ( currentRemoteUrl , string . Format ( Window_RepoUrlTooltip , currentRemoteName ) ) ;
360+ currentRemoteUrlContent = new GUIContent ( currentRemoteUrl , string . Format ( Localization . Window_RepoUrlTooltip , currentRemoteName ) ) ;
386361 }
387362 else
388363 {
389- currentRemoteUrlContent = new GUIContent ( currentRemoteUrl , Window_RepoNoUrlTooltip ) ;
364+ currentRemoteUrlContent = new GUIContent ( currentRemoteUrl , Localization . Window_RepoNoUrlTooltip ) ;
390365 }
391366 }
392367 }
@@ -466,15 +441,15 @@ private void DoToolbarGUI()
466441 {
467442 if ( HasRepository )
468443 {
469- changeTab = TabButton ( SubTab . Changes , ChangesTitle , changeTab ) ;
470- changeTab = TabButton ( SubTab . History , HistoryTitle , changeTab ) ;
471- changeTab = TabButton ( SubTab . Branches , BranchesTitle , changeTab ) ;
444+ changeTab = TabButton ( SubTab . Changes , Localization . ChangesTitle , changeTab ) ;
445+ changeTab = TabButton ( SubTab . History , Localization . HistoryTitle , changeTab ) ;
446+ changeTab = TabButton ( SubTab . Branches , Localization . BranchesTitle , changeTab ) ;
472447 }
473448 else if ( ! HasRepository )
474449 {
475- changeTab = TabButton ( SubTab . InitProject , InitializeTitle , changeTab ) ;
450+ changeTab = TabButton ( SubTab . InitProject , Localization . InitializeTitle , changeTab ) ;
476451 }
477- changeTab = TabButton ( SubTab . Settings , SettingsTitle , changeTab ) ;
452+ changeTab = TabButton ( SubTab . Settings , Localization . SettingsTitle , changeTab ) ;
478453 }
479454
480455 if ( EditorGUI . EndChangeCheck ( ) )
@@ -496,21 +471,21 @@ private void DoActionbarGUI()
496471 EditorGUI . BeginDisabledGroup ( currentRemoteName == null ) ;
497472 {
498473 // Fetch button
499- var fetchClicked = GUILayout . Button ( FetchButtonText , Styles . HistoryToolbarButtonStyle ) ;
474+ var fetchClicked = GUILayout . Button ( Localization . FetchButtonText , Styles . HistoryToolbarButtonStyle ) ;
500475 if ( fetchClicked )
501476 {
502477 Fetch ( ) ;
503478 }
504479
505480 // Pull button
506- var pullButtonText = statusBehind > 0 ? String . Format ( PullButtonCount , statusBehind ) : PullButton ;
481+ var pullButtonText = statusBehind > 0 ? String . Format ( Localization . PullButtonCount , statusBehind ) : Localization . PullButton ;
507482 var pullClicked = GUILayout . Button ( pullButtonText , Styles . HistoryToolbarButtonStyle ) ;
508483
509484 if ( pullClicked &&
510- EditorUtility . DisplayDialog ( PullConfirmTitle ,
511- String . Format ( PullConfirmDescription , currentRemoteName ) ,
512- PullConfirmYes ,
513- PullConfirmCancel )
485+ EditorUtility . DisplayDialog ( Localization . PullConfirmTitle ,
486+ String . Format ( Localization . PullConfirmDescription , currentRemoteName ) ,
487+ Localization . PullConfirmYes ,
488+ Localization . PullConfirmCancel )
514489 )
515490 {
516491 Pull ( ) ;
@@ -521,14 +496,14 @@ private void DoActionbarGUI()
521496 // Push button
522497 EditorGUI . BeginDisabledGroup ( currentRemoteName == null || statusBehind != 0 ) ;
523498 {
524- var pushButtonText = statusAhead > 0 ? String . Format ( PushButtonCount , statusAhead ) : PushButton ;
499+ var pushButtonText = statusAhead > 0 ? String . Format ( Localization . PushButtonCount , statusAhead ) : Localization . PushButton ;
525500 var pushClicked = GUILayout . Button ( pushButtonText , Styles . HistoryToolbarButtonStyle ) ;
526501
527502 if ( pushClicked &&
528- EditorUtility . DisplayDialog ( PushConfirmTitle ,
529- String . Format ( PushConfirmDescription , currentRemoteName ) ,
530- PushConfirmYes ,
531- PushConfirmCancel )
503+ EditorUtility . DisplayDialog ( Localization . PushConfirmTitle ,
504+ String . Format ( Localization . PushConfirmDescription , currentRemoteName ) ,
505+ Localization . PushConfirmYes ,
506+ Localization . PushConfirmCancel )
532507 )
533508 {
534509 Push ( ) ;
@@ -539,7 +514,7 @@ private void DoActionbarGUI()
539514 else
540515 {
541516 // Publishing a repo
542- var publishedClicked = GUILayout . Button ( PublishButton , Styles . HistoryToolbarButtonStyle ) ;
517+ var publishedClicked = GUILayout . Button ( Localization . PublishButton , Styles . HistoryToolbarButtonStyle ) ;
543518 if ( publishedClicked )
544519 {
545520 PopupWindow . OpenWindow ( PopupWindow . PopupViewType . PublishView ) ;
@@ -616,7 +591,7 @@ private void Fetch()
616591 {
617592 TaskManager . Run ( EntryPoint . ApplicationManager . UsageTracker . IncrementHistoryViewToolbarFetch ) ;
618593
619- EditorUtility . DisplayDialog ( FetchActionTitle , FetchFailureDescription ,
594+ EditorUtility . DisplayDialog ( Localization . FetchActionTitle , Localization . FetchFailureDescription ,
620595 Localization . Ok ) ;
621596 }
622597 } )
0 commit comments