Imported Upstream version 6.6.0.89

Former-commit-id: b39a328747c2f3414dc52e009fb6f0aa80ca2492
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-09-24 08:53:40 +00:00
parent cf815e07e0
commit 95fdb59ea6
2556 changed files with 138145 additions and 47453 deletions

View File

@@ -186,7 +186,7 @@ namespace System.Globalization
// Abbreviated English Era Names are only used for the Japanese calendar.
if (!GlobalizationMode.Invariant && calendarId == (int)CalendarId.JAPAN)
{
this.saAbbrevEnglishEraNames = JapaneseCalendar.EnglishEraNames();
this.saAbbrevEnglishEraNames = GetJapaneseEnglishEraNames();
}
else
{
@@ -268,11 +268,7 @@ namespace System.Globalization
case CalendarId.JAPAN:
case CalendarId.JAPANESELUNISOLAR:
if (GlobalizationMode.Invariant)
{
throw new PlatformNotSupportedException();
}
this.saEraNames = JapaneseCalendar.EraNames();
this.saEraNames = GetJapaneseEraNames ();
break;
case CalendarId.PERSIAN:
@@ -289,6 +285,20 @@ namespace System.Globalization
}
}
private static string[] GetJapaneseEraNames()
{
if (GlobalizationMode.Invariant)
throw new PlatformNotSupportedException();
return JapaneseCalendar.EraNames();
}
private static string[] GetJapaneseEnglishEraNames()
{
if (GlobalizationMode.Invariant)
throw new PlatformNotSupportedException();
return JapaneseCalendar.EnglishEraNames();
}
private void InitializeAbbreviatedEraNames(string localeName, int calendarId)
{
// Note that the saAbbrevEraNames only include "AD" We don't have localized names for other calendars available from windows