mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-17 13:27:43 +01:00
Update Settings Window (#2400)
* Load new localization before firing change event * Update texts in SettingsWindow when locale changes * Localize settings search * Update settings search input - Disable when Credits are scrolling, so Search Results aren't shown instead - Select all on single click, as usual for a search bar * Remove unused IsVisible property * Fix General tab being unselected on language change * Fix search results throwing, oops * Missed using LocRef in EnumSettingsEntry * Set CultureInfo before loading locs * Change it to LazyLoc instead So CheapLoc can export localizations...
This commit is contained in:
parent
efaff769b5
commit
d61a35b81f
20 changed files with 341 additions and 283 deletions
|
|
@ -112,11 +112,14 @@ public class Localization : IServiceType
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set up the UI language with "fallbacks"(original English text).
|
||||
/// Set up the UI language with "fallbacks" (original English text).
|
||||
/// </summary>
|
||||
public void SetupWithFallbacks()
|
||||
{
|
||||
this.DalamudLanguageCultureInfo = CultureInfo.InvariantCulture;
|
||||
|
||||
Loc.SetupWithFallbacks(this.assembly);
|
||||
|
||||
foreach (var d in Delegate.EnumerateInvocationList(this.LocalizationChanged))
|
||||
{
|
||||
try
|
||||
|
|
@ -128,8 +131,6 @@ public class Localization : IServiceType
|
|||
Log.Error(ex, "Exception during raise of {handler}", d.Method);
|
||||
}
|
||||
}
|
||||
|
||||
Loc.SetupWithFallbacks(this.assembly);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -145,6 +146,17 @@ public class Localization : IServiceType
|
|||
}
|
||||
|
||||
this.DalamudLanguageCultureInfo = GetCultureInfoFromLangCode(langCode);
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
foreach (var d in Delegate.EnumerateInvocationList(this.LocalizationChanged))
|
||||
{
|
||||
try
|
||||
|
|
@ -156,16 +168,6 @@ public class Localization : IServiceType
|
|||
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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue