Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[browser] Fix: HybridGlobalization Invariant function differs from non-Hybrid #103037

Merged
merged 7 commits into from
Jun 26, 2024
Prev Previous commit
Next Next commit
Merge branch 'main' into fix-95471
  • Loading branch information
ilonatommy committed Jun 12, 2024
commit b9983bade2e3b0856b8e1229318af31e87e3043f
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public static IEnumerable<object[]> AMDesignator_Get_TestData_HybridGlobalizatio
yield return new object[] { "en-ZA", "am" };
yield return new object[] { "en-ZM", "am" };
yield return new object[] { "en-ZW", "am" };
string latinAmericaSpanishAMDesignator = (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "a.\u00A0m." : "a.m.";
string latinAmericaSpanishAMDesignator = PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "a.\u00A0m." : "a.m.";
yield return new object[] { "es-419", latinAmericaSpanishAMDesignator };
yield return new object[] { "es-ES", "a.\u00A0m." };
yield return new object[] { "es-MX", latinAmericaSpanishAMDesignator };
Expand Down Expand Up @@ -189,7 +189,7 @@ public static IEnumerable<object[]> AMDesignator_Get_TestData_HybridGlobalizatio
yield return new object[] { "sw-KE", "AM" };
yield return new object[] { "sw-TZ", "AM" };
yield return new object[] { "sw-UG", "AM" };
string tamilAMDesignator = (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "முற்பகல்" : "AM"; // முற்பகல்
string tamilAMDesignator = PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "முற்பகல்" : "AM"; // முற்பகல்
yield return new object[] { "ta-IN", tamilAMDesignator };
yield return new object[] { "ta-LK", tamilAMDesignator };
yield return new object[] { "ta-MY", tamilAMDesignator };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public static IEnumerable<object[]> AbbreviatedMonthGenitiveNames_Get_TestData_H
// see the comments on the right to check the non-Hybrid result, if it differs
yield return new object[] { "ar-SA", new string[] { "محرم", "صفر", "ربيع الأول", "ربيع الآخر", "جمادى الأولى", "جمادى الآخرة", "رجب", "شعبان", "رمضان", "شوال", "ذو القعدة", "ذو الحجة", "" } };
if (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS)
if (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS)
ilonatommy marked this conversation as resolved.
Show resolved Hide resolved
{
yield return new object[] { "am-ET", new string[] { "ጃንዩ", "ፌብሩ", "ማርች", "ኤፕሪ", "ሜይ", "ጁን", "ጁላይ", "ኦገስ", "ሴፕቴ", "ኦክቶ", "ኖቬም", "ዲሴም", "" } };
yield return new object[] { "es-MX", new string[] { "ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sept", "oct", "nov", "dic", "" } }; // "ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "sep.", "oct.", "nov.", "dic.", ""
Expand Down Expand Up @@ -200,7 +201,7 @@ public static IEnumerable<object[]> AbbreviatedMonthGenitiveNames_Get_TestData_H
yield return new object[] { "tr-CY", new string[] { "Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara", "" } };
yield return new object[] { "tr-TR", new string[] { "Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara", "" } };
yield return new object[] { "uk-UA", new string[] { "січ.", "лют.", "бер.", "квіт.", "трав.", "черв.", "лип.", "серп.", "вер.", "жовт.", "лист.", "груд.", "" } };
string vietnameseAbbrMonth = (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "Thg" : "Tháng"; // thg
string vietnameseAbbrMonth = PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "Thg" : "Tháng"; // thg
yield return new object[] { "vi-VN", new string[] { $"{vietnameseAbbrMonth} 1", $"{vietnameseAbbrMonth} 2", $"{vietnameseAbbrMonth} 3", $"{vietnameseAbbrMonth} 4", $"{vietnameseAbbrMonth} 5", $"{vietnameseAbbrMonth} 6", $"{vietnameseAbbrMonth} 7", $"{vietnameseAbbrMonth} 8", $"{vietnameseAbbrMonth} 9", $"{vietnameseAbbrMonth} 10", $"{vietnameseAbbrMonth} 11", $"{vietnameseAbbrMonth} 12", "" } };
yield return new object[] { "zh-CN", new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } };
yield return new object[] { "zh-Hans-HK", new string[] { "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月", "" } };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public static IEnumerable<object[]> FullDateTimePattern_Get_TestData_HybridGloba
{
yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, "dddd، d MMMM yyyy h:mm:ss tt" }; // dddd، d MMMM yyyy g h:mm:ss tt
yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, "yyyy MMMM d, dddd h:mm:ss tt" };
yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "dddd, d MMMM yyyy г. H:mm:ss ч." : "dddd, d MMMM yyyy г. H:mm:ss" }; // dddd, d MMMM yyyy 'г'. H:mm:ss
yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "dddd, d MMMM yyyy г. H:mm:ss ч." : "dddd, d MMMM yyyy г. H:mm:ss" }; // dddd, d MMMM yyyy 'г'. H:mm:ss
yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, "dddd, d MMMM, yyyy h:mm:ss tt" };
yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, "dddd, d MMMM, yyyy h:mm:ss tt" };
string catalanPattern = (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "dddd, d de MMMM de yyyy H:mm:ss" : "dddd, d de MMMM del yyyy H:mm:ss";
string catalanPattern = PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "dddd, d de MMMM de yyyy H:mm:ss" : "dddd, d de MMMM del yyyy H:mm:ss";
yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, catalanPattern }; // dddd, d MMMM 'de' yyyy H:mm:ss
yield return new object[] { new CultureInfo("ca-ES").DateTimeFormat, catalanPattern }; // dddd, d MMMM 'de' yyyy H:mm:ss
yield return new object[] { new CultureInfo("cs-CZ").DateTimeFormat, "dddd d. MMMM yyyy H:mm:ss" };
Expand All @@ -50,7 +50,7 @@ public static IEnumerable<object[]> FullDateTimePattern_Get_TestData_HybridGloba
yield return new object[] { new CultureInfo("en-AI").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" };
yield return new object[] { new CultureInfo("en-AS").DateTimeFormat, "dddd, MMMM d, yyyy h:mm:ss tt" };
yield return new object[] { new CultureInfo("en-AT").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" };
yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "dddd, d MMMM yyyy h:mm:ss tt" : "dddd d MMMM yyyy h:mm:ss tt" };
yield return new object[] { new CultureInfo("en-AU").DateTimeFormat, PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "dddd, d MMMM yyyy h:mm:ss tt" : "dddd d MMMM yyyy h:mm:ss tt" };
yield return new object[] { new CultureInfo("en-BB").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" };
yield return new object[] { new CultureInfo("en-BE").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" };
yield return new object[] { new CultureInfo("en-BI").DateTimeFormat, "dddd, MMMM d, yyyy HH:mm:ss" };
Expand All @@ -73,7 +73,7 @@ public static IEnumerable<object[]> FullDateTimePattern_Get_TestData_HybridGloba
yield return new object[] { new CultureInfo("en-FJ").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" };
yield return new object[] { new CultureInfo("en-FK").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" };
yield return new object[] { new CultureInfo("en-FM").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" };
yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "dddd, d MMMM yyyy HH:mm:ss" : "dddd d MMMM yyyy HH:mm:ss" };
yield return new object[] { new CultureInfo("en-GB").DateTimeFormat, PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "dddd, d MMMM yyyy HH:mm:ss" : "dddd d MMMM yyyy HH:mm:ss" };
yield return new object[] { new CultureInfo("en-GD").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" };
yield return new object[] { new CultureInfo("en-GG").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" };
yield return new object[] { new CultureInfo("en-GH").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" };
Expand All @@ -85,7 +85,7 @@ public static IEnumerable<object[]> FullDateTimePattern_Get_TestData_HybridGloba
yield return new object[] { new CultureInfo("en-IE").DateTimeFormat, "dddd d MMMM yyyy HH:mm:ss" };
yield return new object[] { new CultureInfo("en-IL").DateTimeFormat, "dddd, d MMMM yyyy H:mm:ss" };
yield return new object[] { new CultureInfo("en-IM").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" };
yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "dddd, d MMMM, yyyy h:mm:ss tt" : "dddd d MMMM, yyyy h:mm:ss tt" };
yield return new object[] { new CultureInfo("en-IN").DateTimeFormat, PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "dddd, d MMMM, yyyy h:mm:ss tt" : "dddd d MMMM, yyyy h:mm:ss tt" };
yield return new object[] { new CultureInfo("en-IO").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" };
yield return new object[] { new CultureInfo("en-JE").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" };
yield return new object[] { new CultureInfo("en-JM").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" };
Expand Down Expand Up @@ -147,7 +147,7 @@ public static IEnumerable<object[]> FullDateTimePattern_Get_TestData_HybridGloba
yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; // dddd, dd MMMM yyyy HH:mm:ss
yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, "dddd, d MMMM yyyy h:mm:ss tt" };
yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, "dddd, d MMMM yyyy HH:mm:ss" }; // dddd, dd MMMM yyyy HH:mm:ss
string latinAmericaSpanishFormat = (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "dddd, d de MMMM de yyyy HH:mm:ss" : "dddd, d de MMMM de yyyy h:mm:ss tt"; // dddd, d 'de' MMMM 'de' yyyy HH:mm:ss
string latinAmericaSpanishFormat = PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "dddd, d de MMMM de yyyy HH:mm:ss" : "dddd, d de MMMM de yyyy h:mm:ss tt"; // dddd, d 'de' MMMM 'de' yyyy HH:mm:ss
yield return new object[] { new CultureInfo("es-419").DateTimeFormat, latinAmericaSpanishFormat };
yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, "dddd, d de MMMM de yyyy H:mm:ss" }; // dddd, d 'de' MMMM 'de' yyyy H:mm:ss
yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, latinAmericaSpanishFormat };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public static IEnumerable<object[]> GetAbbreviatedEraName_TestData()
yield return new object[] { "tr-CY", 1, "MS" };
yield return new object[] { "tr-TR", 1, "MS" };
yield return new object[] { "uk-UA", 1, "н.е." };
yield return new object[] { "vi-VN", 1, (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "sau CN" : "CN" }; // sau CN
yield return new object[] { "vi-VN", 1, PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "sau CN" : "CN" }; // sau CN
yield return new object[] { "zh-CN", 1, "公元" };
yield return new object[] { "zh-Hans-HK", 1, "公元" };
yield return new object[] { "zh-SG", 1, "公元" };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ public static IEnumerable<object[]> GetEraName_TestData()
yield return new object[] { "tr-TR", 1, "MS" };
yield return new object[] { "uk-UA", 0, "н. е." };
yield return new object[] { "uk-UA", 1, "н. е." };
yield return new object[] { "vi-VN", 0, (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "CN" : "SCN" }; // sau CN
yield return new object[] { "vi-VN", 1, (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "CN" : "SCN" }; // sau CN
yield return new object[] { "vi-VN", 0, PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "CN" : "SCN" }; // sau CN
yield return new object[] { "vi-VN", 1, PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "CN" : "SCN" }; // sau CN
yield return new object[] { "zh-CN", 0, "公元" };
yield return new object[] { "zh-CN", 1, "公元" };
yield return new object[] { "zh-Hans-HK", 0, "公元" };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static IEnumerable<object[]> LongDatePattern_Get_TestData_HybridGlobaliza
yield return new object[] {"bg-BG", "dddd, d MMMM yyyy г." }; // "dddd, d MMMM yyyy 'г'."
yield return new object[] {"bn-BD", "dddd, d MMMM, yyyy" };
yield return new object[] {"bn-IN", "dddd, d MMMM, yyyy" };
string catalanianPattern = (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "dddd, d de MMMM de yyyy" : "dddd, d de MMMM del yyyy"; // "dddd, d MMMM 'de' yyyy"
string catalanianPattern = PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "dddd, d de MMMM de yyyy" : "dddd, d de MMMM del yyyy"; // "dddd, d MMMM 'de' yyyy"
yield return new object[] {"ca-AD", catalanianPattern };
yield return new object[] {"ca-ES", catalanianPattern };
yield return new object[] {"cs-CZ", "dddd d. MMMM yyyy" };
Expand All @@ -52,7 +52,7 @@ public static IEnumerable<object[]> LongDatePattern_Get_TestData_HybridGlobaliza
yield return new object[] {"en-AI", "dddd, d MMMM yyyy" };
yield return new object[] {"en-AS", "dddd, MMMM d, yyyy" };
yield return new object[] {"en-AT", "dddd, d MMMM yyyy" };
yield return new object[] {"en-AU", (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "dddd, d MMMM yyyy" : "dddd d MMMM yyyy" };
yield return new object[] {"en-AU", PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "dddd, d MMMM yyyy" : "dddd d MMMM yyyy" };
yield return new object[] {"en-BB", "dddd, d MMMM yyyy" };
yield return new object[] {"en-BE", "dddd, d MMMM yyyy" };
yield return new object[] {"en-BI", "dddd, MMMM d, yyyy" };
Expand All @@ -75,7 +75,7 @@ public static IEnumerable<object[]> LongDatePattern_Get_TestData_HybridGlobaliza
yield return new object[] {"en-FJ", "dddd, d MMMM yyyy" };
yield return new object[] {"en-FK", "dddd, d MMMM yyyy" };
yield return new object[] {"en-FM", "dddd, d MMMM yyyy" };
yield return new object[] {"en-GB", (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "dddd, d MMMM yyyy" :"dddd d MMMM yyyy" };
yield return new object[] {"en-GB", PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "dddd, d MMMM yyyy" :"dddd d MMMM yyyy" };
yield return new object[] {"en-GD", "dddd, d MMMM yyyy" };
yield return new object[] {"en-GG", "dddd, d MMMM yyyy" };
yield return new object[] {"en-GH", "dddd, d MMMM yyyy" };
Expand All @@ -87,7 +87,7 @@ public static IEnumerable<object[]> LongDatePattern_Get_TestData_HybridGlobaliza
yield return new object[] {"en-IE", "dddd d MMMM yyyy" };
yield return new object[] {"en-IL", "dddd, d MMMM yyyy" };
yield return new object[] {"en-IM", "dddd, d MMMM yyyy" };
yield return new object[] {"en-IN", (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "dddd, d MMMM, yyyy" : "dddd d MMMM, yyyy" }; // dddd, d MMMM, yyyy
yield return new object[] {"en-IN", PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "dddd, d MMMM, yyyy" : "dddd d MMMM, yyyy" }; // dddd, d MMMM, yyyy
yield return new object[] {"en-IO", "dddd, d MMMM yyyy" };
yield return new object[] {"en-JE", "dddd, d MMMM yyyy" };
yield return new object[] {"en-JM", "dddd, d MMMM yyyy" };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static IEnumerable<object[]> LongTimePattern_Get_TestData_HybridGlobaliza
// see the comments on the right to check the non-Hybrid result, if it differs
yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, "h:mm:ss tt" };
yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, "h:mm:ss tt" };
yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "H:mm:ss ч." : "H:mm:ss" }; // H:mm:ss ч.
yield return new object[] { new CultureInfo("bg-BG").DateTimeFormat, PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "H:mm:ss ч." : "H:mm:ss" }; // H:mm:ss ч.
yield return new object[] { new CultureInfo("bn-BD").DateTimeFormat, "h:mm:ss tt" };
yield return new object[] { new CultureInfo("bn-IN").DateTimeFormat, "h:mm:ss tt" };
yield return new object[] { new CultureInfo("ca-AD").DateTimeFormat, "H:mm:ss" };
Expand Down Expand Up @@ -137,7 +137,7 @@ public static IEnumerable<object[]> LongTimePattern_Get_TestData_HybridGlobaliza
yield return new object[] { new CultureInfo("en-ZA").DateTimeFormat, "HH:mm:ss" };
yield return new object[] { new CultureInfo("en-ZM").DateTimeFormat, "h:mm:ss tt" };
yield return new object[] { new CultureInfo("en-ZW").DateTimeFormat, "HH:mm:ss" };
string latinAmericaSpanishPattern = (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS) ? "HH:mm:ss" : "h:mm:ss tt"; // H:mm:ss
string latinAmericaSpanishPattern = PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS ? "HH:mm:ss" : "h:mm:ss tt"; // H:mm:ss
yield return new object[] { new CultureInfo("es-419").DateTimeFormat, latinAmericaSpanishPattern };
yield return new object[] { new CultureInfo("es-ES").DateTimeFormat, "H:mm:ss" };
yield return new object[] { new CultureInfo("es-MX").DateTimeFormat, latinAmericaSpanishPattern };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static IEnumerable<object[]> MonthGenitiveNames_Get_TestData()
{
// see the comments on the right to check the non-Hybrid result, if it differs
yield return new object[] { new CultureInfo("ar-SA").DateTimeFormat, new string[] { "محرم", "صفر", "ربيع الأول", "ربيع الآخر", "جمادى الأولى", "جمادى الآخرة", "رجب", "شعبان", "رمضان", "شوال", "ذو القعدة", "ذو الحجة", "" } };
if ((PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS))
if (PlatformDetection.IsFirefox || PlatformDetection.IsNodeJS)
{
yield return new object[] { new CultureInfo("am-ET").DateTimeFormat, new string[] { "ጃንዩወሪ", "ፌብሩወሪ", "ማርች", "ኤፕሪል", "ሜይ", "ጁን", "ጁላይ", "ኦገስት", "ሴፕቴምበር", "ኦክቶበር", "ኖቬምበር", "ዲሴምበር", "" } };
}
Expand Down
Loading
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.