#17060·medusa

Use one source for country names: Regions list and details currently disagree

Author: claudecafeCreated Sep 28, 2026Updated Sep 28, 2026
Labelsgood first issuetype: bug

The problem

Changing a country's name in the database produces two different names in Medusa Admin:

Screen Name shown Where it comes from
Settings → Regions → Countries column Original name A hard-coded list in the frontend
Open a region → Countries table Updated name The API, backed by the database

Both screens receive country records from the API. The Regions list ignores the returned display_name and looks up a name in its own static list instead.

Could Admin use the database/API as the single source for country names? Would you welcome a PR to do this?

How to reproduce

Tested with Medusa and Dashboard 2.21.1, PostgreSQL, and the standard Admin.

  1. Create a region containing a country, such as tw.

  2. With the backend running, change its display name in a disposable local database:

    sql
    UPDATE region_country
    SET display_name = 'Country label test'
    WHERE iso_2 = 'tw';
  3. Refresh Settings → Regions. The Countries column still shows the original name.

  4. Open that region. Its Countries table shows Country label test.

The country code is just an example. The difference is in how the two screens read the name.

There is also a persistence issue: restarting the backend can reset the database name because the defaults loader upserts the bundled names again.

Proposed fix

  1. Use the name already returned by the API. The Regions list should render country.display_name, just like the detail page.
  2. Provide an API for the full country list. Country selectors need all countries, not only those assigned to a region. The database already contains that list—250 records in our local installation—but Admin currently uses frontend constants for these selectors.
  3. Preserve customized names on restart. Bundled defaults should initialize missing countries without silently replacing customized names. The policy for updating existing default names needs maintainer input.

Country codes would remain unchanged. This is about display names, not changing country identifiers or region membership.

Source-code references

  • List: packages/admin/dashboard/src/components/table/table-cells/region/countries-cell/countries-cell.tsx looks up the frontend constant:

    typescript
    COUNTRIES.find((c) => c.iso_2 === country.iso_2)?.display_name
  • Details: region-country-section.tsx passes API-provided region.countries to useCountries. use-country-table-columns.tsx then renders each record's display_name directly.

  • Selectors: the comment in use-countries.tsx says static country data is used because countries cannot be retrieved from an API.

  • Startup: packages/modules/region/src/loaders/defaults.ts upserts the bundled country names into the database.

Related: #16522 proposes localized country labels via Intl.DisplayNames. This issue asks which source Admin should use consistently, including when a persisted label has been customized.

Implementation prompt

If this direction is accepted, here is a suggested brief for a contributor or coding agent:

Make Medusa Admin read country names consistently from the Region database through APIs.

  1. Find the Admin components that display or select countries.
  2. Where a component already receives a country record, use its display_name instead of looking up a frontend constant.
  3. Add an authenticated, read-only Admin API for all countries, including unassigned ones. Follow existing API conventions and use it in full-country selectors.
  4. Apply the maintainer-approved startup policy: add missing countries while preserving customized names.
  5. Keep ISO codes and existing commerce behavior unchanged.
  6. Add regression coverage for matching list/detail names, selecting unassigned countries, and preserving customized names across startup.

Flag any remaining static-name consumers that need separate work.

Before I open a PR

  • Is there a reason the Regions list deliberately uses static names instead of the API's names?
  • Would you accept the database/API as the shared source?
  • Should I start with a small PR fixing list/detail consistency, then address the full-country API and startup behavior separately?

Happy to contribute once we agree on the direction and scope.