Locale: default German in dev/prod, English in test; validate locale in LocaleController
This commit is contained in:
parent
2cab4b0de4
commit
3a98f70ba5
3 changed files with 10 additions and 5 deletions
|
|
@ -42,9 +42,8 @@ defmodule MvWeb.LiveUserAuth do
|
|||
end
|
||||
|
||||
def on_mount(:live_no_user, _params, session, socket) do
|
||||
# Set the locale for not logged in user to set the language in the Log-In Screen
|
||||
# otherwise the locale is not taken for the Log-In Screen
|
||||
locale = session["locale"] || "en"
|
||||
# Set the locale for not logged in user (default from config, "de" in dev/prod).
|
||||
locale = session["locale"] || Application.get_env(:mv, :default_locale, "de")
|
||||
Gettext.put_locale(MvWeb.Gettext, locale)
|
||||
{:cont, assign(socket, :locale, locale)}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue