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

Commit 7344458

Browse files
committed
Convert strings to resources
1 parent f1ba0d2 commit 7344458

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

src/GitHub.App/ViewModels/Dialog/Clone/RepositoryCloneViewModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using System;
22
using System.Collections.Generic;
33
using System.ComponentModel.Composition;
4+
using System.Globalization;
45
using System.Linq;
56
using System.Reactive.Linq;
67
using System.Threading.Tasks;
7-
using GitHub.App;
88
using GitHub.Extensions;
99
using GitHub.Logging;
1010
using GitHub.Models;
@@ -253,19 +253,19 @@ string ValidatePathWarning(IRepositoryModel repositoryModel, string path)
253253
{
254254
if (repository == null)
255255
{
256-
return $"Can't find a repository at local path";
256+
return Resources.CantFindARepositoryAtLocalPath;
257257
}
258258

259259
var localUrl = gitService.GetRemoteUri(repository)?.ToRepositoryUrl();
260260
if (localUrl == null)
261261
{
262-
return $"Local repository doesn't have an 'origin' remote";
262+
return Resources.LocalRepositoryDoesntHaveARemoteOrigin;
263263
}
264264

265265
var targetUrl = repositoryModel.CloneUrl?.ToRepositoryUrl();
266266
if (localUrl != targetUrl)
267267
{
268-
return $"Local repository has a remote of {localUrl}";
268+
return string.Format(CultureInfo.CurrentCulture, Resources.LocalRepositoryHasARemoteOf, localUrl);
269269
}
270270
}
271271
}

src/GitHub.Resources/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.Resources/Resources.resx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,4 +824,13 @@ https://git-scm.com/download/win</value>
824824
<data name="NoResolveSameOwnerMessage" xml:space="preserve">
825825
<value>Couldn't find target URL in current repository. Try again after doing a fetch.</value>
826826
</data>
827+
<data name="CantFindARepositoryAtLocalPath" xml:space="preserve">
828+
<value>Can't find a repository at local path.</value>
829+
</data>
830+
<data name="LocalRepositoryDoesntHaveARemoteOrigin" xml:space="preserve">
831+
<value>Local repository doesn't have a remote named "origin".</value>
832+
</data>
833+
<data name="LocalRepositoryHasARemoteOf" xml:space="preserve">
834+
<value>Local repository has a remote of {0}.</value>
835+
</data>
827836
</root>

0 commit comments

Comments
 (0)