diff --git a/BTCPayServer.Tests/UtilitiesTests.cs b/BTCPayServer.Tests/UtilitiesTests.cs index 54de670aa..2e52de20a 100644 --- a/BTCPayServer.Tests/UtilitiesTests.cs +++ b/BTCPayServer.Tests/UtilitiesTests.cs @@ -360,7 +360,9 @@ retry: { await tester.StartAsync(); var engine = tester.PayTester.GetService(); - foreach (var file in soldir.EnumerateFiles("*.cshtml", SearchOption.AllDirectories)) + var files = soldir.EnumerateFiles("*.cshtml", SearchOption.AllDirectories) + .Union(soldir.EnumerateFiles("*.razor", SearchOption.AllDirectories)); + foreach (var file in files) { var filePath = file.FullName; var txt = File.ReadAllText(file.FullName); diff --git a/BTCPayServer/Blazor/NotificationsDropDown.razor b/BTCPayServer/Blazor/NotificationsDropDown.razor index ecacf317c..e9dd4d2b9 100644 --- a/BTCPayServer/Blazor/NotificationsDropDown.razor +++ b/BTCPayServer/Blazor/NotificationsDropDown.razor @@ -4,10 +4,12 @@ @using BTCPayServer.Services.Notifications; @using Microsoft.AspNetCore.Identity; @using Microsoft.AspNetCore.Routing; +@using Microsoft.Extensions.Localization @implements IDisposable @inject AuthenticationStateProvider _AuthenticationStateProvider @inject NotificationManager _NotificationManager @inject UserManager _UserManager +@inject IStringLocalizer StringLocalizer @inject IJSRuntime _JSRuntime @inject LinkGenerator _LinkGenerator @inject BTCPayServerOptions _BTCPayServerOptions @@ -16,13 +18,13 @@
@if (UnseenCount == "0") { - + } else { - @@ -31,8 +33,8 @@ { } diff --git a/BTCPayServer/Blazor/PosLoginCode.razor b/BTCPayServer/Blazor/PosLoginCode.razor index 42319562b..dc30af3a9 100644 --- a/BTCPayServer/Blazor/PosLoginCode.razor +++ b/BTCPayServer/Blazor/PosLoginCode.razor @@ -1,13 +1,13 @@ @using Microsoft.AspNetCore.Http -@inject IHttpContextAccessor HttpContextAccessor; +@inject IHttpContextAccessor HttpContextAccessor @if (Users?.Any() is true) {
- + -
In order to upload an image, a file storage must be configured.
+
@ViewLocalizer["In order to upload, a {0} must be configured.", Html.ActionLink(StringLocalizer["file storage"], "Files", "UIServer")]
}
@@ -136,7 +136,7 @@
-
Uses the store's default currency (@Model.StoreDefaultCurrency) if empty.
+
@StringLocalizer["Uses the store's default currency ({0}) if empty.", @Model.StoreDefaultCurrency]
@@ -147,7 +147,7 @@ + placeholder="@StringLocalizer["No start date has been set"]" /> @@ -159,7 +159,7 @@ + placeholder="@StringLocalizer["No end date has been set"]" /> @@ -183,7 +183,7 @@
- + + "]" />
@@ -55,8 +55,8 @@ else {
- - + +
}
diff --git a/BTCPayServer/Views/Shared/EmailsTest.cshtml b/BTCPayServer/Views/Shared/EmailsTest.cshtml index 9b8099ce5..038522826 100644 --- a/BTCPayServer/Views/Shared/EmailsTest.cshtml +++ b/BTCPayServer/Views/Shared/EmailsTest.cshtml @@ -5,7 +5,7 @@
- + "]" class="form-control" />
diff --git a/BTCPayServer/Views/Shared/ListRoles.cshtml b/BTCPayServer/Views/Shared/ListRoles.cshtml index 1ef46c211..ead7b90c7 100644 --- a/BTCPayServer/Views/Shared/ListRoles.cshtml +++ b/BTCPayServer/Views/Shared/ListRoles.cshtml @@ -7,9 +7,9 @@ var storeId = Context.GetRouteValue("storeId") as string; var controller = ViewContext.RouteData.Values["controller"].ToString().TrimEnd("Controller", StringComparison.InvariantCultureIgnoreCase); if (string.IsNullOrEmpty(storeId)) - ViewData.SetActivePage(ServerNavPages.Roles); + ViewData.SetActivePage(ServerNavPages.Roles, StringLocalizer["Roles"]); else - ViewData.SetActivePage(StoreNavPages.Roles); + ViewData.SetActivePage(StoreNavPages.Roles, StringLocalizer["Roles"]); var permission = string.IsNullOrEmpty(storeId) ? Policies.CanModifyServerSettings : Policies.CanModifyStoreSettings; var nextRoleSortOrder = (string) ViewData["NextRoleSortOrder"]; var roleSortOrder = nextRoleSortOrder switch @@ -19,8 +19,8 @@ _ => null }; - const string sortByDesc = "Sort by name descending..."; - const string sortByAsc = "Sort by name ascending..."; + var sortByDesc = StringLocalizer["Sort by name descending..."]; + var sortByAsc = StringLocalizer["Sort by name ascending..."]; var showInUseColumn = !Model.Roles.Any(r => r.IsUsed is null); } diff --git a/BTCPayServer/Views/Shared/LocalhostBrowserSupport.cshtml b/BTCPayServer/Views/Shared/LocalhostBrowserSupport.cshtml index 603ad7f9c..49aecdfbb 100644 --- a/BTCPayServer/Views/Shared/LocalhostBrowserSupport.cshtml +++ b/BTCPayServer/Views/Shared/LocalhostBrowserSupport.cshtml @@ -1,5 +1,5 @@