mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-02 05:43:40 +01:00
Load new localization before firing change event
This commit is contained in:
parent
29c4d4939f
commit
f3e462eb6b
1 changed files with 13 additions and 13 deletions
|
|
@ -112,10 +112,12 @@ public class Localization : IServiceType
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set up the UI language with "fallbacks"(original English text).
|
/// Set up the UI language with "fallbacks" (original English text).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SetupWithFallbacks()
|
public void SetupWithFallbacks()
|
||||||
{
|
{
|
||||||
|
Loc.SetupWithFallbacks(this.assembly);
|
||||||
|
|
||||||
this.DalamudLanguageCultureInfo = CultureInfo.InvariantCulture;
|
this.DalamudLanguageCultureInfo = CultureInfo.InvariantCulture;
|
||||||
foreach (var d in Delegate.EnumerateInvocationList(this.LocalizationChanged))
|
foreach (var d in Delegate.EnumerateInvocationList(this.LocalizationChanged))
|
||||||
{
|
{
|
||||||
|
|
@ -128,8 +130,6 @@ public class Localization : IServiceType
|
||||||
Log.Error(ex, "Exception during raise of {handler}", d.Method);
|
Log.Error(ex, "Exception during raise of {handler}", d.Method);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Loc.SetupWithFallbacks(this.assembly);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -144,6 +144,16 @@ public class Localization : IServiceType
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Loc.Setup(this.ReadLocData(langCode), this.assembly);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.Error(ex, "Could not load loc {0}. Setting up fallbacks.", langCode);
|
||||||
|
this.SetupWithFallbacks();
|
||||||
|
}
|
||||||
|
|
||||||
this.DalamudLanguageCultureInfo = GetCultureInfoFromLangCode(langCode);
|
this.DalamudLanguageCultureInfo = GetCultureInfoFromLangCode(langCode);
|
||||||
foreach (var d in Delegate.EnumerateInvocationList(this.LocalizationChanged))
|
foreach (var d in Delegate.EnumerateInvocationList(this.LocalizationChanged))
|
||||||
{
|
{
|
||||||
|
|
@ -156,16 +166,6 @@ public class Localization : IServiceType
|
||||||
Log.Error(ex, "Exception during raise of {handler}", d.Method);
|
Log.Error(ex, "Exception during raise of {handler}", d.Method);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Loc.Setup(this.ReadLocData(langCode), this.assembly);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Log.Error(ex, "Could not load loc {0}. Setting up fallbacks.", langCode);
|
|
||||||
this.SetupWithFallbacks();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue