Started to translate user facing strings into German.

This commit is contained in:
2026-02-14 12:41:27 +01:00
parent 1c02f28d25
commit d6f2d8c1f6
2 changed files with 22 additions and 13 deletions

View File

@ -10,16 +10,15 @@ defmodule BeetRoundServerWeb.BiddingLive.Form do
<Layouts.app flash={@flash} current_scope={@current_scope}> <Layouts.app flash={@flash} current_scope={@current_scope}>
<.header> <.header>
{@page_title} {@page_title}
<:subtitle>Use this form to manage bidding records in your database.</:subtitle> <:subtitle>Bitte gib hier den Betrag ein, den Du monatlich bezahlen willst.</:subtitle>
</.header> </.header>
<.form for={@form} id="bidding-form" phx-change="validate" phx-submit="save"> <.form for={@form} id="bidding-form" phx-change="validate" phx-submit="save">
<.input field={@form[:bidding_round]} type="number" label="Bidding round" /> <.input field={@form[:bidding_round]} type="number" label="Bidding round" />
<.input field={@form[:amount]} type="number" label="Amount" /> <.input field={@form[:amount]} type="number" label="Amount" />
<.input field={@form[:depot_wish_one]} type="text" label="Depot wish one" /> <.input field={@form[:depot_wish_one]} type="text" label="Depot wish one" />
<.input field={@form[:depot_wish_two]} type="text" label="Depot wish two" /> <.input field={@form[:depot_wish_two]} type="text" label="Depot wish two" />
<footer> <footer>
<.button phx-disable-with="Saving..." variant="primary">Save Bidding</.button> <.button phx-disable-with="Bearbeitung..." variant="primary">Gebot abgeben</.button>
<.button navigate={return_path(@current_scope, @return_to, @bidding)}>Cancel</.button> <.button navigate={return_path(@current_scope, @return_to, @bidding)}>Cancel</.button>
</footer> </footer>
</.form> </.form>
@ -42,7 +41,7 @@ defmodule BeetRoundServerWeb.BiddingLive.Form do
bidding = Biddings.get_bidding!(socket.assigns.current_scope, id) bidding = Biddings.get_bidding!(socket.assigns.current_scope, id)
socket socket
|> assign(:page_title, "Edit Bidding") |> assign(:page_title, "Gebot bearbeiten")
|> assign(:bidding, bidding) |> assign(:bidding, bidding)
|> assign(:form, to_form(Biddings.change_bidding(socket.assigns.current_scope, bidding))) |> assign(:form, to_form(Biddings.change_bidding(socket.assigns.current_scope, bidding)))
end end
@ -51,14 +50,20 @@ defmodule BeetRoundServerWeb.BiddingLive.Form do
bidding = %Bidding{user_id: socket.assigns.current_scope.user.id} bidding = %Bidding{user_id: socket.assigns.current_scope.user.id}
socket socket
|> assign(:page_title, "New Bidding") |> assign(:page_title, "Neues Gebot")
|> assign(:bidding, bidding) |> assign(:bidding, bidding)
|> assign(:form, to_form(Biddings.change_bidding(socket.assigns.current_scope, bidding))) |> assign(:form, to_form(Biddings.change_bidding(socket.assigns.current_scope, bidding)))
end end
@impl true @impl true
def handle_event("validate", %{"bidding" => bidding_params}, socket) do def handle_event("validate", %{"bidding" => bidding_params}, socket) do
changeset = Biddings.change_bidding(socket.assigns.current_scope, socket.assigns.bidding, bidding_params) changeset =
Biddings.change_bidding(
socket.assigns.current_scope,
socket.assigns.bidding,
bidding_params
)
{:noreply, assign(socket, form: to_form(changeset, action: :validate))} {:noreply, assign(socket, form: to_form(changeset, action: :validate))}
end end
@ -67,11 +72,15 @@ defmodule BeetRoundServerWeb.BiddingLive.Form do
end end
defp save_bidding(socket, :edit, bidding_params) do defp save_bidding(socket, :edit, bidding_params) do
case Biddings.update_bidding(socket.assigns.current_scope, socket.assigns.bidding, bidding_params) do case Biddings.update_bidding(
socket.assigns.current_scope,
socket.assigns.bidding,
bidding_params
) do
{:ok, bidding} -> {:ok, bidding} ->
{:noreply, {:noreply,
socket socket
|> put_flash(:info, "Bidding updated successfully") |> put_flash(:info, "Gebot erfolgreich bearbeitet")
|> push_navigate( |> push_navigate(
to: return_path(socket.assigns.current_scope, socket.assigns.return_to, bidding) to: return_path(socket.assigns.current_scope, socket.assigns.return_to, bidding)
)} )}
@ -86,7 +95,7 @@ defmodule BeetRoundServerWeb.BiddingLive.Form do
{:ok, bidding} -> {:ok, bidding} ->
{:noreply, {:noreply,
socket socket
|> put_flash(:info, "Bidding created successfully") |> put_flash(:info, "Gebot erfolgreich abgegeben")
|> push_navigate( |> push_navigate(
to: return_path(socket.assigns.current_scope, socket.assigns.return_to, bidding) to: return_path(socket.assigns.current_scope, socket.assigns.return_to, bidding)
)} )}

View File

@ -9,10 +9,10 @@ defmodule BeetRoundServerWeb.BiddingLive.Index do
~H""" ~H"""
<Layouts.app flash={@flash} current_scope={@current_scope}> <Layouts.app flash={@flash} current_scope={@current_scope}>
<.header> <.header>
Listing Biddings {@page_title}
<:actions> <:actions>
<.button variant="primary" navigate={~p"/biddings/new"}> <.button variant="primary" navigate={~p"/biddings/new"}>
<.icon name="hero-plus" /> New Bidding <.icon name="hero-plus" /> Neues Gebot
</.button> </.button>
</:actions> </:actions>
</.header> </.header>
@ -41,7 +41,7 @@ defmodule BeetRoundServerWeb.BiddingLive.Index do
<:action :let={{id, bidding}}> <:action :let={{id, bidding}}>
<.link <.link
phx-click={JS.push("delete", value: %{id: bidding.id}) |> hide("##{id}")} phx-click={JS.push("delete", value: %{id: bidding.id}) |> hide("##{id}")}
data-confirm="Are you sure?" data-confirm="Gebot wirklich löschen?"
> >
Delete Delete
</.link> </.link>
@ -61,7 +61,7 @@ defmodule BeetRoundServerWeb.BiddingLive.Index do
{:ok, {:ok,
socket socket
|> assign(:page_title, "Listing Biddings") |> assign(:page_title, "Aktuelles Gebot")
|> assign(bidding_round: current_round) |> assign(bidding_round: current_round)
|> stream(:biddings, list_biddings(socket.assigns.current_scope))} |> stream(:biddings, list_biddings(socket.assigns.current_scope))}
end end