forked from potsda.mn/mobilizon
Only load all locales in prod mode
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
885b61dfd6
commit
a115b49b4c
|
@ -181,26 +181,8 @@ config :http_signatures,
|
|||
|
||||
config :mobilizon, :cldr,
|
||||
locales: [
|
||||
"ar",
|
||||
"be",
|
||||
"ca",
|
||||
"cs",
|
||||
"de",
|
||||
"en",
|
||||
"es",
|
||||
"fi",
|
||||
"fr",
|
||||
"gl",
|
||||
"hu",
|
||||
"it",
|
||||
"ja",
|
||||
"nl",
|
||||
"nn",
|
||||
"oc",
|
||||
"pl",
|
||||
"pt",
|
||||
"ru",
|
||||
"sv"
|
||||
"en"
|
||||
]
|
||||
|
||||
config :mobilizon, :activitypub,
|
||||
|
|
|
@ -92,13 +92,6 @@ config :mobilizon, :instance,
|
|||
|
||||
# config :mobilizon, :activitypub, sign_object_fetches: false
|
||||
|
||||
# No need to compile every locale in development environment
|
||||
config :mobilizon, :cldr,
|
||||
locales: [
|
||||
"fr",
|
||||
"en"
|
||||
]
|
||||
|
||||
config :mobilizon, :anonymous,
|
||||
reports: [
|
||||
allowed: true
|
||||
|
|
|
@ -13,6 +13,31 @@ config :mobilizon, Mobilizon.Web.Endpoint,
|
|||
# Do not print debug messages in production
|
||||
config :logger, level: :info
|
||||
|
||||
# Load all locales in production
|
||||
config :mobilizon, :cldr,
|
||||
locales: [
|
||||
"ar",
|
||||
"be",
|
||||
"ca",
|
||||
"cs",
|
||||
"de",
|
||||
"en",
|
||||
"es",
|
||||
"fi",
|
||||
"fr",
|
||||
"gl",
|
||||
"hu",
|
||||
"it",
|
||||
"ja",
|
||||
"nl",
|
||||
"nn",
|
||||
"oc",
|
||||
"pl",
|
||||
"pt",
|
||||
"ru",
|
||||
"sv"
|
||||
]
|
||||
|
||||
cond do
|
||||
System.get_env("INSTANCE_CONFIG") &&
|
||||
File.exists?("./config/#{System.get_env("INSTANCE_CONFIG")}") ->
|
||||
|
|
|
@ -5,6 +5,10 @@ defmodule Mobilizon.Cldr do
|
|||
|
||||
use Cldr,
|
||||
locales: Application.get_env(:mobilizon, :cldr)[:locales],
|
||||
gettext: Mobilizon.Web.Gettext,
|
||||
gettext:
|
||||
if(Application.fetch_env!(:mobilizon, :env) == :prod,
|
||||
do: Mobilizon.Web.Gettext,
|
||||
else: nil
|
||||
),
|
||||
providers: [Cldr.Number, Cldr.Calendar, Cldr.DateTime, Cldr.Language]
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue