New Globalisation Changes

This commit is contained in:
Brett Hewitson 2021-12-03 10:00:04 +10:00
parent 034d7401d1
commit d4859e0722
10 changed files with 23 additions and 103 deletions

View file

@ -17,6 +17,7 @@ using System.Linq;
using System.Net;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using WPFSharp.Globalizer;
@ -304,6 +305,7 @@ namespace ServerManagerTool
PluginHelper.Instance.BetaEnabled = this.BetaVersion;
PluginHelper.Instance.LoadPlugins(installPath, true);
PluginHelper.Instance.SetFetchProfileCallback(FetchProfiles);
OnResourceDictionaryChanged(Thread.CurrentThread.CurrentCulture.Name);
// check if we are starting server manager for server shutdown
if (e.Args.Any(a => a.StartsWith(Constants.ARG_AUTOSHUTDOWN1, StringComparison.OrdinalIgnoreCase)))
@ -438,6 +440,11 @@ namespace ServerManagerTool
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public void OnResourceDictionaryChanged(string languageCode)
{
PluginHelper.Instance.OnResourceDictionaryChanged(languageCode);
}
public static void ReconfigureLogging()
{
string logDir = Path.Combine(Config.Default.DataPath, Config.Default.LogsRelativePath);

View file

@ -315,6 +315,8 @@ namespace ServerManagerTool
Config.CultureName = AvailableLanguages.Instance.SelectedLanguage;
PopulateWindowsStatesComboBox();
App.Instance.OnResourceDictionaryChanged(Config.CultureName);
}
private void StyleSelectionComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)