Skip to content

Localize market dropdown current-site name to the viewing locale#1459

Merged
JesseWynants merged 1 commit into
mainfrom
fix/localize-market-dropdown-name
Jun 30, 2026
Merged

Localize market dropdown current-site name to the viewing locale#1459
JesseWynants merged 1 commit into
mainfrom
fix/localize-market-dropdown-name

Conversation

@JesseWynants

Copy link
Copy Markdown
Contributor

Follow-up to #1458.

Problem

In the market dropdown, the current market's label used newsroom.display_name — the default-locale newsroom name. So on the English version of a site it showed the default name (e.g. "België") instead of the translated one ("Belgium").

Fix

Use the current locale's company_information.name (the same per-locale newsroom name the header uses for the site title via language.company_information), falling back to display_name/name. This name also feeds the shared brand-prefix stripping, so the localized country label comes out clean (e.g. "Belgium" / "België").

const currentNewsroomName =
    languages.find((lang) => lang.code === localeCode)?.company_information.name ||
    newsroom.display_name ||
    newsroom.name;

Known limitation

Peer market names still use their default display_name — the hub member/sibling data (newsroomHub.list / newsroom.hub) doesn't carry per-locale names, so localizing peers would require a separate language fetch per peer. Out of scope here; happy to follow up if we want peers localized too.

Verification

  • tsc --noEmit passes.
  • Note: couldn't show a visual diff on the test hub since it only has one culture (English); the change mirrors the established Header.tsx pattern (information.name || newsroom.display_name).

The current market used newsroom.display_name (the default-locale name), so
the English site showed e.g. 'Belgie' instead of the translated 'Belgium'.
Use the current locale's company_information.name (same source as the header
site name), falling back to display_name. Peer market names still use their
default display_name (per-locale names aren't available in hub data).

@fgyimah fgyimah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏾

@JesseWynants JesseWynants self-assigned this Jun 30, 2026
@JesseWynants JesseWynants merged commit ef03a39 into main Jun 30, 2026
5 checks passed
@JesseWynants JesseWynants deleted the fix/localize-market-dropdown-name branch June 30, 2026 10:07
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