add translation

This commit is contained in:
Moritz 2025-11-06 11:33:09 +01:00
parent f1ffe53215
commit 8e5524de57
Signed by: moritz
GPG key ID: 1020A035E5DD0824
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