From 61df873bb149639fc7881cd7f9f13b0fe5d7002a Mon Sep 17 00:00:00 2001 From: RaidMax Date: Fri, 8 Jul 2022 20:40:27 -0500 Subject: [PATCH] more localization tweaks --- SharedLibraryCore/Utilities.cs | 14 ++++++-------- WebfrontCore/Controllers/ActionController.cs | 8 ++++---- WebfrontCore/Views/Penalty/List.cshtml | 8 ++++---- WebfrontCore/Views/Penalty/_Penalty.cshtml | 2 +- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/SharedLibraryCore/Utilities.cs b/SharedLibraryCore/Utilities.cs index 0bcaf4742..47ce5cc6e 100644 --- a/SharedLibraryCore/Utilities.cs +++ b/SharedLibraryCore/Utilities.cs @@ -170,23 +170,21 @@ namespace SharedLibraryCore { return str.Replace("//", "/ /"); } - - public static string RemoveDiacritics(this string text) + + public static string RemoveDiacritics(this string text) { var normalizedString = text.Normalize(NormalizationForm.FormD); - var stringBuilder = new StringBuilder(normalizedString.Length); + var stringBuilder = new StringBuilder(); - foreach (var c in from c in normalizedString - let unicodeCategory = CharUnicodeInfo.GetUnicodeCategory(c) + foreach (var c in from c in normalizedString.EnumerateRunes() + let unicodeCategory = Rune.GetUnicodeCategory(c) where unicodeCategory != UnicodeCategory.NonSpacingMark select c) { stringBuilder.Append(c); } - return stringBuilder - .ToString() - .Normalize(NormalizationForm.FormC); + return stringBuilder.ToString().Normalize(NormalizationForm.FormC); } public static string FormatMessageForEngine(this string str, IRConParserConfiguration config) diff --git a/WebfrontCore/Controllers/ActionController.cs b/WebfrontCore/Controllers/ActionController.cs index 9d52bcc96..f7df35b1d 100644 --- a/WebfrontCore/Controllers/ActionController.cs +++ b/WebfrontCore/Controllers/ActionController.cs @@ -487,7 +487,7 @@ namespace WebfrontCore.Controllers { var info = new ActionInfo { - ActionButtonLabel = "Dismiss", + ActionButtonLabel = Localization["WEBFRONT_ACTION_DISMISS_ALERT_FORM_SUBMIT"], Name = Localization["WEBFRONT_ACTION_DISMISS_ALERT_SINGLE"], Inputs = new List { @@ -521,7 +521,7 @@ namespace WebfrontCore.Controllers { var info = new ActionInfo { - ActionButtonLabel = "Dismiss", + ActionButtonLabel = Localization["WEBFRONT_ACTION_DISMISS_ALERT_FORM_SUBMIT"], Name = Localization["WEBFRONT_ACTION_DISMISS_ALERT_MANY"], Inputs = new List { @@ -555,14 +555,14 @@ namespace WebfrontCore.Controllers { var info = new ActionInfo { - ActionButtonLabel = "Send", + ActionButtonLabel = Localization["WEBFRONT_ACTION_OFFLINE_MESSAGE_FORM_SUBMIT"], Name = Localization["WEBFRONT_ACTION_OFFLINE_MESSAGE_BUTTON_COMPOSE"], Inputs = new List { new() { Name = "message", - Label = "Message Content", + Label = Localization["WEBFRONT_ACTION_OFFLINE_MESSAGE_FORM_CONTENT"], }, }, Action = "OfflineMessage", diff --git a/WebfrontCore/Views/Penalty/List.cshtml b/WebfrontCore/Views/Penalty/List.cshtml index 79270c55d..a65ea8447 100644 --- a/WebfrontCore/Views/Penalty/List.cshtml +++ b/WebfrontCore/Views/Penalty/List.cshtml @@ -43,22 +43,22 @@ { if (Model == EFPenalty.PenaltyType.Any) { - + } else { - + } } else { if (penaltyType == Model) { - + } else { - + } } } diff --git a/WebfrontCore/Views/Penalty/_Penalty.cshtml b/WebfrontCore/Views/Penalty/_Penalty.cshtml index 9cbe7326e..5f6f6c704 100644 --- a/WebfrontCore/Views/Penalty/_Penalty.cshtml +++ b/WebfrontCore/Views/Penalty/_Penalty.cshtml @@ -17,7 +17,7 @@ - @Model.PenaltyType + @ViewBag.Localization[$"WEBFRONT_PENALTY_{Model.PenaltyType.ToString().ToUpper()}"]