Question for anyone who's used ex_cldr and/or gettext in #elixir - I'm trying to compile something in a memory constrained environment and the gettext back end has started finding 130 locales it wants to generate on every build. I think I've configured cldr to have only one allowed language, but the locales still get generated (and cause an out of memory error)
Discussion
@mavnn ex_cldr was recently re-implemented: https://elixirforum.com/t/localize-next-generation-localisation-ex-cldr-v3-0/73933 tried that one?
@[email protected] Oh thanks, I'll definitely keep an eye for the future. It looks like it won't support all the features from ex_cldr this project uses until at least its 0.3 release though, so I'd need to make much larger changes than I was hoping from the parent project to go that route at the moment.
Anyone know the next place to look for what might be requesting these, or force them to be generated in turn rather than (it appears) concurrently?
Context: I don't know elixir, but for reasons I'm running my own @[email protected] instance on bare metal and I'm happy to mess in source code if needed.
@[email protected] how did you try disabling locales?
@[email protected] In version 1.0.2-alpha.6 you should be able to set COMPILE_ALL_LOCALES=no in env
@[email protected] @[email protected] ah, good news. I've just deployed 1.0.1, where I tried setting the COMPILE_ALL_LOCALES but then spotted it was overridden by the :prod flag regardless. My last attempt was to directly edit config/bonfire_common.exs with static values:
--- a/config/bonfire_common.exs
+++ b/config/bonfire_common.exs
@@ -4,8 +4,8 @@ default_locale = "en"
## Localisation & internationalisation
# Only compile additional locales in prod or when explicitly requested
-compile_all_locales? =
- config_env() == :prod or System.get_env("COMPILE_ALL_LOCALES") in ["true", "1"]
+compile_all_locales? = false
+# config_env() == :prod or System.get_env("COMPILE_ALL_LOCALES") in ["true", "1"]
locales = if compile_all_locales?, do: [default_locale, "fr", "es", "it"], else: [default_locale]
@@ -18,7 +18,7 @@ config :bonfire_common,
config :bonfire_common, Bonfire.Common.Localise.Cldr,
default_locale: default_locale,
# locales that will be made available on top of those for which gettext localisation files are available
- locales: locales,
+ locales: [],
providers: [
Cldr.Language,
Cldr.DateTime,
@@ -33,10 +33,10 @@ config :bonfire_common, Bonfire.Common.Localise.Cldr,
gettext: Bonfire.Common.Localise.Gettext,
extra_gettext: [Timex.Gettext],
data_dir: "./priv/cldr",
- add_fallback_locales: compile_all_locales?,
+ add_fallback_locales: false,
# precompile_number_formats: ["¤¤#,##0.##"],
# precompile_transliterations: [{:latn, :arab}, {:thai, :latn}]
- force_locale_download: Mix.env() == :prod,
+ force_locale_download: false, # Mix.env() == :prod,
generate_docs: true