Add more translations (#6302)

* Newlines

* Dashboard

* Add more translations

* Moar

* Remove   from translated texts

* Dictionary controller translations

* Batch 1 of controller updates

* Batch 2 of controller updates

* Component translations

* Batch 3 of controller updates

* Fixes
This commit is contained in:
d11n
2024-10-17 15:51:40 +02:00
committed by GitHub
parent 7e1712c8cd
commit 77fba4aee3
204 changed files with 2639 additions and 1556 deletions

View File

@@ -35,6 +35,7 @@ using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using NBitcoin;
using NBXplorer;
using NBXplorer.DerivationStrategy;
@@ -57,6 +58,7 @@ namespace BTCPayServer.Controllers
private ExplorerClientProvider ExplorerClientProvider { get; }
public IServiceProvider ServiceProvider { get; }
public RateFetcher RateFetcher { get; }
public IStringLocalizer StringLocalizer { get; }
private readonly UserManager<ApplicationUser> _userManager;
private readonly NBXplorerDashboard _dashboard;
@@ -99,6 +101,7 @@ namespace BTCPayServer.Controllers
DefaultRulesCollection defaultRules,
PaymentMethodHandlerDictionary handlers,
Dictionary<PaymentMethodId, ICheckoutModelExtension> paymentModelExtensions,
IStringLocalizer stringLocalizer,
TransactionLinkProviders transactionLinkProviders)
{
_currencyTable = currencyTable;
@@ -124,6 +127,7 @@ namespace BTCPayServer.Controllers
_pullPaymentHostedService = pullPaymentHostedService;
ServiceProvider = serviceProvider;
_walletHistogramService = walletHistogramService;
StringLocalizer = stringLocalizer;
}
[HttpPost]
@@ -908,18 +912,17 @@ namespace BTCPayServer.Controllers
try
{
address = BitcoinAddress.Create(bip21, network.NBitcoinNetwork);
vm.Outputs.Add(new WalletSendModel.TransactionOutput()
vm.Outputs.Add(new WalletSendModel.TransactionOutput
{
DestinationAddress = address.ToString()
}
);
});
}
catch
{
TempData.SetStatusMessageModel(new StatusMessageModel()
TempData.SetStatusMessageModel(new StatusMessageModel
{
Severity = StatusMessageModel.StatusSeverity.Error,
Message = "The provided BIP21 payment URI was malformed"
Message = StringLocalizer["The provided BIP21 payment URI was malformed"].Value
});
}
}
@@ -1256,7 +1259,7 @@ namespace BTCPayServer.Controllers
selectedTransactions ??= Array.Empty<string>();
if (selectedTransactions.Length == 0)
{
TempData[WellKnownTempData.ErrorMessage] = $"No transaction selected";
TempData[WellKnownTempData.ErrorMessage] = StringLocalizer["No transaction selected"].Value;
return RedirectToAction(nameof(WalletTransactions), new { walletId });
}
@@ -1287,12 +1290,12 @@ namespace BTCPayServer.Controllers
.PruneAsync(derivationScheme.AccountDerivation, new PruneRequest(), cancellationToken);
if (result.TotalPruned == 0)
{
TempData[WellKnownTempData.SuccessMessage] = "The wallet is already pruned";
TempData[WellKnownTempData.SuccessMessage] = StringLocalizer["The wallet is already pruned"].Value;
}
else
{
TempData[WellKnownTempData.SuccessMessage] =
$"The wallet has been successfully pruned ({result.TotalPruned} transactions have been removed from the history)";
StringLocalizer["The wallet has been successfully pruned ({0} transactions have been removed from the history)", result.TotalPruned].Value;
}
return RedirectToAction(nameof(WalletTransactions), new { walletId });
@@ -1455,11 +1458,11 @@ namespace BTCPayServer.Controllers
;
if (await WalletRepository.RemoveWalletLabels(walletId, labels))
{
TempData[WellKnownTempData.SuccessMessage] = "The label has been successfully removed.";
TempData[WellKnownTempData.SuccessMessage] = StringLocalizer["The label has been successfully removed."].Value;
}
else
{
TempData[WellKnownTempData.ErrorMessage] = "The label could not be removed.";
TempData[WellKnownTempData.ErrorMessage] = StringLocalizer["The label could not be removed."].Value;
}
return RedirectToAction(nameof(WalletLabels), new { walletId });