elixir-cldr / cldr

Elixir implementation of CLDR/ICU

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't seem to get rid of warning on compile

lawik opened this issue · comments

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

@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:

  • Configure {:ex_cldr_numbers, "~> 2.29"} - you don't need to include ex_cldr or ex_cldr_currencies since these will be included as transitive dependencies. (Still need ex_cldr_territories though).
  • Configure your backend without Cldr.Currency as a provider:
# 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

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.

That did it! Thanks a lot :)

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.