mirror of
https://github.com/knah/VRCMelonAssistant.git
synced 2024-06-15 17:04:44 +12:00
Add localization for a theme loading error message
This commit is contained in:
parent
5b0b1ad606
commit
225a1f2b91
|
@ -255,10 +255,17 @@ namespace ModAssistant
|
|||
|
||||
if (isXaml)
|
||||
{
|
||||
Uri resourceSource = new Uri(info.FullName);
|
||||
ResourceDictionary dictionary = new ResourceDictionary();
|
||||
dictionary.Source = resourceSource;
|
||||
theme.ThemeDictionary = dictionary;
|
||||
try
|
||||
{
|
||||
Uri resourceSource = new Uri(info.FullName);
|
||||
ResourceDictionary dictionary = new ResourceDictionary();
|
||||
dictionary.Source = resourceSource;
|
||||
theme.ThemeDictionary = dictionary;
|
||||
}catch(Exception ex)
|
||||
{
|
||||
string message = string.Format((string)Application.Current.FindResource("Themes:FailedToLoadXaml"), name, ex.Message);
|
||||
MessageBox.Show(message);
|
||||
}
|
||||
}
|
||||
|
||||
if (supportedVideoExtensions.Contains(info.Extension))
|
||||
|
@ -371,7 +378,8 @@ namespace ModAssistant
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Could not load {name}.\n\n{ex.Message}\n\nIgnoring...");
|
||||
string message = string.Format((string)Application.Current.FindResource("Themes:FailedToLoadXaml"), name, ex.Message);
|
||||
MessageBox.Show(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -149,6 +149,7 @@
|
|||
<sys:String x:Key="Themes:ThemeMissing">{0} Themes:ThemeMissing</sys:String>
|
||||
<sys:String x:Key="Themes:SavedTemplateTheme">Themes:SavedTemplateTheme {0}</sys:String>
|
||||
<sys:String x:Key="Themes:TemplateThemeExists">Themes:TemplateThemeExists</sys:String>
|
||||
<sys:String x:Key="Themes:FailedToLoadXaml">Themes:FailedToLoadXaml {0} {1}</sys:String>
|
||||
|
||||
<!-- Updater Class -->
|
||||
<sys:String x:Key="Updater:CheckFailed">Updater:CheckFailed</sys:String>
|
||||
|
|
|
@ -208,6 +208,7 @@
|
|||
<sys:String x:Key="Themes:ThemeMissing">{0} does not exist.</sys:String>
|
||||
<sys:String x:Key="Themes:SavedTemplateTheme">Template theme "{0}" saved to Themes folder.</sys:String>
|
||||
<sys:String x:Key="Themes:TemplateThemeExists">Template theme already exists!</sys:String>
|
||||
<sys:String x:Key="Themes:FailedToLoadXaml">Failed to load .xaml file for theme {0}: {1}</sys:String>
|
||||
|
||||
<!-- Updater Class -->
|
||||
<sys:String x:Key="Updater:CheckFailed">Couldn't check for updates.</sys:String>
|
||||
|
|
Loading…
Reference in a new issue