localise custom theme add dialog

This commit is contained in:
bluepilledgreat 2025-03-11 18:50:09 +00:00
parent 3cfa9a0aad
commit f873b7785e
4 changed files with 156 additions and 12 deletions

View File

@ -441,6 +441,15 @@ namespace Bloxstrap.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Create New.
/// </summary>
public static string Common_CreateNew {
get {
return ResourceManager.GetString("Common.CreateNew", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Custom. /// Looks up a localized string similar to Custom.
/// </summary> /// </summary>
@ -495,6 +504,15 @@ namespace Bloxstrap.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Import.
/// </summary>
public static string Common_Import {
get {
return ResourceManager.GetString("Common.Import", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Import from file. /// Looks up a localized string similar to Import from file.
/// </summary> /// </summary>
@ -684,6 +702,15 @@ namespace Bloxstrap.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Template.
/// </summary>
public static string Common_Template {
get {
return ResourceManager.GetString("Common.Template", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Value. /// Looks up a localized string similar to Value.
/// </summary> /// </summary>
@ -847,6 +874,87 @@ namespace Bloxstrap.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to File must be a ZIP.
/// </summary>
public static string CustomTheme_Add_Errors_FileNotZip {
get {
return ResourceManager.GetString("CustomTheme.Add.Errors.FileNotZip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Name cannot be empty.
/// </summary>
public static string CustomTheme_Add_Errors_NameEmpty {
get {
return ResourceManager.GetString("CustomTheme.Add.Errors.NameEmpty", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Name contains illegal characters.
/// </summary>
public static string CustomTheme_Add_Errors_NameIllegalCharacters {
get {
return ResourceManager.GetString("CustomTheme.Add.Errors.NameIllegalCharacters", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Name cannot be used.
/// </summary>
public static string CustomTheme_Add_Errors_NameReserved {
get {
return ResourceManager.GetString("CustomTheme.Add.Errors.NameReserved", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Name is already in use.
/// </summary>
public static string CustomTheme_Add_Errors_NameTaken {
get {
return ResourceManager.GetString("CustomTheme.Add.Errors.NameTaken", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unknown error.
/// </summary>
public static string CustomTheme_Add_Errors_Unknown {
get {
return ResourceManager.GetString("CustomTheme.Add.Errors.Unknown", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Invalid or corrupted ZIP file.
/// </summary>
public static string CustomTheme_Add_Errors_ZipInvalidData {
get {
return ResourceManager.GetString("CustomTheme.Add.Errors.ZipInvalidData", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Theme file could not be found in the ZIP file.
/// </summary>
public static string CustomTheme_Add_Errors_ZipMissingThemeFile {
get {
return ResourceManager.GetString("CustomTheme.Add.Errors.ZipMissingThemeFile", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add Custom Theme.
/// </summary>
public static string CustomTheme_Add_Title {
get {
return ResourceManager.GetString("CustomTheme.Add.Title", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Custom dialog has already been initialised. /// Looks up a localized string similar to Custom dialog has already been initialised.
/// </summary> /// </summary>

View File

@ -1387,4 +1387,40 @@ Please close any applications that may be using Roblox's files, and relaunch.</v
<data name="CustomTheme.Editor.OpenThemeDirectory" xml:space="preserve"> <data name="CustomTheme.Editor.OpenThemeDirectory" xml:space="preserve">
<value>Open Theme Directory</value> <value>Open Theme Directory</value>
</data> </data>
<data name="Common.CreateNew" xml:space="preserve">
<value>Create New</value>
</data>
<data name="Common.Import" xml:space="preserve">
<value>Import</value>
</data>
<data name="CustomTheme.Add.Title" xml:space="preserve">
<value>Add Custom Theme</value>
</data>
<data name="Common.Template" xml:space="preserve">
<value>Template</value>
</data>
<data name="CustomTheme.Add.Errors.NameEmpty" xml:space="preserve">
<value>Name cannot be empty</value>
</data>
<data name="CustomTheme.Add.Errors.NameIllegalCharacters" xml:space="preserve">
<value>Name contains illegal characters</value>
</data>
<data name="CustomTheme.Add.Errors.NameReserved" xml:space="preserve">
<value>Name cannot be used</value>
</data>
<data name="CustomTheme.Add.Errors.Unknown" xml:space="preserve">
<value>Unknown error</value>
</data>
<data name="CustomTheme.Add.Errors.NameTaken" xml:space="preserve">
<value>Name is already in use</value>
</data>
<data name="CustomTheme.Add.Errors.FileNotZip" xml:space="preserve">
<value>File must be a ZIP</value>
</data>
<data name="CustomTheme.Add.Errors.ZipMissingThemeFile" xml:space="preserve">
<value>Theme file could not be found in the ZIP file</value>
</data>
<data name="CustomTheme.Add.Errors.ZipInvalidData" xml:space="preserve">
<value>Invalid or corrupted ZIP file</value>
</data>
</root> </root>

View File

@ -29,7 +29,7 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<ui:TitleBar <ui:TitleBar
Title="Add Custom Theme" Title="{x:Static resources:Strings.CustomTheme_Add_Title}"
Grid.Row="0" Grid.Row="0"
Grid.ColumnSpan="2" Grid.ColumnSpan="2"
Padding="8" Padding="8"
@ -43,7 +43,7 @@
Grid.Row="1" Grid.Row="1"
Margin="16" Margin="16"
SelectedIndex="{Binding Path=SelectedTab, Mode=TwoWay}"> SelectedIndex="{Binding Path=SelectedTab, Mode=TwoWay}">
<TabItem Header="Create New"> <TabItem Header="{x:Static resources:Strings.Common_CreateNew}">
<Grid Grid.Row="1" Margin="16"> <Grid Grid.Row="1" Margin="16">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -93,7 +93,7 @@
Grid.Column="0" Grid.Column="0"
MinWidth="100" MinWidth="100"
VerticalAlignment="Center" VerticalAlignment="Center"
Text="Template" /> Text="{x:Static resources:Strings.Common_Template}" />
<ComboBox <ComboBox
Grid.Row="1" Grid.Row="1"
@ -108,7 +108,7 @@
</ComboBox> </ComboBox>
</Grid> </Grid>
</TabItem> </TabItem>
<TabItem Header="Import"> <TabItem Header="{x:Static resources:Strings.Common_Import}">
<Grid Margin="11"> <Grid Margin="11">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="*" /> <RowDefinition Height="*" />

View File

@ -87,7 +87,7 @@ namespace Bloxstrap.UI.Elements.Dialogs
if (string.IsNullOrEmpty(_viewModel.Name)) if (string.IsNullOrEmpty(_viewModel.Name))
{ {
_viewModel.NameError = "Name cannot be empty"; _viewModel.NameError = Strings.CustomTheme_Add_Errors_NameEmpty;
return false; return false;
} }
@ -98,16 +98,16 @@ namespace Bloxstrap.UI.Elements.Dialogs
switch (validationResult) switch (validationResult)
{ {
case PathValidator.ValidationResult.IllegalCharacter: case PathValidator.ValidationResult.IllegalCharacter:
_viewModel.NameError = "Name contains illegal characters"; _viewModel.NameError = Strings.CustomTheme_Add_Errors_NameIllegalCharacters;
break; break;
case PathValidator.ValidationResult.ReservedFileName: case PathValidator.ValidationResult.ReservedFileName:
_viewModel.NameError = "Name cannot be used"; _viewModel.NameError = Strings.CustomTheme_Add_Errors_NameReserved;
break; break;
default: default:
App.Logger.WriteLine(LOG_IDENT, $"Got unhandled PathValidator::ValidationResult {validationResult}"); App.Logger.WriteLine(LOG_IDENT, $"Got unhandled PathValidator::ValidationResult {validationResult}");
Debug.Assert(false); Debug.Assert(false);
_viewModel.NameError = "Unknown error"; _viewModel.NameError = Strings.CustomTheme_Add_Errors_Unknown;
break; break;
} }
@ -118,7 +118,7 @@ namespace Bloxstrap.UI.Elements.Dialogs
string path = Path.Combine(Paths.CustomThemes, _viewModel.Name, "Theme.xml"); string path = Path.Combine(Paths.CustomThemes, _viewModel.Name, "Theme.xml");
if (File.Exists(path)) if (File.Exists(path))
{ {
_viewModel.NameError = "Name is already in use"; _viewModel.NameError = Strings.CustomTheme_Add_Errors_NameTaken;
return false; return false;
} }
@ -131,7 +131,7 @@ namespace Bloxstrap.UI.Elements.Dialogs
if (!_viewModel.FilePath.EndsWith(".zip")) if (!_viewModel.FilePath.EndsWith(".zip"))
{ {
_viewModel.FileError = "File must be a ZIP"; _viewModel.FileError = Strings.CustomTheme_Add_Errors_FileNotZip;
return false; return false;
} }
@ -153,7 +153,7 @@ namespace Bloxstrap.UI.Elements.Dialogs
if (!foundThemeFile) if (!foundThemeFile)
{ {
_viewModel.FileError = "Theme file could not be found in the ZIP file"; _viewModel.FileError = Strings.CustomTheme_Add_Errors_ZipMissingThemeFile;
return false; return false;
} }
@ -164,7 +164,7 @@ namespace Bloxstrap.UI.Elements.Dialogs
App.Logger.WriteLine(LOG_IDENT, "Got invalid data"); App.Logger.WriteLine(LOG_IDENT, "Got invalid data");
App.Logger.WriteException(LOG_IDENT, ex); App.Logger.WriteException(LOG_IDENT, ex);
_viewModel.FileError = "Invalid or corrupted ZIP file"; _viewModel.FileError = Strings.CustomTheme_Add_Errors_ZipInvalidData;
return false; return false;
} }
} }