diff --git a/ChatTwo/Resources/Language.Designer.cs b/ChatTwo/Resources/Language.Designer.cs index 021c07e..562ced0 100755 --- a/ChatTwo/Resources/Language.Designer.cs +++ b/ChatTwo/Resources/Language.Designer.cs @@ -1364,6 +1364,276 @@ namespace ChatTwo.Resources { } } + /// + /// Looks up a localized string similar to Fri. + /// + internal static string DateWidget_Day_Fri { + get { + return ResourceManager.GetString("DateWidget_Day_Fri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Mon. + /// + internal static string DateWidget_Day_Mon { + get { + return ResourceManager.GetString("DateWidget_Day_Mon", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sat. + /// + internal static string DateWidget_Day_Sat { + get { + return ResourceManager.GetString("DateWidget_Day_Sat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sun. + /// + internal static string DateWidget_Day_Sun { + get { + return ResourceManager.GetString("DateWidget_Day_Sun", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Thu. + /// + internal static string DateWidget_Day_Thu { + get { + return ResourceManager.GetString("DateWidget_Day_Thu", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tue. + /// + internal static string DateWidget_Day_Tue { + get { + return ResourceManager.GetString("DateWidget_Day_Tue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Wed. + /// + internal static string DateWidget_Day_Wed { + get { + return ResourceManager.GetString("DateWidget_Day_Wed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date before {0} is not possible. + /// + internal static string DateWidget_InvalidDate { + get { + return ResourceManager.GetString("DateWidget_InvalidDate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to April. + /// + internal static string DateWidget_Month_April { + get { + return ResourceManager.GetString("DateWidget_Month_April", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to August. + /// + internal static string DateWidget_Month_August { + get { + return ResourceManager.GetString("DateWidget_Month_August", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to December. + /// + internal static string DateWidget_Month_December { + get { + return ResourceManager.GetString("DateWidget_Month_December", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to February. + /// + internal static string DateWidget_Month_February { + get { + return ResourceManager.GetString("DateWidget_Month_February", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to January. + /// + internal static string DateWidget_Month_January { + get { + return ResourceManager.GetString("DateWidget_Month_January", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to July. + /// + internal static string DateWidget_Month_July { + get { + return ResourceManager.GetString("DateWidget_Month_July", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to June. + /// + internal static string DateWidget_Month_June { + get { + return ResourceManager.GetString("DateWidget_Month_June", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to March. + /// + internal static string DateWidget_Month_March { + get { + return ResourceManager.GetString("DateWidget_Month_March", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to May. + /// + internal static string DateWidget_Month_May { + get { + return ResourceManager.GetString("DateWidget_Month_May", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to November. + /// + internal static string DateWidget_Month_November { + get { + return ResourceManager.GetString("DateWidget_Month_November", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to October. + /// + internal static string DateWidget_Month_October { + get { + return ResourceManager.GetString("DateWidget_Month_October", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to September. + /// + internal static string DateWidget_Month_September { + get { + return ResourceManager.GetString("DateWidget_Month_September", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only current character. + /// + internal static string DbViewer_CharacterOption { + get { + return ResourceManager.GetString("DbViewer_CharacterOption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to FromTo:. + /// + internal static string DbViewer_DatePicker_FromTo { + get { + return ResourceManager.GetString("DbViewer_DatePicker_FromTo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [Loading...]. + /// + internal static string DbViewer_LoadingIndicator { + get { + return ResourceManager.GetString("DbViewer_LoadingIndicator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Page: {0} / {1} ({2} Rows) {3}. + /// + internal static string DbViewer_Page { + get { + return ResourceManager.GetString("DbViewer_Page", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Simple Sender/Content Search. + /// + internal static string DbViewer_SearcHint { + get { + return ResourceManager.GetString("DbViewer_SearcHint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Search had no match on this page.. + /// + internal static string DbViewer_Status_NoSearchResult { + get { + return ResourceManager.GetString("DbViewer_Status_NoSearchResult", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nothing Found.. + /// + internal static string DbViewer_Status_NothingFound { + get { + return ResourceManager.GetString("DbViewer_Status_NothingFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Content. + /// + internal static string DbViewer_TableField_Content { + get { + return ResourceManager.GetString("DbViewer_TableField_Content", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Date. + /// + internal static string DbViewer_TableField_Date { + get { + return ResourceManager.GetString("DbViewer_TableField_Date", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sender. + /// + internal static string DbViewer_TableField_Sender { + get { + return ResourceManager.GetString("DbViewer_TableField_Sender", resourceCulture); + } + } + /// /// Looks up a localized string similar to Chinese (full). /// diff --git a/ChatTwo/Resources/Language.resx b/ChatTwo/Resources/Language.resx index 41b52f3..db41bd2 100644 --- a/ChatTwo/Resources/Language.resx +++ b/ChatTwo/Resources/Language.resx @@ -1105,4 +1105,94 @@ Changelog: + + Date before {0} is not possible + + + Sun + + + Mon + + + Tue + + + Wed + + + Thu + + + Fri + + + Sat + + + January + + + February + + + March + + + April + + + May + + + June + + + July + + + August + + + September + + + October + + + November + + + December + + + Date + + + Sender + + + Content + + + Nothing Found. + + + Search had no match on this page. + + + Simple Sender/Content Search + + + Page: {0} / {1} ({2} Rows) {3} + + + [Loading...] + + + Only current character + + + FromTo: + diff --git a/ChatTwo/Ui/DbViewer.cs b/ChatTwo/Ui/DbViewer.cs index 9e6e2e7..ac66fb3 100644 --- a/ChatTwo/Ui/DbViewer.cs +++ b/ChatTwo/Ui/DbViewer.cs @@ -1,6 +1,7 @@ using System.Collections.Concurrent; using System.Globalization; using System.Numerics; +using ChatTwo.Resources; using ChatTwo.Util; using Dalamud.Interface; using Dalamud.Interface.Colors; @@ -77,7 +78,7 @@ public class DbViewer : Window CurrentPage = 1; ImGui.AlignTextToFramePadding(); - ImGui.TextColored(ImGuiColors.DalamudViolet, "FromTo:"); + ImGui.TextColored(ImGuiColors.DalamudViolet, Language.DbViewer_DatePicker_FromTo); ImGui.SameLine(); var spacing = 3.0f * ImGuiHelpers.GlobalScale; @@ -88,7 +89,7 @@ public class DbViewer : Window DateReset(); ImGuiUtil.DrawArrows(ref CurrentPage, 1, totalPages, spacing); - var skipText = "Only current character"; + var skipText = Language.DbViewer_CharacterOption; var textLength = ImGui.GetTextLineHeight() + ImGui.CalcTextSize(skipText).X + ImGui.GetStyle().ItemInnerSpacing.X + ImGui.GetStyle().FramePadding.X * 2; ImGui.SameLine(ImGui.GetContentRegionMax().X - textLength); ImGui.Checkbox(skipText, ref OnlyCurrentCharacter); @@ -97,10 +98,10 @@ public class DbViewer : Window var loadingIndicator = IsProcessing && ProcessingStart < Environment.TickCount64; ImGui.AlignTextToFramePadding(); - ImGui.TextUnformatted($"Page: {CurrentPage} / {totalPages} ({Count} Rows) {(loadingIndicator ? "[Loading...]" : "")}"); + ImGui.TextUnformatted(string.Format(Language.DbViewer_Page, CurrentPage, totalPages, Count, loadingIndicator ? Language.DbViewer_LoadingIndicator : "")); ImGui.SameLine(ImGui.GetContentRegionMax().X - width); ImGui.SetNextItemWidth(width); - if (ImGui.InputTextWithHint("##searchbar", "Simple Sender/Content Search", ref SimpleSearchTerm, 30)) + if (ImGui.InputTextWithHint("##searchbar", Language.DbViewer_SearcHint, ref SimpleSearchTerm, 30)) Filter(); if (DateWidget.Validate(MinimalDate, ref AfterDate, ref BeforeDate)) @@ -144,7 +145,7 @@ public class DbViewer : Window if (Filtered.IsEmpty) { - ImGui.TextUnformatted(SimpleSearchTerm == "" ? "Nothing Found." : "Search had no match on this page."); + ImGui.TextUnformatted(SimpleSearchTerm == "" ? Language.DbViewer_Status_NothingFound : Language.DbViewer_Status_NoSearchResult); return; } @@ -156,9 +157,9 @@ public class DbViewer : Window if (!table.Success) return; - ImGui.TableSetupColumn("Date", ImGuiTableColumnFlags.WidthFixed); - ImGui.TableSetupColumn("Sender"); - ImGui.TableSetupColumn("Content"); + ImGui.TableSetupColumn(Language.DbViewer_TableField_Date, ImGuiTableColumnFlags.WidthFixed); + ImGui.TableSetupColumn(Language.DbViewer_TableField_Sender); + ImGui.TableSetupColumn(Language.DbViewer_TableField_Content); ImGui.TableHeadersRow(); foreach (var message in Filtered) @@ -184,9 +185,9 @@ public class DbViewer : Window Filtered = new ConcurrentStack( Messages.Reverse().Where(m => - ChunkUtil.ToRawString(m.Sender).Contains(SimpleSearchTerm) || - ChunkUtil.ToRawString(m.Content).Contains(SimpleSearchTerm)) - ); + ChunkUtil.ToRawString(m.Sender).Contains(SimpleSearchTerm, StringComparison.InvariantCultureIgnoreCase) || + ChunkUtil.ToRawString(m.Content).Contains(SimpleSearchTerm, StringComparison.InvariantCultureIgnoreCase) + )); } private void DateRefresh() diff --git a/ChatTwo/Util/DatePicker.cs b/ChatTwo/Util/DatePicker.cs index 4f8ef8c..66c3087 100644 --- a/ChatTwo/Util/DatePicker.cs +++ b/ChatTwo/Util/DatePicker.cs @@ -1,5 +1,6 @@ using System.Globalization; using System.Numerics; +using ChatTwo.Resources; using Dalamud.Interface; using Dalamud.Interface.Colors; using Dalamud.Interface.ImGuiNotification; @@ -16,8 +17,8 @@ public static class DateWidget private const int HeightInItems = 1 + 1 + 1 + 4; private static readonly Vector4 Transparent = new(1, 1, 1, 0); - private static readonly string[] DayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; - private static readonly string[] MonthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; + private static readonly string[] DayNames = [Language.DateWidget_Day_Sun, Language.DateWidget_Day_Mon, Language.DateWidget_Day_Tue, Language.DateWidget_Day_Wed, Language.DateWidget_Day_Thu, Language.DateWidget_Day_Fri, Language.DateWidget_Day_Sat]; + private static readonly string[] MonthNames = [Language.DateWidget_Month_January, Language.DateWidget_Month_February, Language.DateWidget_Month_March, Language.DateWidget_Month_April, Language.DateWidget_Month_May, Language.DateWidget_Month_June, Language.DateWidget_Month_July, Language.DateWidget_Month_August, Language.DateWidget_Month_September, Language.DateWidget_Month_October, Language.DateWidget_Month_November, Language.DateWidget_Month_December]; private static readonly int[] NumDaysPerMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; private static uint LastOpenComboID; @@ -50,7 +51,7 @@ public static class DateWidget currentMin = minimal; Plugin.Notification.AddNotification(new Notification { - Content = "Date before {0} is not possible".Format(minimal.ToShortDateString()), + Content = Language.DateWidget_InvalidDate.Format(minimal.ToShortDateString()), Type = NotificationType.Warning, Minimized = false, }); @@ -84,7 +85,7 @@ public static class DateWidget dateString = date.ToString(format); } - public static bool DatePicker(string label, ref DateTime dateOut, bool closeWhenMouseLeavesIt, string leftArrow = "", string rightArrow = "") + private static bool DatePicker(string label, ref DateTime dateOut, bool closeWhenMouseLeavesIt, string leftArrow = "", string rightArrow = "") { var id = ImGui.GetID(label); var style = ImGui.GetStyle(); @@ -253,7 +254,7 @@ public static class DateWidget return valueChanged; } - public static string Center(string source, int length) + private static string Center(string source, int length) { var spaces = length - source.Length; var padLeft = (spaces / 2) + source.Length;