From ef5e5a59742129e7fc7bab0222b3a0503d0acf4b Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Sun, 3 Dec 2017 19:22:40 -0800 Subject: [PATCH] Try all English abbreviations Fixes #25 --- src/TimeZoneNames/TZNames.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/TimeZoneNames/TZNames.cs b/src/TimeZoneNames/TZNames.cs index c3b985c..1c5e37a 100644 --- a/src/TimeZoneNames/TZNames.cs +++ b/src/TimeZoneNames/TZNames.cs @@ -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; + } + } + } } }