feat: gettext

This commit is contained in:
Moritz 2025-06-17 19:02:35 +02:00
parent 2ab3332941
commit ca4ac3a1c0
Signed by: moritz
GPG key ID: 1020A035E5DD0824
15 changed files with 998 additions and 51 deletions

View file

@ -9,6 +9,13 @@
</p>
</div>
<div class="flex items-center gap-4 font-semibold leading-6 text-zinc-900">
<form method="post" action="/set_locale" class="mr-4">
<input type="hidden" name="_csrf_token" value={Plug.CSRFProtection.get_csrf_token()} />
<select name="locale" onchange="this.form.submit()" class="rounded border px-2 py-1">
<option value="de" selected={Gettext.get_locale() == "de"}>Deutsch</option>
<option value="en" selected={Gettext.get_locale() == "en"}>English</option>
</select>
</form>
<a href="https://twitter.com/elixirphoenix" class="hover:text-zinc-700">
@elixirphoenix
</a>