mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Remove Lumina Language extension, use ClientLanguage instead
This commit is contained in:
parent
3bfc831167
commit
227400d821
2 changed files with 11 additions and 38 deletions
|
|
@ -142,7 +142,7 @@ namespace Dalamud.Data
|
|||
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
||||
public TexFile GetIcon(int iconId)
|
||||
{
|
||||
return GetIcon(string.Empty, iconId);
|
||||
return GetIcon(this.language, iconId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -151,11 +151,17 @@ namespace Dalamud.Data
|
|||
/// <param name="iconLanguage">The requested language.</param>
|
||||
/// <param name="iconId">The icon ID.</param>
|
||||
/// <returns>The <see cref="TexFile"/> containing the icon.</returns>
|
||||
public TexFile GetIcon(Language iconLanguage, int iconId)
|
||||
public TexFile GetIcon(ClientLanguage iconLanguage, int iconId)
|
||||
{
|
||||
var type = iconLanguage.GetCode();
|
||||
if (type.Length > 0)
|
||||
type += "/";
|
||||
var type = iconLanguage switch {
|
||||
ClientLanguage.Japanese => "ja/",
|
||||
ClientLanguage.English => "en/",
|
||||
ClientLanguage.German => "de/",
|
||||
ClientLanguage.French => "fr/",
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(this.language),
|
||||
"Unknown Language: " + this.language)
|
||||
};
|
||||
|
||||
return GetIcon(type, iconId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
using Lumina.Data;
|
||||
|
||||
namespace Dalamud.Data.LuminaExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Extensions to <see cref="Language"/>.
|
||||
/// </summary>
|
||||
public static class LanguageExtensions
|
||||
{
|
||||
private static readonly Dictionary<Language, string> LangToCode = new Dictionary<Language, string>()
|
||||
{
|
||||
{ Language.None, "" },
|
||||
{ Language.Japanese, "ja" },
|
||||
{ Language.English, "en" },
|
||||
{ Language.German, "de" },
|
||||
{ Language.French, "fr" },
|
||||
{ Language.ChineseSimplified, "chs" },
|
||||
{ Language.ChineseTraditional, "cht" },
|
||||
{ Language.Korean, "ko" },
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Return the language code for a <see cref="Language"/>.
|
||||
/// </summary>
|
||||
/// <param name="language">The Language.</param>
|
||||
/// <returns>The language code.</returns>
|
||||
public static string GetCode(this Language language)
|
||||
{
|
||||
return LangToCode[language];
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue