Skip to content

Commit

Permalink
Try all English abbreviations
Browse files Browse the repository at this point in the history
Fixes #25
  • Loading branch information
mattjohnsonpint committed Dec 4, 2017
1 parent 4247230 commit ef5e5a5
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/TimeZoneNames/TZNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,23 @@ private static TimeZoneValues GetNames(string timeZoneId, string languageKey, bo
if (values.Generic == null || values.Standard == null || values.Daylight == null)
{
b = PopulateDirectValues("en_" + country.ToLowerInvariant(), values, timeZoneId, metaZone, true);
if (b) found = true;
if (b)
{
found = true;
}
else
{
// really, try any variant of english
foreach (var english in Data.CldrLanguageData.Keys.Where(x => x.StartsWith("en_")))
{
b = PopulateDirectValues(english, values, timeZoneId, metaZone, true);
if (b)
{
found = true;
break;
}
}
}
}
}

Expand Down

0 comments on commit ef5e5a5

Please sign in to comment.