From e768bae5d6fa276da5d54fa35646886c0c4a31b6 Mon Sep 17 00:00:00 2001 From: bluepilledgreat <97983689+bluepilledgreat@users.noreply.github.com> Date: Sat, 15 Mar 2025 00:13:32 +0000 Subject: [PATCH] localise default custom theme name --- Bloxstrap/Resources/Strings.Designer.cs | 9 +++++++++ Bloxstrap/Resources/Strings.resx | 4 ++++ .../UI/Elements/Dialogs/AddCustomThemeDialog.xaml.cs | 5 +++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Bloxstrap/Resources/Strings.Designer.cs b/Bloxstrap/Resources/Strings.Designer.cs index e3cc12c..848b724 100644 --- a/Bloxstrap/Resources/Strings.Designer.cs +++ b/Bloxstrap/Resources/Strings.Designer.cs @@ -973,6 +973,15 @@ namespace Bloxstrap.Resources { } } + /// + /// Looks up a localized string similar to Custom Theme {0}. + /// + public static string CustomTheme_DefaultName { + get { + return ResourceManager.GetString("CustomTheme.DefaultName", resourceCulture); + } + } + /// /// Looks up a localized string similar to Save changes to {0}?. /// diff --git a/Bloxstrap/Resources/Strings.resx b/Bloxstrap/Resources/Strings.resx index db2bd75..f0355ae 100644 --- a/Bloxstrap/Resources/Strings.resx +++ b/Bloxstrap/Resources/Strings.resx @@ -1483,4 +1483,8 @@ Defaulting to {1}. Find more custom bootstrapper examples at {0} + + Custom Theme {0} + {0} is a string (e.g. '1', '1-1234') + \ No newline at end of file diff --git a/Bloxstrap/UI/Elements/Dialogs/AddCustomThemeDialog.xaml.cs b/Bloxstrap/UI/Elements/Dialogs/AddCustomThemeDialog.xaml.cs index d9f9bc4..9d88c8c 100644 --- a/Bloxstrap/UI/Elements/Dialogs/AddCustomThemeDialog.xaml.cs +++ b/Bloxstrap/UI/Elements/Dialogs/AddCustomThemeDialog.xaml.cs @@ -39,11 +39,12 @@ namespace Bloxstrap.UI.Elements.Dialogs { int count = Directory.GetDirectories(Paths.CustomThemes).Count(); - string name = $"Custom Theme {count + 1}"; + int i = count + 1; + string name = string.Format(Strings.CustomTheme_DefaultName, i); // TODO: this sucks if (File.Exists(GetThemePath(name))) - name += " " + Random.Shared.Next(1, 100000).ToString(); // easy + name = string.Format(Strings.CustomTheme_DefaultName, $"{i}-{Random.Shared.Next(1, 100000)}"); // easy return name; }