Skip to content

Commit 3df5cda

Browse files
committed
Invert the primary_zones map
1 parent 5b56fa1 commit 3df5cda

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

lib/cldr/config/config.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,15 +1611,15 @@ defmodule Cldr.Config do
16111611
end
16121612

16131613
@doc """
1614-
Return the primary zones for a territories.
1614+
Return the primary zones for territories.
16151615
16161616
"""
16171617
@primary_zone_file "primary_zones.json"
16181618
def primary_zones do
16191619
Path.join(cldr_data_dir(), @primary_zone_file)
16201620
|> File.read!()
16211621
|> json_library().decode!()
1622-
|> Cldr.Map.atomize_keys()
1622+
|> Cldr.Map.atomize_values()
16231623
end
16241624

16251625
@doc """

lib/cldr/timezone.ex

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ defmodule Cldr.Timezone do
6666
Returns a mapping of territories to
6767
their known IANA timezone names.
6868
69-
The results are estimates, not definitive. While
70-
the short zone names often start with an ISO 3166-2
71-
territory code, this is not guaranteed. And the
72-
code is not guaranteed to be specific to that
73-
territory.
74-
7569
"""
7670
@dialyzer {:nowarn_function, timezones_by_territory: 0}
7771
def timezones_by_territory do

mix/support/consolidate.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,8 @@ defmodule Cldr.Consolidate do
604604
primary_zone_data
605605
|> get_in(["supplemental", "primaryZones"])
606606
|> Cldr.Map.atomize_keys()
607+
|> Enum.map(fn {k, v} -> {v, k} end)
608+
|> Map.new()
607609
|> save_file(primary_zones_path)
608610

609611
assert_package_file_configured!(primary_zones_path)

priv/cldr/primary_zones.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"MH":"Pacific/Majuro","NZ":"Pacific/Auckland","CL":"America/Santiago","DE":"Europe/Berlin","ES":"Europe/Madrid","MY":"Asia/Kuala_Lumpur","PT":"Europe/Lisbon","CN":"Asia/Shanghai","EC":"America/Guayaquil","UA":"Europe/Kiev","UZ":"Asia/Tashkent"}
1+
{"America/Guayaquil":"EC","America/Santiago":"CL","Asia/Kuala_Lumpur":"MY","Asia/Shanghai":"CN","Asia/Tashkent":"UZ","Europe/Berlin":"DE","Europe/Kiev":"UA","Europe/Lisbon":"PT","Europe/Madrid":"ES","Pacific/Auckland":"NZ","Pacific/Majuro":"MH"}

0 commit comments

Comments
 (0)