mirror of
https://github.com/tribufu/ServerManagers
synced 2026-06-01 09:42:39 +00:00
Changes to fix campatibility error
This commit is contained in:
parent
98a19e2d17
commit
bd04866ea6
4 changed files with 25 additions and 3 deletions
|
|
@ -59,6 +59,28 @@ namespace ServerManagerTool.Plugin.Discord
|
||||||
|
|
||||||
public bool HasConfigForm => true;
|
public bool HasConfigForm => true;
|
||||||
|
|
||||||
|
public string LanguageCode
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var assembly = PluginHelper.Instance.GetType().Assembly;
|
||||||
|
if (assembly != null)
|
||||||
|
{
|
||||||
|
var pluginHelperType = assembly.GetType(typeof(PluginHelper).FullName, false, true);
|
||||||
|
if (pluginHelperType != null)
|
||||||
|
{
|
||||||
|
var field = pluginHelperType.GetProperty("LanguageCode");
|
||||||
|
if (field != null)
|
||||||
|
{
|
||||||
|
return field.GetValue(PluginHelper.Instance).ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "en-US";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async Task CallHomeAsync()
|
private async Task CallHomeAsync()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ namespace ServerManagerTool.Plugin.Discord.Windows
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ResourceUtils.UpdateResourceDictionary(this, PluginHelper.Instance.LanguageCode);
|
ResourceUtils.UpdateResourceDictionary(this, plugin.LanguageCode);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ namespace ServerManagerTool.Plugin.Discord.Windows
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ResourceUtils.UpdateResourceDictionary(this, PluginHelper.Instance.LanguageCode);
|
ResourceUtils.UpdateResourceDictionary(this, plugin.LanguageCode);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace ServerManagerTool.Plugin.Discord.Windows
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ResourceUtils.UpdateResourceDictionary(this, PluginHelper.Instance.LanguageCode);
|
ResourceUtils.UpdateResourceDictionary(this, plugin.LanguageCode);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue