Fix fallback from unlocalized language file to default language

This commit is contained in:
Evan Dixon 2017-11-01 21:44:35 -05:00
parent 81e87c1a15
commit 133a19a468

View file

@ -122,6 +122,11 @@ namespace PKHeX.Core
var resourceName = manifestResourceNames var resourceName = manifestResourceNames
.Where(x => x.StartsWith("PKHeX.Core.Resources.text.") && x.EndsWith(name + ".txt", StringComparison.OrdinalIgnoreCase)) .Where(x => x.StartsWith("PKHeX.Core.Resources.text.") && x.EndsWith(name + ".txt", StringComparison.OrdinalIgnoreCase))
.FirstOrDefault(); .FirstOrDefault();
if (resourceName == null) {
return null;
}
using (var resource = thisAssembly.GetManifestResourceStream(resourceName)) using (var resource = thisAssembly.GetManifestResourceStream(resourceName))
using (var reader = new StreamReader(resource)) using (var reader = new StreamReader(resource))
{ {