add further locale tests
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Moritz 2025-06-18 14:48:16 +02:00
parent ca4ac3a1c0
commit dedd40b949
Signed by: moritz
GPG key ID: 1020A035E5DD0824
8 changed files with 73 additions and 13 deletions

View file

@ -1,6 +1,4 @@
defmodule MvWeb.LiveHelpers do
import Phoenix.LiveView
def on_mount(:default, _params, session, socket) do
locale = session["locale"] || "en"
Gettext.put_locale(locale)

View file

@ -15,4 +15,4 @@ defmodule MvWeb.LocaleController do
_ -> nil
end
end
end
end

View file

@ -26,7 +26,9 @@ defmodule MvWeb.MemberLive.FormComponent do
<div>
<.header>
{@title}
<:subtitle>{gettext("Use this form to manage member records and their properties.")}</:subtitle>
<:subtitle>
{gettext("Use this form to manage member records and their properties.")}
</:subtitle>
</.header>
<.simple_form
@ -104,7 +106,7 @@ defmodule MvWeb.MemberLive.FormComponent do
socket =
socket
|> put_flash(:info, gettext("Mitglied %{action} erfolgreich", action: action))
|> put_flash(:info, gettext("Member %{action} successfully", action: action))
|> push_patch(to: socket.assigns.patch)
{:noreply, socket}

View file

@ -22,7 +22,9 @@ defmodule MvWeb.MemberLive.Show do
<:item title={gettext("Last Name")}>{@member.last_name}</:item>
<:item title={gettext("Email")}>{@member.email}</:item>
<:item title={gettext("Birth Date")}>{@member.birth_date}</:item>
<:item title={gettext("Paid")}>{if @member.paid, do: gettext("Yes"), else: gettext("No")}</:item>
<:item title={gettext("Paid")}>
{if @member.paid, do: gettext("Yes"), else: gettext("No")}
</:item>
<:item title={gettext("Phone Number")}>{@member.phone_number}</:item>
<:item title={gettext("Join Date")}>{@member.join_date}</:item>
<:item title={gettext("Exit Date")}>{@member.exit_date}</:item>