Merge branch 'net5'

This commit is contained in:
goaaats 2022-06-24 22:16:24 +02:00
commit 1a2365a676
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
66 changed files with 964 additions and 899 deletions

View file

@ -5,6 +5,7 @@ using System.Linq;
using System.Reflection;
using CheapLoc;
using Dalamud.Configuration.Internal;
using Serilog;
namespace Dalamud
@ -12,6 +13,7 @@ namespace Dalamud
/// <summary>
/// Class handling localization.
/// </summary>
[ServiceManager.EarlyLoadedService]
public class Localization
{
/// <summary>
@ -40,6 +42,16 @@ namespace Dalamud
this.assembly = Assembly.GetCallingAssembly();
}
[ServiceManager.ServiceConstructor]
private Localization(Dalamud dalamud, DalamudConfiguration configuration)
: this(Path.Combine(dalamud.AssetDirectory.FullName, "UIRes", "loc", "dalamud"), "dalamud_")
{
if (!string.IsNullOrEmpty(configuration.LanguageOverride))
this.SetupWithLangCode(configuration.LanguageOverride);
else
this.SetupWithUiCulture();
}
/// <summary>
/// Delegate for the <see cref="Localization.LocalizationChanged"/> event that occurs when the language is changed.
/// </summary>