mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Merge pull request #198 from Aireil/fix_combo_selection
Fix the language combo preview in settings if no override
This commit is contained in:
commit
eebf4b9b9c
1 changed files with 17 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using CheapLoc;
|
||||
|
|
@ -28,7 +29,22 @@ namespace Dalamud.Interface
|
|||
this.doDalamudTest = this.dalamud.Configuration.DoDalamudTest;
|
||||
|
||||
this.languages = Localization.ApplicableLangCodes.Prepend("en").ToArray();
|
||||
this.langIndex = string.IsNullOrEmpty(this.dalamud.Configuration.LanguageOverride) ? 0 : Array.IndexOf(this.languages, this.dalamud.Configuration.LanguageOverride);
|
||||
try {
|
||||
if (string.IsNullOrEmpty(this.dalamud.Configuration.LanguageOverride)) {
|
||||
var currentUiLang = CultureInfo.CurrentUICulture;
|
||||
|
||||
if (Localization.ApplicableLangCodes.Any(x => currentUiLang.TwoLetterISOLanguageName == x))
|
||||
this.langIndex = Array.IndexOf(this.languages, currentUiLang.TwoLetterISOLanguageName);
|
||||
else
|
||||
this.langIndex = 0;
|
||||
}
|
||||
else {
|
||||
this.langIndex = Array.IndexOf(this.languages, this.dalamud.Configuration.LanguageOverride);
|
||||
}
|
||||
}
|
||||
catch (Exception) {
|
||||
this.langIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private string[] languages;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue