Skip to content

Fix Catalan names of Spain's provinces - #651

Merged
rochlefebvre merged 2 commits into
mainfrom
roch/ca-spain-province-names
Oct 20, 2026
Merged

rochlefebvre merged 2 commits into
mainfrom
roch/ca-spain-province-names

Conversation

@rochlefebvre

Copy link
Copy Markdown
Contributor

What are you trying to accomplish?

In Catalan (ca), the names of Spain's provinces come straight from CLDR. Three problems make them look broken in a province picker:

  • Most names carry a "província de" prefix, which isn't needed to tell them apart.
  • The prefix is capitalized inconsistently ("província de Burgos" vs. "Província de Badajoz").
  • Three provinces show the ² marker CLDR uses for duplicate names: Illes Balears², Navarra², Cantàbria².

Upstream CLDR still has these names: every Catalan subdivision name is marked draft="provisional", so updating CLDR won't fix it.

What approach did you choose and why?

I added a patch_subdivisions(:ca, ...) block to rake/cldr/patch.rb, the same way we already patch Spanish names (see CLDR-14034) and Portuguese ² names. It rewrites the same 46 province codes as the Spanish patch to their plain names, e.g. província d’Alacant → Alacant, Illes Balears² → Illes Balears.

data/cldr/locales/ca/subdivisions.yml was regenerated by running the new block through the existing patch_subdivisions helper. The helper checks each expected existing value, so every "before" string in the patch matches the data exactly. Only those 46 lines changed.

What should reviewers focus on?

  • esc becomes La Corunya. Standard Catalan lowercases the article inside a sentence ("la Corunya"). I capitalized it because it stands alone in a list, matching La Coruña in the Spanish patch.
  • The same scope as the Spanish patch: autonomous communities (e.g. esri, La Rioja²) are left alone because they aren't zones of Spain in data/regions/ES.yml.

The impact of these changes

Only Region#full_name(locale: :ca) changes, and only for Spain's provinces. No other locales or countries are affected.

Testing

I added a test that checks no Catalan name for a Spanish zone contains "província" or ². The test fails without the data change.

To try it out:

# bin/console
I18n.available_locales = [:en, :es, :ca]
Worldwide::Config.configure_i18n
Worldwide.region(code: "ES").zones.map { |z| z.full_name(locale: :ca) }

Checklist

  • I have added a CHANGELOG entry for this change (or determined that it isn't needed)

🤖 Generated with Claude Code

rochlefebvre and others added 2 commits October 20, 2026 09:37
CLDR's Catalan names for Spanish provinces mix "província de" and
"Província de", and use ² markers to tell provinces apart from
autonomous communities with the same name (e.g. "Illes Balears²").
Patch them to plain names, as we already do for Spanish.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@rochlefebvre
rochlefebvre marked this pull request as ready for review October 20, 2026 14:12
@rochlefebvre
rochlefebvre requested a review from a team as a code owner October 20, 2026 14:12
@rochlefebvre
rochlefebvre merged commit cca6492 into main Oct 20, 2026
6 checks passed
@rochlefebvre
rochlefebvre deleted the roch/ca-spain-province-names branch October 20, 2026 18:44
@rochlefebvre rochlefebvre mentioned this pull request Oct 22, 2026
1 task done

This branch was successfully deployed

1 active deployment
rubygems — 6bae8f78 Deployed Oct 22, 2026 by shopify-shipit[bot]
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