Save user locale and use it to translate things
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -17,7 +17,7 @@ defmodule MobilizonWeb.Email.Admin do
|
||||
|
||||
@spec report(User.t(), Report.t(), String.t()) :: Bamboo.Email.t()
|
||||
def report(%User{email: email}, %Report{} = report, locale \\ "en") do
|
||||
Gettext.put_locale(locale)
|
||||
MobilizonWeb.Gettext.put_locale(locale)
|
||||
|
||||
subject =
|
||||
gettext(
|
||||
|
||||
@@ -24,7 +24,7 @@ defmodule MobilizonWeb.Email.Event do
|
||||
changes,
|
||||
locale \\ "en"
|
||||
) do
|
||||
Gettext.put_locale(locale)
|
||||
MobilizonWeb.Gettext.put_locale(locale)
|
||||
|
||||
subject =
|
||||
gettext(
|
||||
|
||||
@@ -46,7 +46,7 @@ defmodule MobilizonWeb.Email.Participation do
|
||||
%Participant{event: event, role: :rejected},
|
||||
locale
|
||||
) do
|
||||
Gettext.put_locale(locale)
|
||||
MobilizonWeb.Gettext.put_locale(locale)
|
||||
|
||||
subject =
|
||||
gettext(
|
||||
@@ -67,7 +67,7 @@ defmodule MobilizonWeb.Email.Participation do
|
||||
%Participant{event: event, role: :participant},
|
||||
locale
|
||||
) do
|
||||
Gettext.put_locale(locale)
|
||||
MobilizonWeb.Gettext.put_locale(locale)
|
||||
|
||||
subject =
|
||||
gettext(
|
||||
|
||||
@@ -19,7 +19,7 @@ defmodule MobilizonWeb.Email.User do
|
||||
%User{email: email, confirmation_token: confirmation_token},
|
||||
locale \\ "en"
|
||||
) do
|
||||
Gettext.put_locale(locale)
|
||||
MobilizonWeb.Gettext.put_locale(locale)
|
||||
|
||||
subject =
|
||||
gettext(
|
||||
@@ -39,7 +39,7 @@ defmodule MobilizonWeb.Email.User do
|
||||
%User{email: email, reset_password_token: reset_password_token},
|
||||
locale \\ "en"
|
||||
) do
|
||||
Gettext.put_locale(locale)
|
||||
MobilizonWeb.Gettext.put_locale(locale)
|
||||
|
||||
subject =
|
||||
gettext(
|
||||
|
||||
Reference in New Issue
Block a user