Skip to content

Commit

Permalink
Fix load resources for other languages, when not translated version e…
Browse files Browse the repository at this point in the history
…xists
  • Loading branch information
fattard committed Apr 3, 2024
1 parent 4ce986c commit 79fb0ef
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions EventFlagsChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,16 +250,14 @@ protected static string ReadResFile(string resName, string? langCode = null)
var offResPath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(assembly.Location)!, resFileName);
if (!System.IO.File.Exists(offResPath))
{
resFileName = assembly.GetManifestResourceNames().Single(str => str.EndsWith(resFileName));

try
{
resFileName = assembly.GetManifestResourceNames().Single(str => str.EndsWith(resFileName));
}
catch (InvalidOperationException)
{
// Load default language
return ReadResFile(resFileName, "en");
return ReadResFile(resName, "en");
}

using (var stream = assembly.GetManifestResourceStream(resFileName))
Expand Down

0 comments on commit 79fb0ef

Please sign in to comment.