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

Commit 81713aa

Browse files
committed
localize pull request creation view messages
1 parent 95256e3 commit 81713aa

File tree

3 files changed

+40
-3
lines changed

3 files changed

+40
-3
lines changed

src/GitHub.App/Resources.Designer.cs

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GitHub.App/Resources.resx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,15 @@
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>

src/GitHub.App/ViewModels/PullRequestCreationViewModel.cs

Lines changed: 4 additions & 3 deletions
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,

0 commit comments

Comments
 (0)