elixir-cldr / cldr

Elixir implementation of CLDR/ICU
Other
440 stars 33 forks source link

Can't seem to get rid of warning on compile #194

Closed lawik closed 1 year ago

lawik commented 1 year ago

I'm getting this warning:

mix compile --force --warnings-as-errors && echo "OK"
Compiling 149 files (.ex)
Generating Indie.Cldr for 2 locales named [:en, :und] with a default locale named :en
warning: redefining module Indie.Cldr.Currency (current version loaded from _build/dev/lib/indie/ebin/Elixir.Indie.Cldr.Currency.beam)
  lib/indie/cldr.ex:1

I updated the relevant packages:

New:
  ex_cldr 2.34.1
  ex_cldr_currencies 2.15.0

Config:

 use Cldr,
    default_locale: "en",
    locales: [],
    add_fallback_locales: false,
    data_dir: "./priv/cldr",
    otp_app: :indie,
    precompile_number_formats: ["¤¤#,##0.##"],
    precompile_transliterations: [{:latn, :arab}, {:thai, :latn}],
    providers: [Cldr.Number, Cldr.Territory, Cldr.Currency],
    generate_docs: true,
    force_locale_download: false
kipcole9 commented 1 year ago

@lawik apologies for the inconvenience. I believe you don't need to include the Cldr.Currency provider because Cldr.Number already compiles it in (I need to check the documentation).

A couple of suggestions:

# Only those options that aren't default
# although nothing wrong with the configuration
# you provided.
demodule MyCldr do
 use Cldr,
    default_locale: "en",
    locales: [],
    add_fallback_locales: false,
    providers: [Cldr.Number, Cldr.Territory]
end
kipcole9 commented 1 year ago

Let me know if that solves the issue? I will also check to ensure that if this does resolve the issue that provider Cldr.Currency is not compiled twice if it and Cldr.Number are configured as providers.

lawik commented 1 year ago

That did it! Thanks a lot :)

kipcole9 commented 1 year ago

Thanks for the feedback, glad that solved it. I will keep this issue open until I push a commit that avoids the issue in the future.