Fix and improve language handling
- Refactor plugs to detect and set language - Translate ecto validation errors - Use Gettext directly, not Mobilizon.Web.Gettext - Set the language in the <html> attribute according to the one loaded on front-end Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -348,8 +348,7 @@ defmodule Mobilizon.Config do
|
||||
end
|
||||
|
||||
def generate_terms(locale) do
|
||||
import Mobilizon.Web.Gettext
|
||||
put_locale(locale)
|
||||
Gettext.put_locale(locale)
|
||||
|
||||
Phoenix.View.render_to_string(
|
||||
Mobilizon.Web.APIView,
|
||||
@@ -363,8 +362,7 @@ defmodule Mobilizon.Config do
|
||||
end
|
||||
|
||||
def generate_privacy(locale) do
|
||||
import Mobilizon.Web.Gettext
|
||||
put_locale(locale)
|
||||
Gettext.put_locale(locale)
|
||||
|
||||
Phoenix.View.render_to_string(
|
||||
Mobilizon.Web.APIView,
|
||||
|
||||
Reference in New Issue
Block a user