mobilizon/lib/mobilizon/cldr.ex
Thomas Citharel a115b49b4c
Only load all locales in prod mode
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2020-11-17 15:42:03 +01:00

15 lines
377 B
Elixir

defmodule Mobilizon.Cldr do
@moduledoc """
Module to define supported locales
"""
use Cldr,
locales: Application.get_env(:mobilizon, :cldr)[:locales],
gettext:
if(Application.fetch_env!(:mobilizon, :env) == :prod,
do: Mobilizon.Web.Gettext,
else: nil
),
providers: [Cldr.Number, Cldr.Calendar, Cldr.DateTime, Cldr.Language]
end