1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:47:45 +00:00

LibLocale+LibJS: Update to CLDR version 42.0.0

There were some notable changes to the CLDR JSON format and data in this
release.

The patterns for a date at a specific time, i.e. "{date} at {time}", now
appear under the "atTime" attribute of the "dateTimeFormats" object.

Locale specific changes that affected test-js:

All locales:

* In many patterns, the code points U+00A0 (NO-BREAK SPACE) and U+202F
  (NARROW NO-BREAK SPACE) are now used in place of an ASCII space. For
  example, before the "dayPeriod" fields AM and PM.

* Separators such as U+2013 (EN DASH) are now surrounded by U+2009 (THIN
  SPACE) in place of an ASCII space character.

Locale "en":

* Narrow localizations of time formats are even more narrow. For
  example, the abbreviation "wk." for "week" is now just "wk".

Locale "ar":

* The code point U+060C (ARABIC COMMA) is now used in place of an ASCII
  comma.

* The code point U+200F (RIGHT-TO-LEFT MARK) now appears at the
  beginning of many localizations.

* When the "latn" numbering system is used for currency formatting, the
  currency symbol more consistently is placed at the end of the pattern.

Locale "he":

* The "many" plural rules category has been removed.

Locales "zh" and "es-419":

* Several display-name localizations were changed.
This commit is contained in:
Timothy Flynn 2022-10-19 15:34:17 -04:00 committed by Linus Groh
parent b87398341b
commit b077fccd3d
14 changed files with 277 additions and 225 deletions

View file

@ -31,11 +31,11 @@ describe("correct behavior", () => {
const d1 = new Date(Date.UTC(1989, 0, 23, 7, 8, 9, 45));
test("defaults to date and time", () => {
expect(d0.toLocaleString("en", { timeZone: "UTC" })).toBe("12/7/2021, 5:40:50 PM");
expect(d1.toLocaleString("en", { timeZone: "UTC" })).toBe("1/23/1989, 7:08:09 AM");
expect(d0.toLocaleString("en", { timeZone: "UTC" })).toBe("12/7/2021, 5:40:50\u202fPM");
expect(d1.toLocaleString("en", { timeZone: "UTC" })).toBe("1/23/1989, 7:08:09\u202fAM");
expect(d0.toLocaleString("ar", { timeZone: "UTC" })).toBe("٧/١٢‏/٢٠٢١, ٥:٤٠:٥٠ م");
expect(d1.toLocaleString("ar", { timeZone: "UTC" })).toBe("٢٣‏/١/١٩٨٩, ٧:٠٨:٠٩ ص");
expect(d0.toLocaleString("ar", { timeZone: "UTC" })).toBe("٧/١٢‏/٢٠٢١، ٥:٤٠:٥٠ م");
expect(d1.toLocaleString("ar", { timeZone: "UTC" })).toBe("٢٣‏/١/١٩٨٩، ٧:٠٨:٠٩ ص");
});
test("dateStyle may be set", () => {
@ -51,8 +51,12 @@ describe("correct behavior", () => {
});
test("timeStyle may be set", () => {
expect(d0.toLocaleString("en", { timeStyle: "short", timeZone: "UTC" })).toBe("5:40 PM");
expect(d1.toLocaleString("en", { timeStyle: "short", timeZone: "UTC" })).toBe("7:08 AM");
expect(d0.toLocaleString("en", { timeStyle: "short", timeZone: "UTC" })).toBe(
"5:40\u202fPM"
);
expect(d1.toLocaleString("en", { timeStyle: "short", timeZone: "UTC" })).toBe(
"7:08\u202fAM"
);
expect(d0.toLocaleString("ar", { timeStyle: "short", timeZone: "UTC" })).toBe("٥:٤٠ م");
expect(d1.toLocaleString("ar", { timeStyle: "short", timeZone: "UTC" })).toBe("٧:٠٨ ص");

View file

@ -37,8 +37,8 @@ describe("correct behavior", () => {
const d1 = new Date(Date.UTC(1989, 0, 23, 7, 8, 9, 45));
test("defaults to time", () => {
expect(d0.toLocaleTimeString("en", { timeZone: "UTC" })).toBe("5:40:50 PM");
expect(d1.toLocaleTimeString("en", { timeZone: "UTC" })).toBe("7:08:09 AM");
expect(d0.toLocaleTimeString("en", { timeZone: "UTC" })).toBe("5:40:50\u202fPM");
expect(d1.toLocaleTimeString("en", { timeZone: "UTC" })).toBe("7:08:09\u202fAM");
expect(d0.toLocaleTimeString("ar", { timeZone: "UTC" })).toBe("٥:٤٠:٥٠ م");
expect(d1.toLocaleTimeString("ar", { timeZone: "UTC" })).toBe("٧:٠٨:٠٩ ص");
@ -46,10 +46,10 @@ describe("correct behavior", () => {
test("timeStyle may be set", () => {
expect(d0.toLocaleTimeString("en", { timeStyle: "long", timeZone: "UTC" })).toBe(
"5:40:50 PM UTC"
"5:40:50\u202fPM UTC"
);
expect(d1.toLocaleTimeString("en", { timeStyle: "long", timeZone: "UTC" })).toBe(
"7:08:09 AM UTC"
"7:08:09\u202fAM UTC"
);
expect(d0.toLocaleTimeString("ar", { timeStyle: "long", timeZone: "UTC" })).toBe(