@@ -13,31 +13,6 @@ class Window : BaseWindow
13
13
private const string Menu_Window_GitHub = "Window/GitHub" ;
14
14
private const string Menu_Window_GitHub_Command_Line = "Window/GitHub Command Line" ;
15
15
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" ;
41
16
42
17
[ NonSerialized ] private bool currentBranchAndRemoteHasUpdate ;
43
18
[ NonSerialized ] private bool currentTrackingStatusHasUpdate ;
@@ -295,7 +270,7 @@ private void MaybeUpdateData()
295
270
}
296
271
297
272
string updatedRepoRemote = null ;
298
- string updatedRepoUrl = DefaultRepoUrl ;
273
+ string updatedRepoUrl = Localization . DefaultRepoUrl ;
299
274
300
275
var shouldUpdateContentFields = false ;
301
276
@@ -369,24 +344,24 @@ private void MaybeUpdateData()
369
344
shouldUpdateContentFields = true ;
370
345
}
371
346
372
- if ( currentRemoteUrl != DefaultRepoUrl )
347
+ if ( currentRemoteUrl != Localization . DefaultRepoUrl )
373
348
{
374
- currentRemoteUrl = DefaultRepoUrl ;
349
+ currentRemoteUrl = Localization . DefaultRepoUrl ;
375
350
shouldUpdateContentFields = true ;
376
351
}
377
352
}
378
353
379
354
if ( shouldUpdateContentFields || currentBranchContent == null || currentRemoteUrlContent == null )
380
355
{
381
- currentBranchContent = new GUIContent ( currentBranch , Window_RepoBranchTooltip ) ;
356
+ currentBranchContent = new GUIContent ( currentBranch , Localization . Window_RepoBranchTooltip ) ;
382
357
383
358
if ( currentRemoteName != null )
384
359
{
385
- currentRemoteUrlContent = new GUIContent ( currentRemoteUrl , string . Format ( Window_RepoUrlTooltip , currentRemoteName ) ) ;
360
+ currentRemoteUrlContent = new GUIContent ( currentRemoteUrl , string . Format ( Localization . Window_RepoUrlTooltip , currentRemoteName ) ) ;
386
361
}
387
362
else
388
363
{
389
- currentRemoteUrlContent = new GUIContent ( currentRemoteUrl , Window_RepoNoUrlTooltip ) ;
364
+ currentRemoteUrlContent = new GUIContent ( currentRemoteUrl , Localization . Window_RepoNoUrlTooltip ) ;
390
365
}
391
366
}
392
367
}
@@ -466,15 +441,15 @@ private void DoToolbarGUI()
466
441
{
467
442
if ( HasRepository )
468
443
{
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 ) ;
472
447
}
473
448
else if ( ! HasRepository )
474
449
{
475
- changeTab = TabButton ( SubTab . InitProject , InitializeTitle , changeTab ) ;
450
+ changeTab = TabButton ( SubTab . InitProject , Localization . InitializeTitle , changeTab ) ;
476
451
}
477
- changeTab = TabButton ( SubTab . Settings , SettingsTitle , changeTab ) ;
452
+ changeTab = TabButton ( SubTab . Settings , Localization . SettingsTitle , changeTab ) ;
478
453
}
479
454
480
455
if ( EditorGUI . EndChangeCheck ( ) )
@@ -496,21 +471,21 @@ private void DoActionbarGUI()
496
471
EditorGUI . BeginDisabledGroup ( currentRemoteName == null ) ;
497
472
{
498
473
// Fetch button
499
- var fetchClicked = GUILayout . Button ( FetchButtonText , Styles . HistoryToolbarButtonStyle ) ;
474
+ var fetchClicked = GUILayout . Button ( Localization . FetchButtonText , Styles . HistoryToolbarButtonStyle ) ;
500
475
if ( fetchClicked )
501
476
{
502
477
Fetch ( ) ;
503
478
}
504
479
505
480
// Pull button
506
- var pullButtonText = statusBehind > 0 ? String . Format ( PullButtonCount , statusBehind ) : PullButton ;
481
+ var pullButtonText = statusBehind > 0 ? String . Format ( Localization . PullButtonCount , statusBehind ) : Localization . PullButton ;
507
482
var pullClicked = GUILayout . Button ( pullButtonText , Styles . HistoryToolbarButtonStyle ) ;
508
483
509
484
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 )
514
489
)
515
490
{
516
491
Pull ( ) ;
@@ -521,14 +496,14 @@ private void DoActionbarGUI()
521
496
// Push button
522
497
EditorGUI . BeginDisabledGroup ( currentRemoteName == null || statusBehind != 0 ) ;
523
498
{
524
- var pushButtonText = statusAhead > 0 ? String . Format ( PushButtonCount , statusAhead ) : PushButton ;
499
+ var pushButtonText = statusAhead > 0 ? String . Format ( Localization . PushButtonCount , statusAhead ) : Localization . PushButton ;
525
500
var pushClicked = GUILayout . Button ( pushButtonText , Styles . HistoryToolbarButtonStyle ) ;
526
501
527
502
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 )
532
507
)
533
508
{
534
509
Push ( ) ;
@@ -539,7 +514,7 @@ private void DoActionbarGUI()
539
514
else
540
515
{
541
516
// Publishing a repo
542
- var publishedClicked = GUILayout . Button ( PublishButton , Styles . HistoryToolbarButtonStyle ) ;
517
+ var publishedClicked = GUILayout . Button ( Localization . PublishButton , Styles . HistoryToolbarButtonStyle ) ;
543
518
if ( publishedClicked )
544
519
{
545
520
PopupWindow . OpenWindow ( PopupWindow . PopupViewType . PublishView ) ;
@@ -616,7 +591,7 @@ private void Fetch()
616
591
{
617
592
TaskManager . Run ( EntryPoint . ApplicationManager . UsageTracker . IncrementHistoryViewToolbarFetch ) ;
618
593
619
- EditorUtility . DisplayDialog ( FetchActionTitle , FetchFailureDescription ,
594
+ EditorUtility . DisplayDialog ( Localization . FetchActionTitle , Localization . FetchFailureDescription ,
620
595
Localization . Ok ) ;
621
596
}
622
597
} )
0 commit comments