Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Oct 4, 2023
1 parent 2667580 commit ed6d0ec
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions JL.Core/Dicts/EDICT/JMdict/JmdictLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,23 +278,22 @@ private static Sense ReadSense(XmlTextReader xmlReader)

if (lang is not null)
{
try
if (s_canHandleCulture)
{
if (s_canHandleCulture)
if (Utils.s_iso6392BTo2T.TryGetValue(lang, out string? langCode))
{
if (Utils.s_iso6392BTo2T.TryGetValue(lang, out string? langCode))
{
lang = langCode;
}
lang = langCode;
}

try
{
lang = CultureInfo.GetCultureInfo(lang).EnglishName;
}
}

catch (Exception ex)
{
Utils.Logger.Error(ex, "Underlying OS cannot process the culture info");
s_canHandleCulture = false;
catch (Exception ex)
{
Utils.Logger.Error(ex, "Underlying OS cannot process the culture info");
s_canHandleCulture = false;
}
}
}

Expand Down

0 comments on commit ed6d0ec

Please sign in to comment.