mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-18 13:57:43 +01:00
Prevent NPE, load Korean font if it exists (#802)
Co-authored-by: goaaats <goatsdev@protonmail.com>
This commit is contained in:
parent
0b6417fd7c
commit
2a36122c2c
4 changed files with 88 additions and 30 deletions
|
|
@ -1,7 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
||||
using System.Linq;
|
||||
using Dalamud.Game.Text;
|
||||
using Dalamud.Interface.GameFonts;
|
||||
using Dalamud.Interface.Style;
|
||||
|
|
@ -311,6 +312,37 @@ namespace Dalamud.Configuration.Internal
|
|||
/// </summary>
|
||||
public bool IsMbCollect { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ISO 639-1 two-letter code for the language of the effective Dalamud display language.
|
||||
/// </summary>
|
||||
public string EffectiveLanguage
|
||||
{
|
||||
get
|
||||
{
|
||||
var languages = Localization.ApplicableLangCodes.Prepend("en").ToArray();
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.LanguageOverride))
|
||||
{
|
||||
var currentUiLang = CultureInfo.CurrentUICulture;
|
||||
|
||||
if (Localization.ApplicableLangCodes.Any(x => currentUiLang.TwoLetterISOLanguageName == x))
|
||||
return currentUiLang.TwoLetterISOLanguageName;
|
||||
else
|
||||
return languages[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.LanguageOverride;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return languages[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether or not to show info on dev bar.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue