From a962e60de9b0d6b3485ad6eddb04416c1a66bcf9 Mon Sep 17 00:00:00 2001 From: d11n Date: Fri, 25 Oct 2024 15:48:53 +0200 Subject: [PATCH] More Translations (#6318) * Store selector * Footer * Notifications * Checkout Appearance * Users list * Forms * Emails * Pay Button * Edit Dictionary * Remove newlines, fix typos * Forms * Pull payments and payouts * Various pages * Use local docs link * Fix * Even more translations * Fixes #6325 * Account pages * Notifications * Placeholders * Various pages and components * Add more --- BTCPayServer.Tests/UtilitiesTests.cs | 4 +- .../Blazor/NotificationsDropDown.razor | 12 +- BTCPayServer/Blazor/PosLoginCode.razor | 6 +- BTCPayServer/Blazor/UserLoginCode.razor | 12 +- .../Components/StoreSelector/Default.cshtml | 12 +- .../Components/ThemeSwitch/Default.cshtml | 6 +- .../Components/WalletNav/WalletNav.cs | 19 +- .../UIPullPaymentController.Boltcard.cs | 3 +- .../UIServerController.Translations.cs | 3 + .../Controllers/UIServerController.Users.cs | 4 +- BTCPayServer/Forms/ModifyForm.cs | 1 + BTCPayServer/Forms/UIFormsController.cs | 24 +- .../HostedServices/PluginUpdateFetcher.cs | 9 +- .../EditDictionaryViewModel.cs | 2 + .../CheckoutAppearanceViewModel.cs | 13 - .../StoreViewModels/CreateStoreViewModel.cs | 1 + .../StoreViewModels/LightningNodeViewModel.cs | 2 + .../WalletSettingsViewModel.cs | 3 + .../WalletViewModels/PullPaymentsModel.cs | 17 +- .../LightningAutomatedPayoutSenderFactory.cs | 6 +- .../OnChainAutomatedPayoutSenderFactory.cs | 6 +- .../Models/UpdatePointOfSaleViewModel.cs | 22 +- .../ExternalPayoutTransactionNotification.cs | 9 +- .../Blobs/InviteAcceptedNotification.cs | 8 +- .../Blobs/InvoiceEventNotification.cs | 32 +- .../NewUserRequiresApprovalNotification.cs | 9 +- .../Blobs/NewVersionNotification.cs | 9 +- .../Notifications/Blobs/PayoutNotification.cs | 11 +- BTCPayServer/Services/Translations.Default.cs | 436 ++++++++++++++++-- .../Bitcoin/ViewBitcoinLikePaymentData.cshtml | 2 +- .../Views/Shared/CameraScanner.cshtml | 12 +- BTCPayServer/Views/Shared/ConfirmModal.cshtml | 6 +- .../Crowdfund/Public/ViewCrowdfund.cshtml | 4 +- .../Shared/Crowdfund/UpdateCrowdfund.cshtml | 18 +- BTCPayServer/Views/Shared/EmailsBody.cshtml | 6 +- BTCPayServer/Views/Shared/EmailsTest.cshtml | 2 +- BTCPayServer/Views/Shared/ListRoles.cshtml | 8 +- .../Shared/LocalhostBrowserSupport.cshtml | 2 +- .../Shared/NotificationEmailWarning.cshtml | 5 +- .../Views/Shared/PayButton/Enable.cshtml | 22 +- .../Views/Shared/PayButton/PayButton.cshtml | 142 +++--- .../Shared/PointOfSale/Public/Cart.cshtml | 37 +- .../PointOfSale/Public/MinimalLight.cshtml | 2 +- .../Shared/PointOfSale/Public/Print.cshtml | 9 +- .../Public/RecentTransactions.cshtml | 2 +- .../Shared/PointOfSale/Public/Static.cshtml | 6 +- .../Shared/PointOfSale/Public/VueLight.cshtml | 11 +- .../PointOfSale/UpdatePointOfSale.cshtml | 62 +-- BTCPayServer/Views/Shared/ShowQR.cshtml | 2 +- .../Views/Shared/TemplateEditor.cshtml | 30 +- .../Views/Shared/VaultElements.cshtml | 8 +- .../Views/Shared/_BTCPaySupporters.cshtml | 7 +- BTCPayServer/Views/Shared/_Footer.cshtml | 10 +- BTCPayServer/Views/Shared/_Layout.cshtml | 16 +- .../Views/Shared/_StatusMessage.cshtml | 2 +- .../Views/UIAccount/ForgotPassword.cshtml | 5 +- BTCPayServer/Views/UIAccount/Login.cshtml | 2 +- .../UIAccount/LoginWithRecoveryCode.cshtml | 5 +- BTCPayServer/Views/UIApps/ListApps.cshtml | 2 +- BTCPayServer/Views/UIFido2/Create.cshtml | 2 +- BTCPayServer/Views/UIForms/FormsList.cshtml | 6 +- BTCPayServer/Views/UIForms/Modify.cshtml | 31 +- .../Views/UIHome/RecoverySeedBackup.cshtml | 6 +- .../Views/UIInvoice/Checkout-Cheating.cshtml | 2 +- .../Views/UIInvoice/Checkout-Testing.cshtml | 2 +- .../Views/UIInvoice/CreateInvoice.cshtml | 2 +- BTCPayServer/Views/UIInvoice/Invoice.cshtml | 8 +- .../InvoiceStatusChangePartial.cshtml | 47 -- .../Views/UIInvoice/ListInvoices.cshtml | 30 +- .../Views/UILNURL/EditLightningAddress.cshtml | 10 +- BTCPayServer/Views/UILNURLAuth/Create.cshtml | 2 +- BTCPayServer/Views/UIManage/APIKeys.cshtml | 15 +- BTCPayServer/Views/UIManage/AddApiKey.cshtml | 2 +- .../Views/UIManage/AuthorizeAPIKey.cshtml | 5 +- .../Views/UIManage/ChangePassword.cshtml | 2 +- .../Views/UIManage/EnableAuthenticator.cshtml | 26 +- .../UIManage/GenerateRecoveryCodes.cshtml | 2 +- BTCPayServer/Views/UIManage/Index.cshtml | 8 +- BTCPayServer/Views/UIManage/LoginCodes.cshtml | 2 +- .../UIManage/NotificationSettings.cshtml | 8 +- .../Views/UIManage/SetPassword.cshtml | 7 +- .../UIManage/TwoFactorAuthentication.cshtml | 23 +- .../GetStoreMoneroLikePaymentMethod.cshtml | 6 +- .../GetStoreMoneroLikePaymentMethods.cshtml | 2 +- .../Views/UINotifications/Index.cshtml | 27 +- .../EditPaymentRequest.cshtml | 15 +- .../GetPaymentRequests.cshtml | 8 +- .../ViewPaymentRequest.cshtml | 4 +- .../ConfigureStorePayoutProcessors.cshtml | 4 +- .../ShowLightningNodeInfo.cshtml | 7 +- .../UIPullPayment/EditPullPayment.cshtml | 2 +- .../UIPullPayment/ViewPullPayment.cshtml | 8 +- .../Views/UIReports/StoreReports.cshtml | 8 +- BTCPayServer/Views/UIServer/Branding.cshtml | 11 +- .../UIServer/CLightningRestServices.cshtml | 2 +- .../Views/UIServer/ConfiguratorService.cshtml | 2 +- .../UIServer/CreateTemporaryFileUrl.cshtml | 2 +- BTCPayServer/Views/UIServer/CreateUser.cshtml | 2 +- .../Views/UIServer/DynamicDnsService.cshtml | 14 +- .../Views/UIServer/DynamicDnsServices.cshtml | 9 +- .../EditAmazonS3StorageProvider.cshtml | 2 +- ...EditAzureBlobStorageStorageProvider.cshtml | 2 +- .../Views/UIServer/EditDictionary.cshtml | 4 +- .../EditFileSystemStorageProvider.cshtml | 2 +- ...itGoogleCloudStorageStorageProvider.cshtml | 2 +- BTCPayServer/Views/UIServer/Emails.cshtml | 2 +- BTCPayServer/Views/UIServer/Files.cshtml | 11 +- .../UIServer/LightningChargeServices.cshtml | 2 +- .../UIServer/LightningWalletServices.cshtml | 12 +- .../Views/UIServer/ListPlugins.cshtml | 4 +- BTCPayServer/Views/UIServer/ListStores.cshtml | 2 +- BTCPayServer/Views/UIServer/ListUsers.cshtml | 9 +- .../Views/UIServer/LndSeedBackup.cshtml | 10 +- .../Views/UIServer/LndServices.cshtml | 2 +- BTCPayServer/Views/UIServer/Logs.cshtml | 6 +- .../Views/UIServer/Maintenance.cshtml | 9 +- BTCPayServer/Views/UIServer/P2PService.cshtml | 10 +- BTCPayServer/Views/UIServer/Policies.cshtml | 5 +- BTCPayServer/Views/UIServer/RPCService.cshtml | 10 +- BTCPayServer/Views/UIServer/SSHService.cshtml | 2 +- BTCPayServer/Views/UIServer/Services.cshtml | 2 +- BTCPayServer/Views/UIServer/Storage.cshtml | 2 +- BTCPayServer/Views/UIServer/User.cshtml | 2 +- .../Views/UIShopify/EditShopify.cshtml | 4 +- .../UIStorePullPayments/NewPullPayment.cshtml | 2 +- .../Views/UIStorePullPayments/Payouts.cshtml | 28 +- .../UIStorePullPayments/PullPayments.cshtml | 27 +- .../Views/UIStores/CheckoutAppearance.cshtml | 23 +- .../Views/UIStores/CreateToken.cshtml | 2 +- BTCPayServer/Views/UIStores/Dashboard.cshtml | 2 +- .../Views/UIStores/GeneralSettings.cshtml | 31 +- .../Views/UIStores/GenerateWallet.cshtml | 4 +- .../UIStores/GenerateWalletOptions.cshtml | 4 +- .../ImportWallet/ConfirmAddresses.cshtml | 20 +- .../Views/UIStores/ImportWallet/File.cshtml | 10 +- .../UIStores/ImportWallet/Hardware.cshtml | 22 +- .../Views/UIStores/ImportWallet/Scan.cshtml | 10 +- .../Views/UIStores/ImportWallet/Seed.cshtml | 6 +- .../Views/UIStores/ImportWallet/Xpub.cshtml | 16 +- BTCPayServer/Views/UIStores/Lightning.cshtml | 2 +- .../Views/UIStores/LightningSettings.cshtml | 11 +- BTCPayServer/Views/UIStores/ListTokens.cshtml | 8 +- .../Views/UIStores/ModifyWebhook.cshtml | 4 +- BTCPayServer/Views/UIStores/Rates.cshtml | 30 +- .../Views/UIStores/RequestPairing.cshtml | 4 +- .../Views/UIStores/SetupLightningNode.cshtml | 35 +- .../Views/UIStores/SetupWallet.cshtml | 2 +- BTCPayServer/Views/UIStores/ShowToken.cshtml | 2 +- .../Views/UIStores/StoreEmailSettings.cshtml | 2 +- .../Views/UIStores/StoreEmails.cshtml | 2 +- BTCPayServer/Views/UIStores/StoreUsers.cshtml | 16 +- .../Views/UIStores/WalletSettings.cshtml | 32 +- BTCPayServer/Views/UIStores/Webhooks.cshtml | 6 +- .../Views/UIStores/_GenerateWalletForm.cshtml | 16 +- .../Views/UIStores/_LayoutWalletSetup.cshtml | 2 +- .../Views/UIUserStores/CreateStore.cshtml | 3 +- .../Views/UIUserStores/ListStores.cshtml | 2 +- .../Views/UIWallets/CoinSelection.cshtml | 14 +- .../Views/UIWallets/ListWallets.cshtml | 4 +- .../Views/UIWallets/SignWithSeed.cshtml | 14 +- .../Views/UIWallets/WalletLabels.cshtml | 9 +- .../Views/UIWallets/WalletPSBT.cshtml | 4 +- .../Views/UIWallets/WalletPSBTCombine.cshtml | 2 +- .../Views/UIWallets/WalletPSBTDecoded.cshtml | 7 +- .../Views/UIWallets/WalletReceive.cshtml | 2 +- .../Views/UIWallets/WalletRescan.cshtml | 15 +- .../Views/UIWallets/WalletSend.cshtml | 10 +- .../Views/UIWallets/WalletSendVault.cshtml | 2 +- .../UIWallets/WalletSigningOptions.cshtml | 6 +- .../Views/UIWallets/WalletTransactions.cshtml | 15 +- .../GetStoreZcashLikePaymentMethod.cshtml | 4 +- .../GetStoreZcashLikePaymentMethods.cshtml | 2 +- BTCPayServer/wwwroot/main/wizard.css | 3 +- 173 files changed, 1227 insertions(+), 919 deletions(-) delete mode 100644 BTCPayServer/Views/UIInvoice/InvoiceStatusChangePartial.cshtml 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 @@