add translation

This commit is contained in:
Moritz 2025-11-06 11:33:09 +01:00 committed by moritz
parent 527657d37b
commit 4ba03821a2
9 changed files with 426 additions and 121 deletions

View file

@ -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