Skip to content

Keep IANA identifiers in the es and es-MX time_zone lists - #3343

Open
yu2971512385-ui wants to merge 1 commit into
faker-ruby:mainfrom
yu2971512385-ui:fix/current-iana-timezone-names
Open

yu2971512385-ui wants to merge 1 commit into
faker-ruby:mainfrom
yu2971512385-ui:fix/current-iana-timezone-names

Conversation

@yu2971512385-ui

Copy link
Copy Markdown
Contributor

What

Two things in the locale time_zone lists, both about identifiers rather than translations.

1. The Spanish locales translated the identifiers

es.yml and es-MX.yml translated the timezone identifiers themselves — continent prefixes and city names — so Faker::Address.time_zone returns strings no timezone library can resolve:

es      Europa/London   Europa/Madrid   Pacífico/Midway
es-MX   África/Nairobi  América/Nueva_York   Asia/Tokio   Asia/Daca

Drawing 400 values per locale and resolving each through TZInfo::Timezone.get:

locale distinct unparseable
en 117 0
sk 114 0
es 121 44
es-MX 117 95

sk.yml settles what the convention is. It is a translated locale too, and its time_zone list is byte for byte the English one — the identifiers were left alone. Every valid entry in es and es-MX was already present in that list (0 of them unique), so both now carry it and nothing is lost.

2. Three identifiers IANA has superseded

Updated in all four locales:

was now
Europe/Kiev Europe/Kyiv
America/Godthab America/Nuuk
Asia/Rangoon Asia/Yangon

Asia/Kolkata and Asia/Kathmandu were already current, so these lists had been refreshed before and these three were missed.

After

en 118 distinct, 0 unparseable
sk 119 distinct, 0 unparseable
es 120 distinct, 0 unparseable
es-MX 118 distinct, 0 unparseable

All four locale files parse as YAML, and address.time_zone holds the same 143 entries in each, Pacific/Midway through Pacific/Apia.

Left alone

de.yml has four entries that are display names — MEZ, Central European Time — not identifiers. That is a different question from this one, so I have not touched it.

A note on running the tests

I could not get the suite to execute locally: test_helper.rb requires both minitest/autorun and test/unit, and on Ruby 4.0.7 the latter takes over the runner, so every file reports 0 runs, 0 assertions. That happens on a clean checkout before my change too, so it looks like a Ruby-version thing rather than anything here — but it does mean the numbers above come from exercising Faker::Address.time_zone directly against TZInfo, not from the suite.

🤖 Generated with Claude Code

The Spanish locales translated the timezone identifiers themselves, so
Faker::Address.time_zone hands back strings no timezone library can parse:

  es      Europa/London, Europa/Madrid, Pacifico/Midway
  es-MX   Africa/Nairobi, America/Nueva_York, Asia/Tokio

Drawing 400 values per locale and resolving each through TZInfo:

  en     117 distinct,   0 unparseable
  sk     114 distinct,   0 unparseable
  es     121 distinct,  44 unparseable
  es-MX  117 distinct,  95 unparseable

sk.yml settles what the convention is. It is a translated locale too, and
its time_zone list is byte for byte the English one, identifiers untouched.
Every valid entry in es and es-MX was already in that list, so both now
carry it and nothing is lost.

Separately, three identifiers were superseded by IANA and are updated in all
four locales: Europe/Kiev to Europe/Kyiv, America/Godthab to America/Nuuk,
Asia/Rangoon to Asia/Yangon. Asia/Kolkata and Asia/Kathmandu were already
current, so the lists had been refreshed before and these were missed.

After the change all four resolve cleanly:

  en 118, sk 119, es 120, es-MX 118 distinct, 0 unparseable each

de.yml is left alone: its four entries are display names such as "MEZ" and
"Central European Time", not identifiers, which is a different question.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant