Closed erikreedstrom closed 5 years ago
@erikreedstrom Yes, that's clearly not good. I'll try to get it fixed tonight but it may take until Friday.
@erikreedstrom As of this commit I believe that the :data_dir
configuration is working correctly. I have added some tests and additional notes in the @doc
.
Would you consider testing this version from the GitHub repo before I push the release to hex?
Return the path name of the CLDR data directory for a client application.
The order of priority to determine where the client data directory is located is:
:data_dir
of a backend configuration:data_dir
of the backend's :otp_app
configuration:data_dir
of the global configurationpriv_dir()
of a specified :otp_app
The priv_dir()
of ex_cldr
Note that config_from_opts/1
merges the global config,
the otp_app config and the module config together so
that :data_dir
already resolves this priority in most
cases.
The remaining cases are for when no :data_dir
is
specified.
Pushed to hex as version 2.6.1
@kipcole9 Sorry it took so long to get back to you. 🙇 Can confirm this works great. Thanks again!
It seems that
data_dir
is being ignored. Our config is used within an umbrella app, and defines anotp_app
param.No matter what we do, setting in the module or in the config, it always downloads to the app priv dir. We're thinking it's likely related to the order of pattern matching here: https://github.com/kipcole9/cldr/blob/dc37a0565dc7bc2be680b31953001f7ab031d09b/lib/cldr/config/config.ex#L198-L204
Strangely, when we removed the
otp_app
param and defined everything in the module, we couldn't tell where the cldr was being downloaded to. ~It seemed that wasn't working at all.~ Rereading the docs it seems these were going to ex_cldr priv?The reason this is important for us is that we use the cldr data in multiple applications. With this current issue, we are downloading the same data multiple times.