mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-19 00:51:30 -07:00
localise default custom theme name
This commit is contained in:
parent
a8158dec33
commit
e768bae5d6
9
Bloxstrap/Resources/Strings.Designer.cs
generated
9
Bloxstrap/Resources/Strings.Designer.cs
generated
@ -973,6 +973,15 @@ namespace Bloxstrap.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Custom Theme {0}.
|
||||
/// </summary>
|
||||
public static string CustomTheme_DefaultName {
|
||||
get {
|
||||
return ResourceManager.GetString("CustomTheme.DefaultName", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Save changes to {0}?.
|
||||
/// </summary>
|
||||
|
@ -1483,4 +1483,8 @@ Defaulting to {1}.</value>
|
||||
<data name="CustomTheme.Templates.Simple.MoreExamples" xml:space="preserve">
|
||||
<value>Find more custom bootstrapper examples at {0}</value>
|
||||
</data>
|
||||
<data name="CustomTheme.DefaultName" xml:space="preserve">
|
||||
<value>Custom Theme {0}</value>
|
||||
<comment>{0} is a string (e.g. '1', '1-1234')</comment>
|
||||
</data>
|
||||
</root>
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user