Skip to content

Commit b319049

Browse files
chore(locale): document formatting as a non-goal, ignore the locale cache dir
The release ships no per-locale CLDR data (negotiation needs none) and runtime download is off, so any future Localize formatting call would raise LocaleNotFoundInCacheError for non-English locales. State that next to the config, and ignore /priv/localize/ so a manual `mix localize.download_locales` cannot leave committable blobs in priv. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent cdb7ac3 commit b319049

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ npm-debug.log
3434
# Ignore digested assets cache.
3535
/priv/static/cache_manifest.json
3636

37+
# CLDR locale data cache (mix localize.download_locales); the release
38+
# deliberately ships none — Localize is used for negotiation only.
39+
/priv/localize/
40+
3741
# Files matching config/*.secret.exs pattern contain sensitive
3842
# data and you should not commit them into version control.
3943
#

config/config.exs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ config :phoenix,
3030

3131
config :gettext, :default_locale, "en"
3232

33+
# Localize is used for UI-language negotiation only (translations come
34+
# from Gettext, dates from Timex). The release deliberately ships no
35+
# per-locale CLDR data — negotiation needs none — so Localize formatting
36+
# APIs (Number/DateTime/Unit) would raise LocaleNotFoundInCacheError for
37+
# any locale but "en". Keep formatting a non-goal, or wire
38+
# `mix localize.download_locales` into the build first.
39+
#
3340
# Static list so compile-time Localize calls see the same set as runtime.
3441
# Use CLDR IDs (hyphens, :"zh-Hans") — expanding Gettext names like
3542
# "zh_Hans" collapses to :zh via likely subtags and loses zh-Hant.

0 commit comments

Comments
 (0)