Skip to content

Changelog follow-ups for #331: translatable labels and working quarter links (part of TW-1786) - #346

Merged
zoltan-baba merged 2 commits into
changelog-segmented-filtersfrom
feat/changelog-translatable-labels
Oct 8, 2026
Merged

zoltan-baba merged 2 commits into
changelog-segmented-filtersfrom
feat/changelog-translatable-labels

Conversation

@ilanazholobovsky

Copy link
Copy Markdown
Collaborator

Base: changelog-segmented-filters (#331)

Why

#325 adds the Japanese locale. The new changelog components from #331 hard-code their UI text in English, so the Japanese changelog would show an English filter bar and date picker.

What

Every user-visible string in src/components/Changelog/index.tsx and src/components/Changelog/DateRangePicker.tsx now goes through translate() or <Translate>. English text is unchanged.

17 new ids:

  • changelog.filter.allAreas, changelog.filter.ariaLabel
  • changelog.badge.title ("Show only {area} entries")
  • changelog.area.ci, .build-cache, .release-management, .platform, .build-hub, .insights, .rde. These are product names, so each description says "keep in English". They're wrapped anyway so the decision lives in i18n, not in the code.
  • changelog.dateRange.allDates, .clear, .dialogAriaLabel, .previousMonth, .nextMonth, .monthAriaLabel, .yearAriaLabel

Month names, weekday names and the dates on the range button were built from hard-coded English arrays. They now use Intl.DateTimeFormat with the site's current locale, so Japanese gets 1月, 月, 9月06日 and so on with no strings to translate. In English, Intl produces the same text as before. I compared both for every date from 2024 to 2027, with and without the year.

How the Japanese strings arrive

In #325, translate-ja-docs.yml runs docusaurus write-translations --locale ja and then scripts/translate_ui_strings.py. That script translates any code.json entry that's still English, and leaves alone the entries listed under keep_english in localization/ja-ui-strings.yaml and terms in the do-not-translate glossary. All the area names except "Platform" are in keep_english. "Platform" is in the glossary.

Three things to know:

  • The workflow runs only when a PR changes docs/**/*.md(x), src/partials/**/*.mdx or docs/**/_category_.json. The UI-string step is also skipped unless something changed under docs/ or src/partials/. A src/**/*.tsx change like this one doesn't trigger it, and the workflow has no workflow_dispatch for a manual run. So after Add Japanese (ja) locale: translated docs, translation pipeline fixes, UI strings #325 and this PR are both on main, the new ids are picked up by the next PR that changes a doc page. Or someone runs the two commands locally and commits i18n/ja/code.json.
  • The whole workflow stays off until the ANTHROPIC_API_KEY secret is added.
  • The script doesn't send the description field to the model. The "keep in English" note is guidance for human translators. The script relies on its own keep_english list and glossary to keep product names in English.

Verified

  • npx tsc --noEmit passes.
  • npx docusaurus build --locale en succeeds. The built changelog page still shows "All areas", "All dates", "Filter by area" and "Show only Release Management entries".
  • In a scratch copy, npx docusaurus write-translations --locale ja extracts all 17 changelog.* ids into i18n/ja/code.json. That file isn't committed here.

Not verified

  • The Japanese build and how the page looks in Japanese. Japanese month and day labels are longer, so the picker layout may need a check.

Second commit: working quarter links (6bf08715)

Building #331 on its own shows broken-anchor warnings on 4 hub changelog pages (Build Hub, RDE, Insights, Release Management) for #2026-q1 and #2026-q2. Cause: the page's table of contents is built from the MDX and links to every quarter, but Quarter returned null when the area filter left it empty, so the heading the TOC links to wasn't there. Readers clicking those TOC entries landed nowhere.

Fix: the quarter heading always renders; when no entry matches the filters, a short translatable notice appears under it ("No updates match the current filters in this quarter."). Result: 0 quarter warnings in the English build, and every TOC link on all 5 checked hub pages has its heading (e.g. Insights: 3 headings, 3 TOC links, 2 notices). It also fixes the same dead-link effect when the date filter empties a quarter.

Decision for Zoli: this shows empty quarters with a notice instead of hiding them. If you'd rather keep hiding them, the alternative is filtering the TOC itself, which needs a swizzled TOC component — bigger change.

ilanazholobovsky and others added 2 commits October 7, 2026 15:49
Wrap the user-visible strings of the new Changelog and DateRangePicker
components in Docusaurus translate()/<Translate> under changelog.* ids,
so the Japanese locale can localize them. Area names are product names
and stay English per team policy; they are wrapped so the choice is
made in i18n, not in code. Month, weekday and range-date formatting now
uses Intl.DateTimeFormat with the current locale; English output is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T641RxhBBd3yTdKhMyorpq
The page TOC is built from the MDX at build time and links to every quarter,
but Quarter returned null when the area or date filter left it empty. On 4 hub
pages (Build Hub, RDE, Insights, Release Management) that broke the #2026-q1
and #2026-q2 TOC links and produced broken-anchor build warnings. The heading
now stays with a short, translatable notice; the build has 0 quarter warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T641RxhBBd3yTdKhMyorpq
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

@zoltan-baba
zoltan-baba merged commit 7a6fa18 into changelog-segmented-filters Oct 8, 2026
1 of 2 checks passed
@zoltan-baba
zoltan-baba deleted the feat/changelog-translatable-labels branch October 8, 2026 10:41
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.

2 participants