Skip to content

Commit

Permalink
Make Config.cldr_data_dir/0 a runtime result, not compile time
Browse files Browse the repository at this point in the history
  • Loading branch information
kipcole9 committed May 1, 2024
1 parent 1301429 commit 00d4559
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/cldr/config/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ defmodule Cldr.Config do

@app_name Mix.Project.config()[:app]
@cldr_data_dir [:code.priv_dir(@app_name), "/cldr"] |> :erlang.iolist_to_binary()
@external_resource Path.join(@cldr_data_dir, "/cldr/version.json")

@root_locale_name :und
@default_locale_name :"en-001"
Expand Down Expand Up @@ -245,7 +246,7 @@ defmodule Cldr.Config do
"""
def cldr_data_dir do
@cldr_data_dir
[:code.priv_dir(@app_name), "/cldr"] |> :erlang.iolist_to_binary()
end

@doc """
Expand Down Expand Up @@ -309,9 +310,8 @@ defmodule Cldr.Config do

@doc """
Returns the version string of the CLDR data repository
"""
@external_resource Path.join(@cldr_data_dir, "/cldr/version.json")
"""
def version do
cldr_data_dir()
|> Path.join("version.json")
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ defmodule Cldr.Mixfile do
defp description do
"""
Common Locale Data Repository (CLDR) functions for Elixir to localize and format numbers,
dates, lists and units with support for over 600 locales for internationalized (i18n) and
localized (L10N) applications.
dates, lists, messages, languages, territories and units with support for over 700 locales
for internationalized (i18n) and localized (L10N) applications.
"""
end

Expand Down

0 comments on commit 00d4559

Please sign in to comment.