mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
Globalisation Changes
This commit is contained in:
parent
4a80b089b4
commit
034d7401d1
15 changed files with 410 additions and 51 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using ServerManagerTool.Plugin.Common.Delegates;
|
||||
using ServerManagerTool.Plugin.Common.Events;
|
||||
using ServerManagerTool.Plugin.Common.Lib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
|
@ -15,6 +16,7 @@ namespace ServerManagerTool.Plugin.Common
|
|||
{
|
||||
private const string PLUGINFILE_FOLDER = "Plugins";
|
||||
private const string PLUGINFILE_EXTENSION = "dll";
|
||||
public const string LANGUAGECODE_FALLBACK = "en-US";
|
||||
|
||||
private static volatile PluginHelper _instance;
|
||||
private static readonly object _syncLock = new object();
|
||||
|
|
@ -24,9 +26,12 @@ namespace ServerManagerTool.Plugin.Common
|
|||
private FetchProfilesDelegate _fetchProfilesCallback;
|
||||
private bool _disposed;
|
||||
|
||||
public EventHandler<ResourceDictionaryChangedEventArgs> ResourceDictionaryChanged;
|
||||
|
||||
private PluginHelper()
|
||||
{
|
||||
BetaEnabled = false;
|
||||
LanguageCode = LANGUAGECODE_FALLBACK;
|
||||
Plugins = new ObservableCollection<PluginItem>();
|
||||
}
|
||||
|
||||
|
|
@ -61,6 +66,12 @@ namespace ServerManagerTool.Plugin.Common
|
|||
set;
|
||||
}
|
||||
|
||||
public string LanguageCode
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public ObservableCollection<PluginItem> Plugins
|
||||
{
|
||||
get;
|
||||
|
|
@ -236,6 +247,12 @@ namespace ServerManagerTool.Plugin.Common
|
|||
}
|
||||
}
|
||||
|
||||
public void OnResourceDictionaryChanged(string languageCode)
|
||||
{
|
||||
LanguageCode = languageCode;
|
||||
ResourceDictionaryChanged?.Invoke(this, new ResourceDictionaryChangedEventArgs(languageCode));
|
||||
}
|
||||
|
||||
internal void OpenConfigForm(string pluginCode, Window owner)
|
||||
{
|
||||
if (Plugins == null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue