Skip to content

Home-nation team names are not localized (England, Scotland, Wales, Northern Ireland) #32

Description

@kilgor-trout-c22

Problem

Since the flag/name resolution fix (branch fix/team-name-localization, commit 682765e), the four British home nations are correctly not mapped to GB anymore — England no longer shows as "United Kingdom" / "Vereinigtes Königreich" with the Union Jack. However, their team names now always display in the spelling stored by the data adapter (typically English):

Team German UI shows should be French UI shows should be
England England England ✓ England Angleterre
Scotland Scotland Schottland Scotland Écosse
Wales Wales Wales ✓ Wales Pays de Galles
Northern Ireland Northern Ireland Nordirland Northern Ireland Irlande du Nord

All other national teams localize automatically via TeamNameLocalizer::localize() → PHP intl (Locale::getDisplayRegion()).

Analysis: why ICU/CLDR can't cover this

The home nations have no ISO 3166-1 country code — they exist only as ISO 3166-2 subdivisions (GB-ENG, GB-SCT, GB-WLS, GB-NIR). The localization data exists upstream but is lost in the pipeline:

  1. CLDR does ship localized subdivision names (common/subdivisions/<lang>.xml: gbeng → "England"/"Angleterre"/…).
  2. ICU does not compile subdivisions/*.xml into its standard data. Verified empirically: the ICUDATA-region bundle contains only a Countries table; Countries->get('gbeng') returns NULL.
  3. PHP intl has no API for subdivision names anyway (Locale, ResourceBundle only reach ISO 3166-1 territories).

Naive attempts are worse than useless — ICU parses the subdivision part as a locale variant and silently returns the wrong answer:

Locale::getDisplayRegion('-GB-ENG', 'de')  // → "Vereinigtes Königreich" (!)

This is exactly the bug the original fix removed, so an ICU-based "solution" would silently reintroduce it.

Proposed resolutions

# Approach Effort Trade-offs
1 Module message catalog: route the 4 names through Yii::t('KickoffModule.base', …), add 4 keys to messages/{en,de,fr}/base.php ~30 lines Uses existing i18n infrastructure; translators maintain it like any other string; new UI languages fall back to English names (same as all module strings). A working implementation was prototyped and can be restored.
2 Bundle CLDR's subdivisions/*.xml (or a generated PHP extract) and resolve at runtime high Full language coverage, but heavy machinery and an update obligation for a closed set of 4 strings
3 Add symfony/intl or similar dependency medium Does not expose subdivision names either — dead end; also conflicts with the project's no-new-dependencies preference
4 Accept English names (status quo) none "England"/"Wales" are identical in German; only Scotland and Northern Ireland differ noticeably

Recommendation

Option 1 — the set is fixed and tiny (England won't be renamed), which is exactly what a static translation catalog is for. ICU's strength (dynamic coverage of all territories × all languages) doesn't apply to a closed set of four.

Context

  • Follow-up to the FIFA-code resolution fix on fix/team-name-localization (682765e)
  • Related: the bundled-Twemoji branch renders the ENG/SCO/WAL tag-sequence flags (fix/flag-emoji-fallback-chrome-issue)
  • Affected display locations: match cards, leaderboards, tip popups, admin Teams page — everything using Team::getDisplayName()

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions