mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-27 02:49:18 +01:00
ClientLanguageExtensions and usage
This commit is contained in:
parent
a62680cf5b
commit
47ac918e46
2 changed files with 29 additions and 19 deletions
27
Dalamud/ClientLanguageExtensions.cs
Normal file
27
Dalamud/ClientLanguageExtensions.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
|
||||
namespace Dalamud
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension methods for the <see cref="ClientLanguage"/> class.
|
||||
/// </summary>
|
||||
public static class ClientLanguageExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts a Dalamud ClientLanguage to the corresponding Lumina variant.
|
||||
/// </summary>
|
||||
/// <param name="language">Langauge to convert.</param>
|
||||
/// <returns>Converted langauge.</returns>
|
||||
public static Lumina.Data.Language ToLumina(this ClientLanguage language)
|
||||
{
|
||||
return language switch
|
||||
{
|
||||
ClientLanguage.Japanese => Lumina.Data.Language.Japanese,
|
||||
ClientLanguage.English => Lumina.Data.Language.English,
|
||||
ClientLanguage.German => Lumina.Data.Language.German,
|
||||
ClientLanguage.French => Lumina.Data.Language.French,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(language)),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue