Skip to content

Commit

Permalink
Fix localization loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Manu098vm committed Jun 4, 2024
1 parent 3d3d374 commit 2e53e40
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion TeraFinder.Plugins/Utils/WinFormsTranslator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using PKHeX.Core;
using System.Reflection;

//Most of functions are taken from pkhex
//https://github.com/kwsch/PKHeX/blob/master/PKHeX.WinForms/Util/WinFormsTranslator.cs
Expand Down Expand Up @@ -103,7 +104,8 @@ private static ReadOnlySpan<string> GetTranslationFile(string lang)
}

var txt = Core.ResourcesUtil.GetTextResource(file);
return Util.GetStringList(file, txt);
return txt is not null ? (string[])typeof(Util).GetMethod("LoadStringList",
BindingFlags.NonPublic | BindingFlags.Static)!.Invoke(null, [file, txt ])! : [];
}

private static IEnumerable<object> GetTranslatableControls(Control f)
Expand Down

0 comments on commit 2e53e40

Please sign in to comment.