private static string[] GetJapaneseEraNames() { if (GlobalizationMode.Invariant) { throw new PlatformNotSupportedException(); } return(JapaneseCalendar.EraNames()); }
private void InitializeEraNames(string localeName, CalendarId calendarId) { // Note that the saEraNames only include "A.D." We don't have localized names for other calendars available from windows switch (calendarId) { // For Localized Gregorian we really expect the data from the OS. case CalendarId.GREGORIAN: // Fallback for CoreCLR < Win7 or culture.dll missing if (this.saEraNames == null || this.saEraNames.Length == 0 || string.IsNullOrEmpty(this.saEraNames[0])) { this.saEraNames = new string[] { "A.D." }; } break; // The rest of the calendars have constant data, so we'll just use that case CalendarId.GREGORIAN_US: case CalendarId.JULIAN: this.saEraNames = new string[] { "A.D." }; break; case CalendarId.HEBREW: this.saEraNames = new string[] { "C.E." }; break; case CalendarId.HIJRI: case CalendarId.UMALQURA: if (localeName == "dv-MV") { // Special case for Divehi this.saEraNames = new string[] { "\x0780\x07a8\x0796\x07b0\x0783\x07a9" }; } else { this.saEraNames = new string[] { "\x0628\x0639\x062F \x0627\x0644\x0647\x062C\x0631\x0629" }; } break; case CalendarId.GREGORIAN_ARABIC: case CalendarId.GREGORIAN_XLIT_ENGLISH: case CalendarId.GREGORIAN_XLIT_FRENCH: // These are all the same: this.saEraNames = new string[] { "\x0645" }; break; case CalendarId.GREGORIAN_ME_FRENCH: this.saEraNames = new string[] { "ap. J.-C." }; break; case CalendarId.TAIWAN: if (SystemSupportsTaiwaneseCalendar()) { this.saEraNames = new string[] { "\x4e2d\x83ef\x6c11\x570b" }; } else { this.saEraNames = new string[] { string.Empty }; } break; case CalendarId.KOREA: this.saEraNames = new string[] { "\xb2e8\xae30" }; break; case CalendarId.THAI: this.saEraNames = new string[] { "\x0e1e\x002e\x0e28\x002e" }; break; case CalendarId.JAPAN: case CalendarId.JAPANESELUNISOLAR: this.saEraNames = JapaneseCalendar.EraNames(); break; case CalendarId.PERSIAN: if (this.saEraNames == null || this.saEraNames.Length == 0 || string.IsNullOrEmpty(this.saEraNames[0])) { this.saEraNames = new string[] { "\x0647\x002e\x0634" }; } break; default: // Most calendars are just "A.D." this.saEraNames = Invariant.saEraNames; break; } }
private void InitializeEraNames(string localeName, int calendarId) { switch ((ushort)calendarId) { case 1: if (this.saEraNames != null && this.saEraNames.Length != 0 && !string.IsNullOrEmpty(this.saEraNames[0])) { break; } this.saEraNames = new string[1] { "A.D." }; break; case 2: case 13: this.saEraNames = new string[1] { "A.D." }; break; case 3: case 14: this.saEraNames = JapaneseCalendar.EraNames(); break; case 4: if (CultureInfo.IsTaiwanSku) { this.saEraNames = new string[1] { "中華民國" }; break; } this.saEraNames = new string[1] { string.Empty }; break; case 5: this.saEraNames = new string[1] { "단기" }; break; case 6: case 23: if (localeName == "dv-MV") { this.saEraNames = new string[1] { "ހިޖްރީ" }; break; } this.saEraNames = new string[1] { "بعد الهجرة" }; break; case 7: this.saEraNames = new string[1] { "พ.ศ." }; break; case 8: this.saEraNames = new string[1] { "C.E." }; break; case 9: this.saEraNames = new string[1] { "ap. J.-C." }; break; case 10: case 11: case 12: this.saEraNames = new string[1] { "م" }; break; case 22: if (this.saEraNames != null && this.saEraNames.Length != 0 && !string.IsNullOrEmpty(this.saEraNames[0])) { break; } this.saEraNames = new string[1] { "ه.ش" }; break; default: this.saEraNames = CalendarData.Invariant.saEraNames; break; } }
private void InitializeEraNames(string localeName, int calendarId) { switch (((CalendarId)((ushort)calendarId))) { case CalendarId.GREGORIAN: if (((this.saEraNames == null) || (this.saEraNames.Length == 0)) || string.IsNullOrEmpty(this.saEraNames[0])) { this.saEraNames = new string[] { "A.D." }; } return; case CalendarId.GREGORIAN_US: case CalendarId.JULIAN: this.saEraNames = new string[] { "A.D." }; return; case CalendarId.JAPAN: case CalendarId.JAPANESELUNISOLAR: this.saEraNames = JapaneseCalendar.EraNames(); return; case CalendarId.TAIWAN: if (!CultureInfo.IsTaiwanSku) { this.saEraNames = new string[] { string.Empty }; return; } this.saEraNames = new string[] { "中華民國" }; return; case CalendarId.KOREA: this.saEraNames = new string[] { "단기" }; return; case CalendarId.HIJRI: case CalendarId.UMALQURA: if (!(localeName == "dv-MV")) { this.saEraNames = new string[] { "بعد الهجرة" }; return; } this.saEraNames = new string[] { "ހިޖްރީ" }; return; case CalendarId.THAI: this.saEraNames = new string[] { "พ.ศ." }; return; case CalendarId.HEBREW: this.saEraNames = new string[] { "C.E." }; return; case CalendarId.GREGORIAN_ME_FRENCH: this.saEraNames = new string[] { "ap. J.-C." }; return; case CalendarId.GREGORIAN_ARABIC: case CalendarId.GREGORIAN_XLIT_ENGLISH: case CalendarId.GREGORIAN_XLIT_FRENCH: this.saEraNames = new string[] { "م" }; return; } this.saEraNames = Invariant.saEraNames; }