add translation
This commit is contained in:
parent
f1ffe53215
commit
8e5524de57
9 changed files with 426 additions and 121 deletions
|
|
@ -4,6 +4,8 @@ defmodule MvWeb.LocaleController do
|
|||
def set_locale(conn, %{"locale" => locale}) do
|
||||
conn
|
||||
|> put_session(:locale, locale)
|
||||
# Store locale in a cookie that persists beyond the session
|
||||
|> put_resp_cookie("locale", locale, max_age: 365 * 24 * 60 * 60, same_site: "Lax")
|
||||
|> redirect(to: get_referer(conn) || "/")
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue