mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-20 06:47:44 +01:00
Load services asynchronously whenever possible (#893)
This commit is contained in:
parent
fba8c7163c
commit
8e7f370ddd
66 changed files with 959 additions and 899 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue