mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
fix: UiLanguage null when no override
This commit is contained in:
parent
0c8405777a
commit
40145e13b1
1 changed files with 14 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Dynamic;
|
using System.Dynamic;
|
||||||
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
@ -50,7 +51,19 @@ namespace Dalamud.Plugin
|
||||||
this.configs = configs;
|
this.configs = configs;
|
||||||
|
|
||||||
this.Sanitizer = new Sanitizer(this.Data.Language);
|
this.Sanitizer = new Sanitizer(this.Data.Language);
|
||||||
this.UiLanguage = this.dalamud.Configuration.LanguageOverride;
|
if (this.dalamud.Configuration.LanguageOverride != null)
|
||||||
|
{
|
||||||
|
this.UiLanguage = this.dalamud.Configuration.LanguageOverride;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var currentUiLang = CultureInfo.CurrentUICulture;
|
||||||
|
if (Localization.ApplicableLangCodes.Any(x => currentUiLang.TwoLetterISOLanguageName == x))
|
||||||
|
this.UiLanguage = currentUiLang.TwoLetterISOLanguageName;
|
||||||
|
else
|
||||||
|
this.UiLanguage = "en";
|
||||||
|
}
|
||||||
|
|
||||||
dalamud.LocalizationManager.OnLocalizationChanged += this.OnLocalizationChanged;
|
dalamud.LocalizationManager.OnLocalizationChanged += this.OnLocalizationChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue