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,
|
config :mobilizon, :cldr,
|
||||||
locales: [
|
locales: [
|
||||||
"ar",
|
|
||||||
"be",
|
|
||||||
"ca",
|
|
||||||
"cs",
|
|
||||||
"de",
|
|
||||||
"en",
|
|
||||||
"es",
|
|
||||||
"fi",
|
|
||||||
"fr",
|
"fr",
|
||||||
"gl",
|
"en"
|
||||||
"hu",
|
|
||||||
"it",
|
|
||||||
"ja",
|
|
||||||
"nl",
|
|
||||||
"nn",
|
|
||||||
"oc",
|
|
||||||
"pl",
|
|
||||||
"pt",
|
|
||||||
"ru",
|
|
||||||
"sv"
|
|
||||||
]
|
]
|
||||||
|
|
||||||
config :mobilizon, :activitypub,
|
config :mobilizon, :activitypub,
|
||||||
|
@ -92,13 +92,6 @@ config :mobilizon, :instance,
|
|||||||
|
|
||||||
# config :mobilizon, :activitypub, sign_object_fetches: false
|
# 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,
|
config :mobilizon, :anonymous,
|
||||||
reports: [
|
reports: [
|
||||||
allowed: true
|
allowed: true
|
||||||
|
@ -13,6 +13,31 @@ config :mobilizon, Mobilizon.Web.Endpoint,
|
|||||||
# Do not print debug messages in production
|
# Do not print debug messages in production
|
||||||
config :logger, level: :info
|
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
|
cond do
|
||||||
System.get_env("INSTANCE_CONFIG") &&
|
System.get_env("INSTANCE_CONFIG") &&
|
||||||
File.exists?("./config/#{System.get_env("INSTANCE_CONFIG")}") ->
|
File.exists?("./config/#{System.get_env("INSTANCE_CONFIG")}") ->
|
||||||
|
@ -5,6 +5,10 @@ defmodule Mobilizon.Cldr do
|
|||||||
|
|
||||||
use Cldr,
|
use Cldr,
|
||||||
locales: Application.get_env(:mobilizon, :cldr)[:locales],
|
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]
|
providers: [Cldr.Number, Cldr.Calendar, Cldr.DateTime, Cldr.Language]
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user