diff --git a/BTCPayServer.Tests/TestData/Langs/Cypherpunk b/BTCPayServer.Tests/TestData/Langs/Cypherpunk index 9e512111f..b752cb21d 100644 --- a/BTCPayServer.Tests/TestData/Langs/Cypherpunk +++ b/BTCPayServer.Tests/TestData/Langs/Cypherpunk @@ -1,3 +1,5 @@ -Password => Cyphercode -Email address => Cypher ID -Welcome to {0} => Yo at {0} +{ + "Password" : "Cyphercode", + "Email address" : "Cypher ID", + "Welcome to {0}" : "Yo at {0}" +} diff --git a/BTCPayServer.Tests/UtilitiesTests.cs b/BTCPayServer.Tests/UtilitiesTests.cs index 082de12fe..e98619a3f 100644 --- a/BTCPayServer.Tests/UtilitiesTests.cs +++ b/BTCPayServer.Tests/UtilitiesTests.cs @@ -352,7 +352,7 @@ retry: } // Go through all cshtml file, search for text-translate or ViewLocalizer usage - using (var tester = CreateServerTester()) + using (var tester = CreateServerTester(newDb: true)) { await tester.StartAsync(); var engine = tester.PayTester.GetService(); @@ -360,12 +360,15 @@ retry: { var filePath = file.FullName; var txt = File.ReadAllText(file.FullName); - if (txt.Contains("ViewLocalizer")) + foreach (string localizer in new[] { "ViewLocalizer", "StringLocalizer" }) { - var matches = Regex.Matches(txt, "ViewLocalizer\\[\"(.*?)\"[\\],]"); - foreach (Match match in matches) + if (txt.Contains(localizer)) { - defaultTranslatedKeys.Add(match.Groups[1].Value); + var matches = Regex.Matches(txt, localizer + "\\[\"(.*?)\"[\\],]"); + foreach (Match match in matches) + { + defaultTranslatedKeys.Add(match.Groups[1].Value); + } } } @@ -379,12 +382,18 @@ retry: } defaultTranslatedKeys = defaultTranslatedKeys.Select(d => d.Trim()).Distinct().OrderBy(o => o).ToList(); + JObject obj = new JObject(); + foreach (var v in defaultTranslatedKeys) + { + obj.Add(v, ""); + } + var path = Path.Combine(soldir.FullName, "BTCPayServer/Services/Translations.Default.cs"); var defaultTranslation = File.ReadAllText(path); var startIdx = defaultTranslation.IndexOf("\"\"\""); var endIdx = defaultTranslation.LastIndexOf("\"\"\""); var content = defaultTranslation.Substring(0, startIdx + 3); - content += "\n" + String.Join('\n', defaultTranslatedKeys) + "\n"; + content += "\n" + obj.ToString(Formatting.Indented) + "\n"; content += defaultTranslation.Substring(endIdx); File.WriteAllText(path, content); } diff --git a/BTCPayServer/Hosting/BTCPayServerServices.cs b/BTCPayServer/Hosting/BTCPayServerServices.cs index 84b62bdbd..797df5a62 100644 --- a/BTCPayServer/Hosting/BTCPayServerServices.cs +++ b/BTCPayServer/Hosting/BTCPayServerServices.cs @@ -89,6 +89,7 @@ namespace BTCPayServer.Hosting services.TryAddSingleton(); services.TryAddSingleton(); services.TryAddSingleton(); + services.TryAddSingleton(o => o.GetRequiredService().Create("","")); services.AddSingleton(o => o.GetRequiredService>().Value); services.AddSingleton(o => o.GetRequiredService>().Value.SerializerSettings); diff --git a/BTCPayServer/Hosting/LoadTranslationsStartupTask.cs b/BTCPayServer/Hosting/LoadTranslationsStartupTask.cs index 25b8ca150..af660ef0f 100644 --- a/BTCPayServer/Hosting/LoadTranslationsStartupTask.cs +++ b/BTCPayServer/Hosting/LoadTranslationsStartupTask.cs @@ -64,7 +64,7 @@ namespace BTCPayServer.Hosting continue; } var savedHash = dictionary.Metadata.ToObject().Hash; - var translations = Translations.CreateFromText(File.ReadAllText(file)); + var translations = Translations.CreateFromJson(File.ReadAllText(file)); var currentHash = new uint256(SHA256.HashData(Encoding.UTF8.GetBytes(translations.ToJsonFormat()))); if (savedHash != currentHash) diff --git a/BTCPayServer/Services/Translations.Default.cs b/BTCPayServer/Services/Translations.Default.cs index fcf6b6803..d0ad63f6a 100644 --- a/BTCPayServer/Services/Translations.Default.cs +++ b/BTCPayServer/Services/Translations.Default.cs @@ -11,307 +11,377 @@ namespace BTCPayServer.Services // Please run it before release. var knownTranslations = """ -Access Tokens -Account -Account key -Account key path -Add additional fee (network fee) to invoice … -Add Address -Add Exchange Rate Spread -Add hop hints for private channels to the Lightning invoice -Add Role -Add Service -Add User -Add Webhook -Additional Actions -Admin API access token -Admin must approve new users -Administrator -Allow anyone to create invoice -Allow form for public use -Allow payee to create invoices with custom amounts -Allow payee to pass a comment -Allow Stores use the Server's SMTP email settings as their default -Always include non-witness UTXO if available -Amazon S3 -Amount -API Key -API Keys -App -App Name -App Type -Application -Approve -Archive this store -Authenticator code -Auto-detect language on checkout -Automatically approve claims -Available Payment Methods -Azure Blob Storage -Backend's language -Batch size -BIP39 Seed (12/24 word mnemonic phrase) or HD private key (xprv...) -Brand Color -Branding -Buyer Email -Callback Notification URL -Can use hot wallet -Can use RPC import -Celebrate payment with confetti -Check releases on GitHub and notify when new BTCPay Server version is available -Checkout Appearance -Clone -Colors to rotate between with animation when a payment is made. One color per line. -Confirm new password -Confirm password -Connection string -Consider the invoice paid even if the paid amount is … % less than expected -Consider the invoice settled when the payment transaction … -Contact URL -Contact Us -Contribution Perks Template -Count all invoices created on the store as part of the goal -Create -Create a new app -Create a new dictionary -Create Account -Create Form -Create Invoice -Create Pull Payment -Create Request -Create Store -Create Webhook -Create your account -Crowdfund -Currency -Current password -Custom CSS -Custom HTML title to display on Checkout page -Custom sound file for successful payment -Custom Theme Extension Type -Custom Theme File -Dashboard -Default currency -Default language on checkout -Default payment method on checkout -Default role for users on a new store -Delete this store -Derivation scheme -Derivation scheme format -Description -Description template of the lightning invoice -Destination Address -Dictionaries -Dictionaries enable you to translate the BTCPay Server backend into different languages. -Dictionary -Disable public user registration -Disable stores from using the server's email settings as backup -Discourage search engines from indexing this site -Display app on website root -Display contribution ranking -Display contribution value -Display item selection for keypad -Display Lightning payment amounts in Satoshis -Display the category list -Display the search bar -Display Title -Disqus Shortname -Do not allow additional contributions after target has been reached -Does not extend a BTCPay Server theme, fully custom -Domain -Domain name -Don't create UTXO change -Email -Email address -Email confirmation required -Email confirmed? -Emails -Enable background animations on new payments -Enable Disqus Comments -Enable experimental features -Enable LNURL -Enable Payjoin/P2EP -Enable public receipt page for settled invoices -Enable public user registration -Enable sounds on checkout page -Enable sounds on new payments -Enable tips -End date -Error -Expiration Date -Export -Extends the BTCPay Server Dark theme -Extends the BTCPay Server Light theme -Fallback -Featured Image URL -Fee rate (sat/vB) -Files -Forgot password? -Form configuration (JSON) -Forms -Gap limit -Generate -Generate API Key -Generate Key -Google Cloud Storage -GRPC SSL Cipher suite (GRPC_SSL_CIPHER_SUITES) -Hide Sensitive Info -If a translation isn’t available in the new dictionary, it will be searched in the fallback. -Image -Invoice currency -Invoice expires if the full amount has not been paid after … -Invoice metadata -Invoices -Is administrator? -Is signing key -Item Description -Keypad -Lightning node (LNURL Auth) -LNURL Classic Mode -Local File System -Log in -Login Codes -Logo -Logout -Logs -Maintenance -Make Crowdfund Public -Manage Account -Manage Plugins -Master fingerprint -Max sats -Memo -Metadata -Min sats -Minimum acceptable expiration time for BOLT11 for refunds -Name -New password -Next -Non-admins can access the User Creation API Endpoint -Non-admins can create Hot Wallets for their Store -Non-admins can import Hot Wallets for their Store -Non-admins can use the Internal Lightning Node for their Store -Non-admins cannot access the User Creation API Endpoint -Notification Email -Notification URL -Notifications -Only enable the payment method after user explicitly chooses it -Optional seed passphrase -Order Id -Override the block explorers used -Pair to -Password -Password (leave blank to generate invite-link) -Pay Button -PayJoin BIP21 -Payment -Payment invalid if transactions fails to confirm … after invoice expiration -Payments -Payout Methods -Payout Processors -Payouts -Plugin server -Plugins -Point of Sale -Point of Sale Style -Policies -Preferred Price Source -Print display -Product list -Product list with cart -Profile Picture -PSBT content -PSBT to combine with… -Public Key -Pull Payments -Rate Rules -Rates -Recommended fee confirmation target blocks -Recovery Code -Redirect invoice to redirect url automatically after paid -Redirect URL -Regenerate code -Register -Remember me -Remember this machine -Remove -Reporting -Request contributor data on checkout -Request customer data on checkout -Request Pairing -Requests -Reset goal every -REST Uri -Role -Roles -Root fingerprint -Save -Scope -Search engines can index this site -Security device (FIDO2) -Select -Select the Default Currency during Store Creation -Select the payout method used for refund -Send test webhook -Server Name -Server Settings -Services -Set Password -Settings -Shop Name -Shopify -Show "Pay in wallet" button -Show a timer … minutes before invoice expiration -Show plugins in pre-release -Show recommended fee -Show the payment list in the public receipt page -Show the QR code of the receipt in the public receipt page -Show the store header -Sign in -Sort contribution perks by popularity -Sounds to play when a payment is made. One sound per line -Specify the amount and currency for the refund -Start date -Starting index -Store -Store Id -Store Name -Store Settings -Store Website -Submit -Subtract fees from amount -Support URL -Supported Transaction Currencies -Target Amount -Test Email -Text to display in the tip input -Text to display on buttons allowing the user to enter a custom amount -Text to display on each button for items with a specific price -Theme -Tip percentage amounts (comma separated) -Translations -Two-Factor Authentication -Unarchive this store -Unify on-chain and lightning payment URL/QR code -Update Password -Update Webhook -Upload PSBT from file… -Url of the Dynamic DNS service you are using -Use custom theme -Use SSL -User can input custom amount -User can input discount in % -Users -UTXOs to spend from -Verification Code -Wallet file -Wallet file content -Wallets -Webhooks -Welcome to {0} -Your dynamic DNS hostname +{ + "... on every payment": "", + "... only if the customer makes more than one payment for the invoice": "", + "A given currency pair match the most specific rule. If two rules are matching and are as specific, the first rule will be chosen.": "", + "Access Tokens": "", + "Account": "", + "Account key": "", + "Account key path": "", + "Add additional fee (network fee) to invoice …": "", + "Add Address": "", + "Add Exchange Rate Spread": "", + "Add hop hints for private channels to the Lightning invoice": "", + "Add Role": "", + "Add Service": "", + "Add User": "", + "Add Webhook": "", + "Additional Actions": "", + "Admin API access token": "", + "Admin must approve new users": "", + "Administrator": "", + "Advanced rate rule scripting": "", + "Allow anyone to create invoice": "", + "Allow form for public use": "", + "Allow payee to create invoices with custom amounts": "", + "Allow payee to pass a comment": "", + "Allow Stores use the Server's SMTP email settings as their default": "", + "Always include non-witness UTXO if available": "", + "Amazon S3": "", + "Amount": "", + "API Key": "", + "API Keys": "", + "App": "", + "App Name": "", + "App Type": "", + "Application": "", + "Apply the brand color to the store's backend as well": "", + "Approve": "", + "Archive this store": "", + "At Least One": "", + "At Least Ten": "", + "Authenticator code": "", + "Auto-detect language on checkout": "", + "Automatically approve claims": "", + "Available Payment Methods": "", + "Azure Blob Storage": "", + "Backend's language": "", + "Batch size": "", + "BIP39 Seed (12/24 word mnemonic phrase) or HD private key (xprv...)": "", + "blocks": "", + "Brand Color": "", + "Branding": "", + "But now, what if you want to support DOGE? The problem with DOGE is that most exchange do not have any pair for it. But bitpay has a DOGE_BTC pair.
\r\n Luckily, the rule engine allow you to reference rules:": "", + "Buyer Email": "", + "Callback Notification URL": "", + "Can use hot wallet": "", + "Can use RPC import": "", + "Celebrate payment with confetti": "", + "Check releases on GitHub and notify when new BTCPay Server version is available": "", + "Checkout Appearance": "", + "Choose your import method": "", + "Choose your wallet option": "", + "Clone": "", + "Coingecko integration": "", + "Colors to rotate between with animation when a payment is made. One color per line.": "", + "Confirm new password": "", + "Confirm password": "", + "Connect an existing wallet": "", + "Connect hardware wallet": "", + "Connection string": "", + "Consider the invoice paid even if the paid amount is … % less than expected": "", + "Consider the invoice settled when the payment transaction …": "", + "Contact URL": "", + "Contact Us": "", + "Contribution Perks Template": "", + "Count all invoices created on the store as part of the goal": "", + "Create": "", + "Create a new app": "", + "Create a new wallet": "", + "Create Account": "", + "Create Form": "", + "Create Invoice": "", + "Create Pull Payment": "", + "Create Request": "", + "Create Store": "", + "Create Webhook": "", + "Create your account": "", + "Crowdfund": "", + "Currency": "", + "Current password": "", + "Custom": "", + "Custom CSS": "", + "Custom HTML title to display on Checkout page": "", + "Custom sound file for successful payment": "", + "Custom Theme Extension Type": "", + "Custom Theme File": "", + "Dashboard": "", + "days": "", + "Default currency": "", + "Default Currency Pairs": "", + "Default language on checkout": "", + "Default payment method on checkout": "", + "Default role for users on a new store": "", + "Delete this store": "", + "Derivation scheme": "", + "Derivation scheme format": "", + "Description": "", + "Description template of the lightning invoice": "", + "Destination Address": "", + "Dictionaries": "", + "Dictionaries enable you to translate the BTCPay Server backend into different languages.": "", + "Dictionary": "", + "Direct integration": "", + "Disable public user registration": "", + "Disable stores from using the server's email settings as backup": "", + "Discourage search engines from indexing this site": "", + "Display app on website root": "", + "Display contribution ranking": "", + "Display contribution value": "", + "Display item selection for keypad": "", + "Display Lightning payment amounts in Satoshis": "", + "Display the category list": "", + "Display the search bar": "", + "Display Title": "", + "Disqus Shortname": "", + "Do not allow additional contributions after target has been reached": "", + "Does not extend a BTCPay Server theme, fully custom": "", + "Domain": "", + "Domain name": "", + "Don't create UTXO change": "", + "Email": "", + "Email address": "", + "Email confirmation required": "", + "Email confirmed?": "", + "Emails": "", + "Enable background animations on new payments": "", + "Enable Disqus Comments": "", + "Enable experimental features": "", + "Enable LNURL": "", + "Enable Payjoin/P2EP": "", + "Enable public receipt page for settled invoices": "", + "Enable public user registration": "", + "Enable sounds on checkout page": "", + "Enable sounds on new payments": "", + "Enable tips": "", + "End date": "", + "Enter extended public key": "", + "Enter wallet seed": "", + "Error": "", + "Expiration Date": "", + "Export": "", + "Extends the BTCPay Server Dark theme": "", + "Extends the BTCPay Server Light theme": "", + "Fallback": "", + "Featured Image URL": "", + "Fee rate (sat/vB)": "", + "Fee will be shown for BTC and LTC onchain payments only.": "", + "Files": "", + "Forgot password?": "", + "Form configuration (JSON)": "", + "Forms": "", + "Gap limit": "", + "Generate": "", + "Generate {0} Wallet": "", + "Generate a brand-new wallet to use": "", + "Generate API Key": "", + "Generate Key": "", + "Google Cloud Storage": "", + "GRPC SSL Cipher suite (GRPC_SSL_CIPHER_SUITES)": "", + "Has at least 1 confirmation": "", + "Has at least 2 confirmations": "", + "Has at least 6 confirmations": "", + "Hide Sensitive Info": "", + "Hot wallet": "", + "However, kraken does not support the BTC_CAD pair. For this reason you can add a rule mapping all X_CAD to ndax, a Canadian exchange.": "", + "However, explicitely setting specific pairs like this can be a bit difficult. Instead, you can define a rule X_X which will match any currency pair. The following example will use kraken for getting the rate of any currency pair.": "", + "I don't have a wallet": "", + "I have a wallet": "", + "If a translation isn’t available in the new dictionary, it will be searched in the fallback.": "", + "Image": "", + "Import {0} Wallet": "", + "Import an existing hardware or software wallet": "", + "Import wallet file": "", + "Import your public keys using our Vault application": "", + "Input the key string manually": "", + "Invitation URL": "", + "Invoice currency": "", + "Invoice expires if the full amount has not been paid after …": "", + "Invoice metadata": "", + "Invoices": "", + "Is administrator?": "", + "Is signing key": "", + "Is unconfirmed": "", + "It is worth noting that the inverses of those pairs are automatically supported as well.
\r\n It means that the rule USD_DOGE = 1 / DOGE_USD implicitely exists.": "", + "Item Description": "", + "Keypad": "", + "Let's get started": "", + "Lightning node (LNURL Auth)": "", + "LNURL Classic Mode": "", + "Local File System": "", + "Log in": "", + "Login Codes": "", + "Logo": "", + "Logout": "", + "Logs": "", + "Maintenance": "", + "Make Crowdfund Public": "", + "Manage Account": "", + "Manage Plugins": "", + "Master fingerprint": "", + "Max sats": "", + "Memo": "", + "Metadata": "", + "Min sats": "", + "Minimum acceptable expiration time for BOLT11 for refunds": "", + "Never add network fee": "", + "New password": "", + "Next": "", + "Non-admins can access the User Creation API Endpoint": "", + "Non-admins can create Hot Wallets for their Store": "", + "Non-admins can import Hot Wallets for their Store": "", + "Non-admins can use the Internal Lightning Node for their Store": "", + "Non-admins cannot access the User Creation API Endpoint": "", + "Not recommended": "", + "Notification Email": "", + "Notification URL": "", + "Notifications": "", + "Only enable the payment method after user explicitly chooses it": "", + "Optional seed passphrase": "", + "Order Id": "", + "Override the block explorers used": "", + "Pair to": "", + "Password": "", + "Password (leave blank to generate invite-link)": "", + "Pay Button": "", + "PayJoin BIP21": "", + "Payment": "", + "Payment invalid if transactions fails to confirm … after invoice expiration": "", + "Payments": "", + "Payout Methods": "", + "Payout Processors": "", + "Payouts": "", + "Please enable JavaScript for this option to be available": "", + "Please note that creating a hot wallet is not supported by this instance for non administrators.": "", + "Plugin server": "", + "Plugins": "", + "Point of Sale": "", + "Point of Sale Style": "", + "Policies": "", + "Preferred Price Source": "", + "Print display": "", + "Product list": "", + "Product list with cart": "", + "Profile Picture": "", + "Provide the 12 or 24 word recovery seed": "", + "PSBT content": "", + "PSBT to combine with…": "", + "Public Key": "", + "Pull Payments": "", + "Rate Rules": "", + "Rate script allows you to express precisely how you want to calculate rates for currency pairs.": "", + "Rates": "", + "Recommended": "", + "Recommended fee confirmation target blocks": "", + "Recovery Code": "", + "Redirect invoice to redirect url automatically after paid": "", + "Redirect URL": "", + "Register": "", + "Remember me": "", + "Remember this machine": "", + "Remove": "", + "Reporting": "", + "Request contributor data on checkout": "", + "Request customer data on checkout": "", + "Request Pairing": "", + "Requests": "", + "Required Confirmations": "", + "Reset goal every": "", + "Reset Password": "", + "REST Uri": "", + "Role": "", + "Roles": "", + "Root fingerprint": "", + "Save": "", + "Scan wallet QR code": "", + "Scope": "", + "Scripting": "", + "Search engines can index this site": "", + "Security device (FIDO2)": "", + "Select": "", + "Select the Default Currency during Store Creation": "", + "Select the payout method used for refund": "", + "Send invitation email": "", + "Send test webhook": "", + "Server Name": "", + "Server Settings": "", + "Services": "", + "Set Password": "", + "Set to default settings": "", + "Settings": "", + "Setup {0} Wallet": "", + "Shop Name": "", + "Shopify": "", + "Show \"Pay in wallet\" button": "", + "Show a timer … minutes before invoice expiration": "", + "Show plugins in pre-release": "", + "Show recommended fee": "", + "Show the payment list in the public receipt page": "", + "Show the QR code of the receipt in the public receipt page": "", + "Show the store header": "", + "Sign in": "", + "Sort contribution perks by popularity": "", + "Sounds to play when a payment is made. One sound per line": "", + "Specify the amount and currency for the refund": "", + "Start date": "", + "Starting index": "", + "Store": "", + "Store Id": "", + "Store Name": "", + "Store Settings": "", + "Store Speed Policy": "", + "Store Website": "", + "Submit": "", + "Subtract fees from amount": "", + "Support URL": "", + "Supported by BlueWallet, Cobo Vault, Passport and Specter DIY": "", + "Supported Transaction Currencies": "", + "Target Amount": "", + "Test Email": "", + "Test Results:": "", + "Testing": "", + "Text to display in the tip input": "", + "Text to display on buttons allowing the user to enter a custom amount": "", + "Text to display on each button for items with a specific price": "", + "The following methods assume that you already have an existing wallet created and backed up.": "", + "The script language is composed of several rules composed of a currency pair and a mathematic expression.\r\n The example below will use kraken for both LTC_USD and BTC_USD pairs.": "", + "Theme": "", + "Tip percentage amounts (comma separated)": "", + "Translations": "", + "Two-Factor Authentication": "", + "Unarchive this store": "", + "Unify on-chain and lightning payment URL/QR code": "", + "Update Password": "", + "Update Webhook": "", + "Upload a file exported from your wallet": "", + "Upload PSBT from file…": "", + "Url of the Dynamic DNS service you are using": "", + "Use custom theme": "", + "Use SSL": "", + "User can input custom amount": "", + "User can input discount in %": "", + "Users": "", + "UTXOs to spend from": "", + "Verification Code": "", + "View-Only Wallet File": "", + "Wallet file": "", + "Wallet file content": "", + "Wallet Keys File": "", + "Wallet Password": "", + "Wallet's private key is erased from the server. Higher security. To spend, you have to manually input the private key or import it into an external wallet.": "", + "Wallet's private key is stored on the server. Spending the funds you received is convenient. To minimize the risk of theft, regularly withdraw funds to a different wallet.": "", + "Wallets": "", + "Watch-only wallet": "", + "Webhooks": "", + "Welcome to {0}": "", + "With DOGE_USD will be expanded to bitpay(DOGE_BTC) * kraken(BTC_USD). And DOGE_CAD will be expanded to bitpay(DOGE_BTC) * ndax(BTC_CAD).
\r\n However, we advise you to write it that way to increase coverage so that DOGE_BTC is also supported:": "", + "You really should not type your seed into a device that is connected to the internet.": "", + "Your dynamic DNS hostname": "", + "Zero Confirmation": "" +} """; - Default = Translations.CreateFromText(knownTranslations); + Default = Translations.CreateFromJson(knownTranslations); Default = new Translations(new KeyValuePair[] { // You can add additional hard coded default here diff --git a/BTCPayServer/Services/Translations.cs b/BTCPayServer/Services/Translations.cs index a32bbcbe4..7d772cc47 100644 --- a/BTCPayServer/Services/Translations.cs +++ b/BTCPayServer/Services/Translations.cs @@ -53,25 +53,6 @@ namespace BTCPayServer.Services return new Translations(translations .Select(t => KeyValuePair.Create(t.key, t.value))); } - public static Translations CreateFromText(string text) - { - text = (text ?? "").Replace("\r\n", "\n"); - var translations = new List<(string key, string? value)>(); - foreach (var line in text.Split("\n", StringSplitOptions.RemoveEmptyEntries)) - { - var splitted = line.Split("=>", StringSplitOptions.RemoveEmptyEntries); - if (splitted is [var key, var value]) - { - translations.Add((key, value)); - } - else if (splitted is [var key2]) - { - translations.Add((key2, key2)); - } - } - return new Translations(translations - .Select(t => KeyValuePair.Create(t.key, t.value))); - } public Translations(IEnumerable> records) : this (records, null) { diff --git a/BTCPayServer/Views/UIStores/GeneralSettings.cshtml b/BTCPayServer/Views/UIStores/GeneralSettings.cshtml index 7e924a669..53f8b0521 100644 --- a/BTCPayServer/Views/UIStores/GeneralSettings.cshtml +++ b/BTCPayServer/Views/UIStores/GeneralSettings.cshtml @@ -130,9 +130,9 @@ @* For whatever reason wrapping the select with this div fixes this Safari bug: https://github.com/btcpayserver/btcpayserver/issues/3699 *@
@@ -162,7 +162,7 @@
- days + days
@@ -183,10 +183,10 @@
-
Fee will be shown for BTC and LTC onchain payments only.
+
Fee will be shown for BTC and LTC onchain payments only.
- blocks + blocks
diff --git a/BTCPayServer/Views/UIStores/GenerateWalletOptions.cshtml b/BTCPayServer/Views/UIStores/GenerateWalletOptions.cshtml index 62a302a20..ed3ae9dc3 100644 --- a/BTCPayServer/Views/UIStores/GenerateWalletOptions.cshtml +++ b/BTCPayServer/Views/UIStores/GenerateWalletOptions.cshtml @@ -1,7 +1,10 @@ @model WalletSetupViewModel + +@inject Microsoft.Extensions.Localization.IStringLocalizer StringLocalizer @{ - Layout = "_LayoutWalletSetup"; - ViewData.SetActivePage(StoreNavPages.OnchainSettings, $"Generate {Model.CryptoCode} Wallet", $"{Context.GetStoreData().Id}-{Model.CryptoCode}"); + Layout = "_LayoutWalletSetup"; + var title = StringLocalizer["Generate {0} Wallet", Model.CryptoCode]; + ViewData.SetActivePage(StoreNavPages.OnchainSettings, title, $"{Context.GetStoreData().Id}-{Model.CryptoCode}"); } @section Navbar { @@ -10,7 +13,7 @@ } -

Choose your wallet option

+

Choose your wallet option

@if (Model.CanUseHotWallet) @@ -20,11 +23,9 @@
-

Hot wallet

-

- Wallet's private key is stored on the server. - Spending the funds you received is convenient. - To minimize the risk of theft, regularly withdraw funds to a different wallet. +

Hot wallet

+

+ Wallet's private key is stored on the server. Spending the funds you received is convenient. To minimize the risk of theft, regularly withdraw funds to a different wallet.

@@ -37,8 +38,8 @@
-

Hot wallet

-

Please note that creating a hot wallet is not supported by this instance for non administrators.

+

Hot wallet

+

Please note that creating a hot wallet is not supported by this instance for non administrators.

} @@ -50,10 +51,9 @@
-

Watch-only wallet

-

- Wallet's private key is erased from the server. Higher security. - To spend, you have to manually input the private key or import it into an external wallet. +

Watch-only wallet

+

+ Wallet's private key is erased from the server. Higher security. To spend, you have to manually input the private key or import it into an external wallet.

diff --git a/BTCPayServer/Views/UIStores/ImportWalletOptions.cshtml b/BTCPayServer/Views/UIStores/ImportWalletOptions.cshtml index a4b8ada30..ef60a0d4d 100644 --- a/BTCPayServer/Views/UIStores/ImportWalletOptions.cshtml +++ b/BTCPayServer/Views/UIStores/ImportWalletOptions.cshtml @@ -1,8 +1,12 @@ @model WalletSetupViewModel + +@inject Microsoft.Extensions.Localization.IStringLocalizer StringLocalizer + @inject BTCPayNetworkProvider BTCPayNetworkProvider @{ - Layout = "_LayoutWalletSetup"; - ViewData.SetActivePage(StoreNavPages.OnchainSettings, $"Import {Model.CryptoCode} Wallet", $"{Context.GetStoreData().Id}-{Model.CryptoCode}"); + Layout = "_LayoutWalletSetup"; + var title = StringLocalizer["Import {0} Wallet", Model.CryptoCode]; + ViewData.SetActivePage(StoreNavPages.OnchainSettings, title, $"{Context.GetStoreData().Id}-{Model.CryptoCode}"); } @section Navbar { @@ -12,8 +16,8 @@ }
-

Choose your import method

-

The following methods assume that you already have an existing wallet created and backed up.

+

Choose your import method

+

The following methods assume that you already have an existing wallet created and backed up.