Extract show page translations

This commit is contained in:
Claudio Ortolina
2024-10-21 12:07:41 +01:00
parent b409f6da6e
commit a4666da37a
3 changed files with 57 additions and 14 deletions
@@ -16,7 +16,7 @@ defmodule MusicLibraryWeb.RecordLive.Show do
socket =
if static_changed?(socket) do
put_flash(socket, :warning, "The application has been updated, please reload.")
put_flash(socket, :warning, gettext("The application has been updated, please reload."))
else
socket
end
@@ -46,8 +46,8 @@ defmodule MusicLibraryWeb.RecordLive.Show do
{:noreply, assign(socket, :record, record)}
end
defp page_title(:show), do: "Show Record"
defp page_title(:edit), do: "Edit"
defp page_title(:show), do: gettext("Show")
defp page_title(:edit), do: gettext("Edit")
defp musicbrainz_url(record) do
"https://musicbrainz.org/release-group/#{record.musicbrainz_id}"
@@ -11,10 +11,17 @@
</:subtitle>
<:actions>
<.link patch={~p"/records/#{@record}/show/edit"} phx-click={JS.push_focus()}>
<.button>Edit</.button>
<.button>
<%= gettext("Edit") %>
</.button>
</.link>
<.link phx-click={JS.push("delete", value: %{id: @record.id})} data-confirm="Are you sure?">
<.button class="!bg-red-900 hover:!bg-red-700">Delete</.button>
<.link
phx-click={JS.push("delete", value: %{id: @record.id})}
data-confirm={gettext("Are you sure?")}
>
<.button class="!bg-red-900 hover:!bg-red-700">
<%= gettext("Delete") %>"
</.button>
</.link>
</:actions>
</.header>
@@ -32,20 +39,20 @@
</div>
<.list>
<:item title="Type">
<:item title={gettext("Type")}>
<span class="inline-flex items-center mr-2 rounded-md bg-gray-50 px-2 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10">
<%= @record.type %>
</span>
</:item>
<:item title="Musicbrainz ID">
<:item title={gettext("Musicbrainz ID")}>
<a href={musicbrainz_url(@record)}>
<code><%= @record.musicbrainz_id %></code>
</a>
</:item>
<:item title="Release">
<:item title={gettext("Release")}>
<%= Records.Record.format_release(@record.release) %>
</:item>
<:item title="Genres">
<:item title={gettext("Genres")}>
<span
:for={genre <- @record.genres}
class="inline-flex items-center mr-2 mb-2 rounded-md bg-gray-50 px-2 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10"
@@ -53,14 +60,16 @@
<%= genre %>
</span>
</:item>
<:item title="Purchased at"><%= @record.purchased_at %></:item>
<:item title="Inserted at"><%= @record.inserted_at %></:item>
<:item title="Updated at"><%= @record.updated_at %></:item>
<:item title={gettext("Purchased at")}><%= @record.purchased_at %></:item>
<:item title={gettext("Inserted at")}><%= @record.inserted_at %></:item>
<:item title={gettext("Updated at")}><%= @record.updated_at %></:item>
</.list>
</div>
<div class="mt-8">
<.back navigate={@back_url}>Back to records</.back>
<.back navigate={@back_url}>
<%= gettext("Back to records") %>
</.back>
</div>
<.modal
+34
View File
@@ -138,6 +138,7 @@ msgid "No cover selected"
msgstr ""
#: lib/music_library_web/live/record_live/form_component.ex:46
#: lib/music_library_web/live/record_live/show.html.heex:63
#, elixir-autogen, elixir-format
msgid "Purchased at"
msgstr ""
@@ -148,6 +149,7 @@ msgid "Record updated successfully"
msgstr ""
#: lib/music_library_web/live/record_live/form_component.ex:45
#: lib/music_library_web/live/record_live/show.html.heex:52
#, elixir-autogen, elixir-format
msgid "Release"
msgstr ""
@@ -163,6 +165,7 @@ msgid "Saving..."
msgstr ""
#: lib/music_library_web/live/record_live/form_component.ex:33
#: lib/music_library_web/live/record_live/show.html.heex:42
#, elixir-autogen, elixir-format
msgid "Type"
msgstr ""
@@ -188,17 +191,21 @@ msgid "All Records"
msgstr ""
#: lib/music_library_web/live/record_live/index.html.heex:154
#: lib/music_library_web/live/record_live/show.html.heex:20
#, elixir-autogen, elixir-format
msgid "Are you sure?"
msgstr ""
#: lib/music_library_web/live/record_live/index.html.heex:156
#: lib/music_library_web/live/record_live/show.html.heex:23
#, elixir-autogen, elixir-format
msgid "Delete"
msgstr ""
#: lib/music_library_web/live/record_live/index.ex:54
#: lib/music_library_web/live/record_live/index.html.heex:145
#: lib/music_library_web/live/record_live/show.ex:50
#: lib/music_library_web/live/record_live/show.html.heex:15
#, elixir-autogen, elixir-format
msgid "Edit"
msgstr ""
@@ -234,6 +241,7 @@ msgid "Search"
msgstr ""
#: lib/music_library_web/live/record_live/index.html.heex:125
#: lib/music_library_web/live/record_live/show.ex:49
#, elixir-autogen, elixir-format
msgid "Show"
msgstr ""
@@ -244,6 +252,7 @@ msgid "Showing <b>%{visible}</b> of <b>%{total}</b> records"
msgstr ""
#: lib/music_library_web/live/record_live/index.ex:17
#: lib/music_library_web/live/record_live/show.ex:19
#, elixir-autogen, elixir-format
msgid "The application has been updated, please reload."
msgstr ""
@@ -252,3 +261,28 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "View on MusicBrainz"
msgstr ""
#: lib/music_library_web/live/record_live/show.html.heex:71
#, elixir-autogen, elixir-format
msgid "Back to records"
msgstr ""
#: lib/music_library_web/live/record_live/show.html.heex:55
#, elixir-autogen, elixir-format
msgid "Genres"
msgstr ""
#: lib/music_library_web/live/record_live/show.html.heex:64
#, elixir-autogen, elixir-format
msgid "Inserted at"
msgstr ""
#: lib/music_library_web/live/record_live/show.html.heex:47
#, elixir-autogen, elixir-format
msgid "Musicbrainz ID"
msgstr ""
#: lib/music_library_web/live/record_live/show.html.heex:65
#, elixir-autogen, elixir-format
msgid "Updated at"
msgstr ""