Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit f59bfd0

Browse files
authored
Merge pull request #449 from github/fixes/381-localization-pass
Localize strings
2 parents d92ca6f + 81713aa commit f59bfd0

9 files changed

+152
-18
lines changed

src/GitHub.App/Resources.Designer.cs

+63
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GitHub.App/Resources.resx

+21
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,30 @@
177177
<data name="PublishToTitle" xml:space="preserve">
178178
<value>Publish repository to {0}</value>
179179
</data>
180+
<data name="PullRequestCreationTitleValidatorEmpty" xml:space="preserve">
181+
<value>Please enter a title for the Pull Request</value>
182+
</data>
183+
<data name="PullRequestSourceAndTargetBranchTheSame" xml:space="preserve">
184+
<value>Source and target branch cannot be the same</value>
185+
</data>
186+
<data name="PullRequestSourceBranchDoesNotExist" xml:space="preserve">
187+
<value>Source branch doesn't exist remotely, have you pushed it?</value>
188+
</data>
180189
<data name="RepositoryCloneFailedNoSelectedRepo" xml:space="preserve">
181190
<value>No selected repository.</value>
182191
</data>
192+
<data name="RepositoryCreationClonePathEmpty" xml:space="preserve">
193+
<value>Please enter a repository path</value>
194+
</data>
195+
<data name="RepositoryCreationClonePathInvalid" xml:space="preserve">
196+
<value>Please enter a valid path</value>
197+
</data>
198+
<data name="RepositoryCreationClonePathInvalidCharacters" xml:space="preserve">
199+
<value>Path contains invalid characters</value>
200+
</data>
201+
<data name="RepositoryCreationClonePathTooLong" xml:space="preserve">
202+
<value>Path too long</value>
203+
</data>
183204
<data name="RepositoryCreationFailedAlreadyExists" xml:space="preserve">
184205
<value>Repository '{0}/{1}' already exists.</value>
185206
</data>

src/GitHub.App/ViewModels/PullRequestCreationViewModel.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using GitHub.Validation;
1313
using GitHub.Extensions;
1414
using NullGuard;
15+
using GitHub.App;
1516

1617
namespace GitHub.ViewModels
1718
{
@@ -47,15 +48,15 @@ public PullRequestCreationViewModel(IRepositoryHost repositoryHost, ISimpleRepos
4748

4849
var titleObs = this.WhenAny(x => x.PRTitle, x => x.Value);
4950
TitleValidator = ReactivePropertyValidator.ForObservable(titleObs)
50-
.IfNullOrEmpty("Please enter a title for the Pull Request");
51+
.IfNullOrEmpty(Resources.PullRequestCreationTitleValidatorEmpty);
5152

5253
var branchObs = this.WhenAny(
5354
x => x.SourceBranch,
5455
source => source.Value);
5556

5657
BranchValidator = ReactivePropertyValidator.ForObservable(branchObs)
57-
.IfTrue(x => x == null, "Source branch doesn't exist remotely, have you pushed it?")
58-
.IfTrue(x => x.Name == TargetBranch.Name, "Source and target branch cannot be the same");
58+
.IfTrue(x => x == null, Resources.PullRequestSourceBranchDoesNotExist)
59+
.IfTrue(x => x.Name == TargetBranch.Name, Resources.PullRequestSourceAndTargetBranchTheSame);
5960

6061
var whenAnyValidationResultChanges = this.WhenAny(
6162
x => x.TitleValidator.ValidationResult,

src/GitHub.App/ViewModels/RepositoryCloneViewModel.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ public RepositoryCloneViewModel(
9393
(x, y) => x.Value);
9494

9595
BaseRepositoryPathValidator = ReactivePropertyValidator.ForObservable(baseRepositoryPath)
96-
.IfNullOrEmpty("Please enter a repository path")
97-
.IfTrue(x => x.Length > 200, "Path too long")
98-
.IfContainsInvalidPathChars("Path contains invalid characters")
99-
.IfPathNotRooted("Please enter a valid path")
96+
.IfNullOrEmpty(Resources.RepositoryCreationClonePathEmpty)
97+
.IfTrue(x => x.Length > 200, Resources.RepositoryCreationClonePathTooLong)
98+
.IfContainsInvalidPathChars(Resources.RepositoryCreationClonePathInvalidCharacters)
99+
.IfPathNotRooted(Resources.RepositoryCreationClonePathInvalid)
100100
.IfTrue(IsAlreadyRepoAtPath, Resources.RepositoryNameValidatorAlreadyExists);
101101

102102
var canCloneObservable = this.WhenAny(

src/GitHub.App/ViewModels/RepositoryCreationViewModel.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ public RepositoryCreationViewModel(
7676
browseForDirectoryCommand.Subscribe(_ => ShowBrowseForDirectoryDialog());
7777

7878
BaseRepositoryPathValidator = ReactivePropertyValidator.ForObservable(this.WhenAny(x => x.BaseRepositoryPath, x => x.Value))
79-
.IfNullOrEmpty("Please enter a repository path")
80-
.IfTrue(x => x.Length > 200, "Path too long")
81-
.IfContainsInvalidPathChars("Path contains invalid characters")
82-
.IfPathNotRooted("Please enter a valid path");
79+
.IfNullOrEmpty(Resources.RepositoryCreationClonePathEmpty)
80+
.IfTrue(x => x.Length > 200, Resources.RepositoryCreationClonePathTooLong)
81+
.IfContainsInvalidPathChars(Resources.RepositoryCreationClonePathInvalidCharacters)
82+
.IfPathNotRooted(Resources.RepositoryCreationClonePathInvalid);
8383

8484
var nonNullRepositoryName = this.WhenAny(
8585
x => x.RepositoryName,

src/GitHub.VisualStudio.UI/Resources.Designer.cs

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GitHub.VisualStudio.UI/Resources.resx

+15-3
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,6 @@
132132
<data name="browsePathButtonContent" xml:space="preserve">
133133
<value>Browse</value>
134134
</data>
135-
<data name="GetStartedLink" xml:space="preserve">
136-
<value>Get Started</value>
137-
</data>
138135
<data name="couldNotConnectToGitHubText" xml:space="preserve">
139136
<value>Could not connect to github.com</value>
140137
</data>
@@ -330,4 +327,19 @@
330327
<data name="NotAGitRepositoryMessage" xml:space="preserve">
331328
<value>We couldn't find a git repository here. Open a git project or click "File -&gt; Add to Source Control" in a project to get started.</value>
332329
</data>
330+
<data name="CreateAccountLink" xml:space="preserve">
331+
<value>Create an account</value>
332+
</data>
333+
<data name="filterBranchesText" xml:space="preserve">
334+
<value>Filter branches</value>
335+
</data>
336+
<data name="GetStartedLink" xml:space="preserve">
337+
<value>Get Started</value>
338+
</data>
339+
<data name="GetStartedText" xml:space="preserve">
340+
<value>Get Started</value>
341+
</data>
342+
<data name="SignInLink" xml:space="preserve">
343+
<value>Sign In</value>
344+
</data>
333345
</root>

src/GitHub.VisualStudio/UI/Views/LoggedOutView.xaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
xmlns:local="clr-namespace:GitHub.VisualStudio.UI.Views"
77
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
88
xmlns:sampleData="clr-namespace:GitHub.SampleData;assembly=GitHub.App"
9+
xmlns:prop="clr-namespace:GitHub.VisualStudio.UI;assembly=GitHub.VisualStudio.UI"
910
xmlns:ui="clr-namespace:GitHub.UI;assembly=GitHub.UI"
1011
DataContext="{Binding ViewModel}"
1112
d:DesignHeight="300"
@@ -52,13 +53,13 @@
5253
<TextBlock
5354
Margin="10,0"
5455
HorizontalAlignment="Center">
55-
<Hyperlink Command="{Binding SignIn}">Sign in</Hyperlink>
56+
<Hyperlink Command="{Binding SignIn}"><TextBlock Text="{x:Static prop:Resources.SignInLink}"/></Hyperlink>
5657
</TextBlock>
5758

5859
<TextBlock
5960
Margin="10,0"
6061
HorizontalAlignment="Center">
61-
<Hyperlink Command="{Binding Register}">Create an account</Hyperlink>
62+
<Hyperlink Command="{Binding Register}"><TextBlock Text="{x:Static prop:Resources.CreateAccountLink}"/></Hyperlink>
6263
</TextBlock>
6364
</StackPanel>
6465
</StackPanel>

src/GitHub.VisualStudio/UI/Views/NotAGitHubRepositoryView.xaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
<Button HorizontalAlignment="Center"
4242
Margin="0,15"
4343
Style="{DynamicResource GitHubVsPrimaryActionButton}"
44-
Command="{Binding Publish}">
45-
Get Started
44+
Command="{Binding Publish}" >
45+
<TextBlock Text="{x:Static prop:Resources.GetStartedText}" />
4646
</Button>
4747
</StackPanel>
4848
</DockPanel>

0 commit comments

Comments
 (0)