You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The runtime data_dir option resolves to _build/dev/lib/my_app/priv/cldr (and _build/dev/lib/my_app/priv is linked to priv at the project level, which is under source control). But I understand from your example, that it should point to the ex_cldr lib folder, not the my_app subfolder.
I think I’ve figured it out: a month ago I refactored our Cldr setup, and added the :otp_app config option to the Cldr backend. At the time I didn’t read the documentation well enough to anticipate that this also had an effect on the data_dir. So before that change, the data_dir resolved to the priv_dir of :ex_cldr, which is ultimately under the deps folder (not versioned by git). Once I configured the :otp_app config key, the data_dir resolved to the priv_dir of our app (which is under revision control).
What made this a difficult debug session was the fact that introducing the :otp_app config key didn’t immediately resulted in the behaviour as described, for the locale json files. There is a path in the code that falls back to the cldr_data_dir (which was the previous location). As long as the json locale files existed in the old location, there was no trigger to download them to the new location.
So this observation wasn’t a direct result from upgrading to the latest version (but it did trigger a recompilation, or maybe I wiped out the deps folder, I can’t remember), no worries there.
What surprises me a bit is that the documentation encourages specifying the :otp_app key, which ultimately drives the Cldr data_dir to become part of your priv directory. I don’t think there are good reasons to have it there (at least not under git revision control). And therefore, the suggestion surprises me. Having the locale files under the priv_dir of :ex_cldr seems to work just fine. Or am I wrong here, when people configure multiple Cldr backends, then there will be some kind of clash?
The text was updated successfully, but these errors were encountered:
kipcole9
changed the title
Configuring :opt_app changes the location of the locale files
Configuring :otp_app changes the location of the locale files
Aug 29, 2024
Per the elixir slack thread:
The text was updated successfully, but these errors were encountered: