Skip to content

Commit fafd881

Browse files
committed
all_locale_ids/1 returns the expanded list
1 parent 38a6b9e commit fafd881

5 files changed

Lines changed: 11 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.4.0] — April 13th, 2026
8+
9+
### Bug Fixes
10+
11+
* `Localize.all_locale_ids/1` (`:modern`, `:moderate`, `:basic`) now returns the correct expanded list of locales. Thanks to @cw789 for the report.
12+
713
## [0.3.0] — April 13th, 2026
814

915
### Bug Fixes
1016

11-
* Load custom units in a single batch to avoid churning ``:persistent_store``
17+
* Load custom units in a single batch to avoid churning `:persistent_store`
1218

1319
## [0.2.0] — April 13th, 2026
1420

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ config :localize,
130130
|--------|---------|-------------|
131131
| `:default_locale` | Derived from `LOCALIZE_DEFAULT_LOCALE` env var, then `LANG` env var, then `:en`. | The application-wide default locale. Can also be set at runtime with `Localize.put_default_locale/1`. |
132132
| `:supported_locales` | `nil` | A list of locale identifiers that your application supports. Each entry is an atom matching a known CLDR locale (e.g., `:en`, `:"fr-CA"`), a wildcard string (e.g., `"en-*"`), a coverage-level keyword (`:modern`, `:moderate`, `:basic`), or a Gettext-style string (e.g., `"pt_BR"`, `"zh_Hans"`). POSIX-style underscores are normalised to hyphens and entries are resolved to their CLDR canonical form via likely-subtag resolution (e.g. `"pt_BR"``:pt`). Only exact matches (score 0) are accepted — entries that cannot be resolved log a warning with `domain: :localize` and are skipped. When set, `validate_locale/1` resolves locale identifiers against this list rather than all ~766 CLDR locales. Accessible at runtime via `Localize.supported_locales/0`. |
133-
| `:preload_locales` | **deprecated** | Deprecated and ignored. Use `:supported_locales` to declare your locale set and `mix localize.download_locales` to pre-populate the cache at build time. |
134133
| `:locale_provider` | `Localize.Locale.Provider.PersistentTerm` | Module that implements the `Localize.Locale.Provider` behaviour for loading and caching per-locale data. |
135134
| `:locale_cache_max_entries` | `1_000` | Maximum number of validated locales to hold in the ETS cache. A background sweeper runs every 10 seconds and evicts excess entries to prevent unbounded growth. |
136135
| `:format_cache_max_entries` | `2_000` | Maximum number of compiled format patterns (number and date/time) to hold in the ETS cache. A background sweeper runs every 10 seconds and evicts excess entries to prevent unbounded growth. |

data/supplemental.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,9 +744,11 @@ defmodule Localize.Data.Supplemental do
744744
745745
"""
746746
def generate_coverage_levels do
747+
# CLDR provides effectiveCoverageLevels which includes regional
748+
# variants pre-expanded via the locale inheritance chain.
747749
raw =
748750
Localize.Data.read_json("coverageLevels.json")
749-
|> Map.fetch!("coverageLevels")
751+
|> Map.fetch!("effectiveCoverageLevels")
750752

751753
grouped =
752754
Enum.group_by(raw, fn {_locale, level} -> level end, fn {locale, _level} -> locale end)

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Localize.MixProject do
22
use Mix.Project
33

4-
@version "0.3.0"
4+
@version "0.4.0"
55
@cldr_version_path "priv/localize/version"
66
@localize_patch_version_path "priv/localize/localize_patch_version"
77

-19 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)