Browse Source

Fix #2933 - look by .Name first, then fall back to ISO

pull/2936/head
Christoph Wille 2 years ago
parent
commit
facf2f662b
  1. 14
      ICSharpCode.Decompiler/Documentation/XmlDocLoader.cs

14
ICSharpCode.Decompiler/Documentation/XmlDocLoader.cs

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Runtime.CompilerServices;
@ -114,20 +115,27 @@ namespace ICSharpCode.Decompiler.Documentation @@ -114,20 +115,27 @@ namespace ICSharpCode.Decompiler.Documentation
return null;
string xmlFileName = Path.ChangeExtension(fileName, ".xml");
string currentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName;
string localizedXmlDocFile = GetLocalizedName(xmlFileName, currentCulture);
CultureInfo currentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture;
string localizedXmlDocFile = GetLocalizedName(xmlFileName, currentCulture.Name);
string localizedXmlDocFallbackFile = GetLocalizedName(xmlFileName, currentCulture.TwoLetterISOLanguageName);
Debug.WriteLine("Try find XMLDoc @" + localizedXmlDocFile);
if (File.Exists(localizedXmlDocFile))
{
return localizedXmlDocFile;
}
Debug.WriteLine("Try find XMLDoc @" + localizedXmlDocFallbackFile);
if (File.Exists(localizedXmlDocFallbackFile))
{
return localizedXmlDocFallbackFile;
}
Debug.WriteLine("Try find XMLDoc @" + xmlFileName);
if (File.Exists(xmlFileName))
{
return xmlFileName;
}
if (currentCulture != "en")
if (currentCulture.TwoLetterISOLanguageName != "en")
{
string englishXmlDocFile = GetLocalizedName(xmlFileName, "en");
Debug.WriteLine("Try find XMLDoc @" + englishXmlDocFile);

Loading…
Cancel
Save