Load only a few locales in dev environment

No need to load everything

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-11-06 11:25:58 +01:00
parent efa8b6fe08
commit 4f1ceb37ed
3 changed files with 30 additions and 20 deletions

View File

@ -178,6 +178,28 @@ config :ex_cldr,
config :http_signatures, config :http_signatures,
adapter: Mobilizon.Federation.HTTPSignatures.Signature adapter: Mobilizon.Federation.HTTPSignatures.Signature
config :mobilizon, :cldr,
locales: [
"ar",
"be",
"ca",
"cs",
"de",
"en",
"es",
"fi",
"fr",
"gl",
"it",
"ja",
"nl",
"oc",
"pl",
"pt",
"ru",
"sv"
]
config :mobilizon, :activitypub, config :mobilizon, :activitypub,
# One day # One day
actor_stale_period: 3_600 * 48, actor_stale_period: 3_600 * 48,

View File

@ -92,6 +92,13 @@ 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

View File

@ -4,26 +4,7 @@ defmodule Mobilizon.Cldr do
""" """
use Cldr, use Cldr,
locales: [ locales: Application.get_env(:mobilizon, :cldr)[:locales],
"ar",
"be",
"ca",
"cs",
"de",
"en",
"es",
"fi",
"fr",
"gl",
"it",
"ja",
"nl",
"oc",
"pl",
"pt",
"ru",
"sv"
],
gettext: Mobilizon.Web.Gettext, gettext: Mobilizon.Web.Gettext,
providers: [Cldr.Number, Cldr.Calendar, Cldr.DateTime, Cldr.Language] providers: [Cldr.Number, Cldr.Calendar, Cldr.DateTime, Cldr.Language]
end end