diff --git a/BTCPayServer.Client/Models/CrowdfundAppData.cs b/BTCPayServer.Client/Models/CrowdfundAppData.cs index 65da5416a..ba93ef865 100644 --- a/BTCPayServer.Client/Models/CrowdfundAppData.cs +++ b/BTCPayServer.Client/Models/CrowdfundAppData.cs @@ -32,6 +32,8 @@ public abstract class CrowdfundBaseData : AppBaseData public bool? SortPerksByPopularity { get; set; } public string[]? Sounds { get; set; } public string[]? AnimationColors { get; set; } + public string? HtmlLang { get; set; } + public string? HtmlMetaTags { get; set; } public string? FormId { get; set; } } diff --git a/BTCPayServer.Client/Models/PointOfSaleAppData.cs b/BTCPayServer.Client/Models/PointOfSaleAppData.cs index 035e7a701..46c8eee7e 100644 --- a/BTCPayServer.Client/Models/PointOfSaleAppData.cs +++ b/BTCPayServer.Client/Models/PointOfSaleAppData.cs @@ -24,6 +24,8 @@ public abstract class PointOfSaleBaseData : AppBaseData public string? Description { get; set; } public bool? RedirectAutomatically { get; set; } public int[]? CustomTipPercentages { get; set; } + public string? HtmlLang { get; set; } + public string? HtmlMetaTags { get; set; } public string? FormId { get; set; } } diff --git a/BTCPayServer/Controllers/GreenField/GreenfieldAppsController.cs b/BTCPayServer/Controllers/GreenField/GreenfieldAppsController.cs index 65043a430..0175b618d 100644 --- a/BTCPayServer/Controllers/GreenField/GreenfieldAppsController.cs +++ b/BTCPayServer/Controllers/GreenField/GreenfieldAppsController.cs @@ -333,6 +333,8 @@ namespace BTCPayServer.Controllers.Greenfield SortPerksByPopularity = request.SortPerksByPopularity ?? false, Sounds = parsedSounds ?? new CrowdfundSettings().Sounds, AnimationColors = parsedColors ?? new CrowdfundSettings().AnimationColors, + HtmlMetaTags = request.HtmlMetaTags, + HtmlLang = request.HtmlLang, FormId = request.FormId }; } @@ -360,6 +362,8 @@ namespace BTCPayServer.Controllers.Greenfield NotificationUrl = request.NotificationUrl, RedirectUrl = request.RedirectUrl, Description = request.Description, + HtmlLang = request.HtmlLang, + HtmlMetaTags = request.HtmlMetaTags, RedirectAutomatically = request.RedirectAutomatically, FormId = request.FormId }; @@ -421,6 +425,8 @@ namespace BTCPayServer.Controllers.Greenfield FormId = settings.FormId, NotificationUrl = settings.NotificationUrl, RedirectUrl = settings.RedirectUrl, + HtmlLang = settings.HtmlLang, + HtmlMetaTags = settings.HtmlMetaTags, Description = settings.Description, RedirectAutomatically = settings.RedirectAutomatically, Items = items @@ -484,6 +490,9 @@ namespace BTCPayServer.Controllers.Greenfield SortPerksByPopularity = settings.SortPerksByPopularity, Sounds = settings.Sounds, AnimationColors = settings.AnimationColors, + HtmlLang = settings.HtmlLang, + HtmlMetaTags = settings.HtmlMetaTags, + FormId = settings.FormId, Perks = perks }; } diff --git a/BTCPayServer/Plugins/Crowdfund/Controllers/UICrowdfundController.cs b/BTCPayServer/Plugins/Crowdfund/Controllers/UICrowdfundController.cs index 7822bdfad..26eb379a4 100644 --- a/BTCPayServer/Plugins/Crowdfund/Controllers/UICrowdfundController.cs +++ b/BTCPayServer/Plugins/Crowdfund/Controllers/UICrowdfundController.cs @@ -410,7 +410,7 @@ namespace BTCPayServer.Plugins.Crowdfund.Controllers EnforceTargetAmount = settings.EnforceTargetAmount, StartDate = settings.StartDate, HtmlMetaTags= settings.HtmlMetaTags, - Language = settings.Language, + Language = settings.HtmlLang, TargetCurrency = settings.TargetCurrency, MainImageUrl = settings.MainImageUrl == null ? null : await _uriResolver.Resolve(Request.GetAbsoluteRootUri(), settings.MainImageUrl), Description = settings.Description, @@ -542,7 +542,7 @@ namespace BTCPayServer.Plugins.Crowdfund.Controllers StartDate = vm.StartDate?.ToUniversalTime(), TargetCurrency = vm.TargetCurrency, HtmlMetaTags= _safe.RawMeta(vm.HtmlMetaTags, out wasHtmlModified), - Language = vm.Language, + HtmlLang = vm.Language, Description = vm.Description, EndDate = vm.EndDate?.ToUniversalTime(), TargetAmount = vm.TargetAmount, diff --git a/BTCPayServer/Plugins/Crowdfund/CrowdfundPlugin.cs b/BTCPayServer/Plugins/Crowdfund/CrowdfundPlugin.cs index 16336d7a0..af5778b81 100644 --- a/BTCPayServer/Plugins/Crowdfund/CrowdfundPlugin.cs +++ b/BTCPayServer/Plugins/Crowdfund/CrowdfundPlugin.cs @@ -194,7 +194,7 @@ namespace BTCPayServer.Plugins.Crowdfund { Title = settings.Title, Tagline = settings.Tagline, - Lang = settings.Language, + HtmlLang = settings.HtmlLang, HtmlMetaTags= settings.HtmlMetaTags, Description = settings.Description, StoreName = store.StoreName, diff --git a/BTCPayServer/Plugins/Crowdfund/Models/ViewCrowdfundViewModel.cs b/BTCPayServer/Plugins/Crowdfund/Models/ViewCrowdfundViewModel.cs index 4b5a62c59..8a5e8c663 100644 --- a/BTCPayServer/Plugins/Crowdfund/Models/ViewCrowdfundViewModel.cs +++ b/BTCPayServer/Plugins/Crowdfund/Models/ViewCrowdfundViewModel.cs @@ -14,7 +14,7 @@ namespace BTCPayServer.Plugins.Crowdfund.Models public string AppId { get; set; } public string Title { get; set; } public string Description { get; set; } - public string Lang { get; set; } + public string HtmlLang { get; set; } public string HtmlMetaTags{ get; set; } public string MainImageUrl { get; set; } public string StoreName { get; set; } diff --git a/BTCPayServer/Plugins/PointOfSale/Controllers/UIPointOfSaleController.cs b/BTCPayServer/Plugins/PointOfSale/Controllers/UIPointOfSaleController.cs index e6dec5144..29830b574 100644 --- a/BTCPayServer/Plugins/PointOfSale/Controllers/UIPointOfSaleController.cs +++ b/BTCPayServer/Plugins/PointOfSale/Controllers/UIPointOfSaleController.cs @@ -138,7 +138,7 @@ namespace BTCPayServer.Plugins.PointOfSale.Controllers CustomTipPercentages = settings.CustomTipPercentages, AppId = appId, StoreId = store.Id, - Lang = settings.Language, + HtmlLang = settings.HtmlLang, HtmlMetaTags= settings.HtmlMetaTags, Description = settings.Description, }); @@ -619,7 +619,7 @@ namespace BTCPayServer.Plugins.PointOfSale.Controllers CustomButtonText = settings.CustomButtonText ?? PointOfSaleSettings.CUSTOM_BUTTON_TEXT_DEF, CustomTipText = settings.CustomTipText ?? PointOfSaleSettings.CUSTOM_TIP_TEXT_DEF, CustomTipPercentages = settings.CustomTipPercentages != null ? string.Join(",", settings.CustomTipPercentages) : string.Join(",", PointOfSaleSettings.CUSTOM_TIP_PERCENTAGES_DEF), - Language = settings.Language, + HtmlLang = settings.HtmlLang, HtmlMetaTags= settings.HtmlMetaTags, Description = settings.Description, NotificationUrl = settings.NotificationUrl, @@ -716,7 +716,7 @@ namespace BTCPayServer.Plugins.PointOfSale.Controllers CustomTipPercentages = ListSplit(vm.CustomTipPercentages), NotificationUrl = vm.NotificationUrl, RedirectUrl = vm.RedirectUrl, - Language = vm.Language, + HtmlLang = vm.HtmlLang, HtmlMetaTags = _safe.RawMeta(vm.HtmlMetaTags, out wasHtmlModified), Description = vm.Description, RedirectAutomatically = string.IsNullOrEmpty(vm.RedirectAutomatically) ? null : bool.Parse(vm.RedirectAutomatically), diff --git a/BTCPayServer/Plugins/PointOfSale/Models/UpdatePointOfSaleViewModel.cs b/BTCPayServer/Plugins/PointOfSale/Models/UpdatePointOfSaleViewModel.cs index e18513488..6f92046fc 100644 --- a/BTCPayServer/Plugins/PointOfSale/Models/UpdatePointOfSaleViewModel.cs +++ b/BTCPayServer/Plugins/PointOfSale/Models/UpdatePointOfSaleViewModel.cs @@ -86,7 +86,8 @@ namespace BTCPayServer.Plugins.PointOfSale.Models new() { Text = "Use Store Settings", Value = "" } }, nameof(SelectListItem.Value), nameof(SelectListItem.Text), RedirectAutomatically); - public string Language { get; set; } + [Display(Name = "HTML Lang")] + public string HtmlLang { get; set; } [Display(Name = "HTML Meta Tags")] public string HtmlMetaTags{ get; set; } diff --git a/BTCPayServer/Plugins/PointOfSale/Models/ViewPointOfSaleViewModel.cs b/BTCPayServer/Plugins/PointOfSale/Models/ViewPointOfSaleViewModel.cs index 77c4fb91b..167e944de 100644 --- a/BTCPayServer/Plugins/PointOfSale/Models/ViewPointOfSaleViewModel.cs +++ b/BTCPayServer/Plugins/PointOfSale/Models/ViewPointOfSaleViewModel.cs @@ -68,7 +68,7 @@ namespace BTCPayServer.Plugins.PointOfSale.Models public string CustomButtonText { get; set; } public string CustomTipText { get; set; } public int[] CustomTipPercentages { get; set; } - public string Lang { get; set; } + public string HtmlLang { get; set; } public string HtmlMetaTags{ get; set; } public string Description { get; set; } public SelectList AllCategories { get; set; } diff --git a/BTCPayServer/Services/Apps/CrowdfundSettings.cs b/BTCPayServer/Services/Apps/CrowdfundSettings.cs index bb31b3f02..ff2dce2b7 100644 --- a/BTCPayServer/Services/Apps/CrowdfundSettings.cs +++ b/BTCPayServer/Services/Apps/CrowdfundSettings.cs @@ -10,12 +10,11 @@ namespace BTCPayServer.Services.Apps { public CrowdfundSettings() { - Language = "en"; } public string Title { get; set; } public string Description { get; set; } - public string Language { get; set; } + public string HtmlLang { get; set; } public string HtmlMetaTags{ get; set; } public bool Enabled { get; set; } = true; public DateTime? StartDate { get; set; } diff --git a/BTCPayServer/Services/Apps/PointOfSaleSettings.cs b/BTCPayServer/Services/Apps/PointOfSaleSettings.cs index e788a8ab2..a63145716 100644 --- a/BTCPayServer/Services/Apps/PointOfSaleSettings.cs +++ b/BTCPayServer/Services/Apps/PointOfSaleSettings.cs @@ -8,7 +8,6 @@ namespace BTCPayServer.Services.Apps public PointOfSaleSettings() { Title = "Tea shop"; - Language = "en"; Template = AppService.SerializeTemplate([ new AppItem { @@ -100,7 +99,7 @@ namespace BTCPayServer.Services.Apps public string CustomTipText { get; set; } = CUSTOM_TIP_TEXT_DEF; public static readonly int[] CUSTOM_TIP_PERCENTAGES_DEF = { 15, 18, 20 }; public int[] CustomTipPercentages { get; set; } = CUSTOM_TIP_PERCENTAGES_DEF; - public string Language { get; set; } + public string HtmlLang { get; set; } public string HtmlMetaTags{ get; set; } public string Description { get; set; } public string NotificationUrl { get; set; } diff --git a/BTCPayServer/Views/Shared/Crowdfund/Public/ViewCrowdfund.cshtml b/BTCPayServer/Views/Shared/Crowdfund/Public/ViewCrowdfund.cshtml index a18afdbdd..62a4e2f45 100644 --- a/BTCPayServer/Views/Shared/Crowdfund/Public/ViewCrowdfund.cshtml +++ b/BTCPayServer/Views/Shared/Crowdfund/Public/ViewCrowdfund.cshtml @@ -14,7 +14,7 @@ } } - + diff --git a/BTCPayServer/Views/Shared/PointOfSale/Public/_Layout.cshtml b/BTCPayServer/Views/Shared/PointOfSale/Public/_Layout.cshtml index 88f9b51d7..433bd37e4 100644 --- a/BTCPayServer/Views/Shared/PointOfSale/Public/_Layout.cshtml +++ b/BTCPayServer/Views/Shared/PointOfSale/Public/_Layout.cshtml @@ -33,7 +33,7 @@ } } - + diff --git a/BTCPayServer/Views/Shared/PointOfSale/UpdatePointOfSale.cshtml b/BTCPayServer/Views/Shared/PointOfSale/UpdatePointOfSale.cshtml index 1e14153b1..e876d4450 100644 --- a/BTCPayServer/Views/Shared/PointOfSale/UpdatePointOfSale.cshtml +++ b/BTCPayServer/Views/Shared/PointOfSale/UpdatePointOfSale.cshtml @@ -208,10 +208,9 @@
- - -
Fix the HTML page language
- + + +
diff --git a/BTCPayServer/wwwroot/swagger/v1/swagger.template.apps.json b/BTCPayServer/wwwroot/swagger/v1/swagger.template.apps.json index ff1ae847a..65cde5b8d 100644 --- a/BTCPayServer/wwwroot/swagger/v1/swagger.template.apps.json +++ b/BTCPayServer/wwwroot/swagger/v1/swagger.template.apps.json @@ -762,6 +762,18 @@ "example": true, "nullable": true }, + "htmlLang": { + "type": "string", + "description": "Used for SEO, the [HTML Lang](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang) of the page", + "nullable": true, + "example": "en" + }, + "htmlMetaTags": { + "type": "string", + "description": "Used for SEO, the [Meta tags](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta) of the page", + "nullable": true, + "example": "" + }, "formId": { "type": "string", "description": "Form ID to request customer data", @@ -984,6 +996,18 @@ ], "nullable": true }, + "htmlLang": { + "type": "string", + "description": "Used for SEO, the [HTML Lang](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang) of the page", + "nullable": true, + "example": "en" + }, + "htmlMetaTags": { + "type": "string", + "description": "Used for SEO, the [Meta tags](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta) of the page", + "nullable": true, + "example": "" + }, "formId": { "type": "string", "description": "Form ID to request customer data",