Skip to content

fix(cy): set abbreviated am/pm to yb/yh instead of inheriting from root#5839

Open
wildtangent wants to merge 1 commit into
unicode-org:mainfrom
wildtangent:fix/cy-abbreviated-dayperiod-am-pm
Open

fix(cy): set abbreviated am/pm to yb/yh instead of inheriting from root#5839
wildtangent wants to merge 1 commit into
unicode-org:mainfrom
wildtangent:fix/cy-abbreviated-dayperiod-am-pm

Conversation

@wildtangent

Copy link
Copy Markdown

Summary

Welsh users formatting 12-hour times (e.g. h:mm a) receive the English strings AM/PM instead of the Welsh abbreviated day-period forms yb (y bore) and yh (yr hwyr). This regressed between CLDR 47 and CLDR 48.

Root cause

In common/main/cy.xml the format/abbreviated am and pm entries were ↑↑↑ in both releases — the data itself did not change. Under ICU 77 (CLDR 47) this was masked by a lateral fallback that resolved ↑↑↑ at the abbreviated width to the locale's own wide entries (yb/yh). ICU 78 (CLDR 48) now resolves ↑↑↑ correctly against the parent locale (root), which has AM/PM, surfacing the gap.

The identifying commit is f81989f8b (CLDR-18850 v48 vxml merge to main), which is the Survey Tool merge that left format/abbreviated am/pm as ↑↑↑.

Changes

  • common/main/cy.xml — replace ↑↑↑ with yb/yh in both format/abbreviated and stand-alone/abbreviated contexts, consistent with the existing wide entries.
  • common/testData/datetime/datetime.json — add four test cases (hm/hms × AM/PM for locale cy) to prevent silent regression.

Reproduction (Node.js / Intl, which delegates to ICU)

// Pass: Node 24.13.0 / ICU 77.1 / CLDR 47
// Fail: Node 24.16.0 / ICU 78.3 / CLDR 48

const fmt = new Intl.DateTimeFormat('cy', {
  hour: 'numeric', minute: '2-digit', hour12: true, timeZone: 'UTC',
});

const parts = fmt.formatToParts(new Date('2024-07-01T09:30:00Z'));
const period = parts.find(p => p.type === 'dayPeriod')?.value;
// CLDR 47: "yb"  ✓
// CLDR 48: "AM"  ✗
console.log(period);

Diff

 <dayPeriodContext type="format">
   <dayPeriodWidth type="abbreviated">
     <dayPeriod type="midnight">canol nos</dayPeriod>
-    <dayPeriod type="am">↑↑↑</dayPeriod>
+    <dayPeriod type="am">yb</dayPeriod>
     <dayPeriod type="noon">canol dydd</dayPeriod>
-    <dayPeriod type="pm">↑↑↑</dayPeriod>
+    <dayPeriod type="pm">yh</dayPeriod>
     ...
   </dayPeriodWidth>

The format/abbreviated and stand-alone/abbreviated am and pm entries for
Welsh (cy) were ↑↑↑, causing ICU to inherit AM/PM from the root locale.

Under ICU 77 (CLDR 47) this was masked by a lateral fallback that
resolved ↑↑↑ at the abbreviated width to the locale's own wide entries
(yb/yh). ICU 78 (CLDR 48) now resolves ↑↑↑ correctly against the
parent locale, surfacing the gap.

Fix: replace ↑↑↑ with explicit Welsh values yb (y bore, AM) and yh
(yr hwyr, PM) in both format/abbreviated and stand-alone/abbreviated
contexts, consistent with the existing wide entries.

Also adds four datetime test cases (hm/hms × AM/PM) for locale cy to
prevent silent regression.

Identified via: commit f81989f (CLDR-18850 v48 vxml merge to main)
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@AEApple

AEApple commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Can you file a ticket? There was some mixed feedback about whether yb/yh are appropriate when we fixed the other locales in 48.2 as part of CLDR-19304 and we should ask the language specialists to review in the Survey Tool while it is currently open for CLDR 49.

We have guidance about requests for data changes in the contributing.md guidelines: https://github.com/unicode-org/cldr/blob/main/CONTRIBUTING.md#tips-for-contributing-to-cldr

If you have evidence of common usage for Welsh it would be really great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants