Extract record list translations
This commit is contained in:
@@ -14,7 +14,7 @@ defmodule MusicLibraryWeb.RecordLive.Index do
|
|||||||
def mount(_params, _session, socket) do
|
def mount(_params, _session, socket) do
|
||||||
socket =
|
socket =
|
||||||
if static_changed?(socket) do
|
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
|
else
|
||||||
socket
|
socket
|
||||||
end
|
end
|
||||||
@@ -37,7 +37,7 @@ defmodule MusicLibraryWeb.RecordLive.Index do
|
|||||||
end
|
end
|
||||||
|
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "Import from MusicBrainz")
|
|> assign(:page_title, gettext("Import from MusicBrainz"))
|
||||||
|> assign(:record, nil)
|
|> assign(:record, nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ defmodule MusicLibraryWeb.RecordLive.Index do
|
|||||||
end
|
end
|
||||||
|
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "Edit")
|
|> assign(:page_title, gettext("Edit"))
|
||||||
|> assign(:record, Records.get_record!(id))
|
|> assign(:record, Records.get_record!(id))
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ defmodule MusicLibraryWeb.RecordLive.Index do
|
|||||||
records = Records.search_records(query, limit: record_list_params.page_size, offset: offset)
|
records = Records.search_records(query, limit: record_list_params.page_size, offset: offset)
|
||||||
|
|
||||||
socket
|
socket
|
||||||
|> assign(:page_title, "Collection")
|
|> assign(:page_title, gettext("Collection"))
|
||||||
|> assign(:record, nil)
|
|> assign(:record, nil)
|
||||||
|> assign(:record_list_params, record_list_params)
|
|> assign(:record_list_params, record_list_params)
|
||||||
|> stream(:records, records, reset: true)
|
|> stream(:records, records, reset: true)
|
||||||
@@ -102,7 +102,7 @@ defmodule MusicLibraryWeb.RecordLive.Index do
|
|||||||
{:ok, record} ->
|
{:ok, record} ->
|
||||||
{:noreply,
|
{:noreply,
|
||||||
socket
|
socket
|
||||||
|> put_flash(:info, "Record imported successfully")
|
|> put_flash(:info, gettext("Record imported successfully"))
|
||||||
|> push_navigate(to: ~p"/records/#{record.id}")}
|
|> push_navigate(to: ~p"/records/#{record.id}")}
|
||||||
|
|
||||||
{:error, %Ecto.Changeset{} = changeset} ->
|
{:error, %Ecto.Changeset{} = changeset} ->
|
||||||
@@ -111,7 +111,7 @@ defmodule MusicLibraryWeb.RecordLive.Index do
|
|||||||
{:error, reason} ->
|
{:error, reason} ->
|
||||||
{:noreply,
|
{:noreply,
|
||||||
socket
|
socket
|
||||||
|> put_flash(:error, "Error importing record, #{inspect(reason)}")
|
|> put_flash(:error, gettext("Error importing record") <> "," <> inspect(reason))
|
||||||
|> push_patch(to: ~p"/records")}
|
|> push_patch(to: ~p"/records")}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
<div>
|
<div>
|
||||||
<header class="gap-6 mb-2">
|
<header class="gap-6 mb-2">
|
||||||
<h1 class="text-lg font-semibold leading-8 text-zinc-800">All Records</h1>
|
<h1 class="text-lg font-semibold leading-8 text-zinc-800">
|
||||||
|
<%= gettext("All Records") %>
|
||||||
|
</h1>
|
||||||
<div class="flex items-center justify-between gap-6 mb-2 mt-2">
|
<div class="flex items-center justify-between gap-6 mb-2 mt-2">
|
||||||
<form class="w-2/3" for={@record_list_params.query} phx-submit="search" phx-change="search">
|
<form class="w-2/3" for={@record_list_params.query} phx-submit="search" phx-change="search">
|
||||||
<input
|
<input
|
||||||
@@ -9,22 +11,24 @@
|
|||||||
id={:query}
|
id={:query}
|
||||||
name={:query}
|
name={:query}
|
||||||
value={@record_list_params.query}
|
value={@record_list_params.query}
|
||||||
placeholder="Search"
|
placeholder={gettext("Search")}
|
||||||
phx-debounce="500"
|
phx-debounce="500"
|
||||||
autocorrect="off"
|
autocorrect="off"
|
||||||
autocapitalize="none"
|
autocapitalize="none"
|
||||||
/>
|
/>
|
||||||
</form>
|
</form>
|
||||||
<.link patch={~p"/records/import"}>
|
<.link patch={~p"/records/import"}>
|
||||||
<.button>Import</.button>
|
<.button><%= gettext("Import") %></.button>
|
||||||
</.link>
|
</.link>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<p class="text-right text-base max-sm:text-xs mt-8">
|
<p class="text-right text-base max-sm:text-xs mt-8">
|
||||||
Showing <b><%= Enum.count(@streams.records) %></b>
|
<%= gettext(
|
||||||
of <b><%= @record_list_params.total_entries %></b>
|
"Showing <b>%{visible}</b> of <b>%{total}</b> records",
|
||||||
records
|
%{visible: Enum.count(@streams.records), total: @record_list_params.total_entries}
|
||||||
|
)
|
||||||
|
|> raw() %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -80,7 +84,7 @@
|
|||||||
phx-click={toggle_actions_menu(record.id)}
|
phx-click={toggle_actions_menu(record.id)}
|
||||||
phx-click-away={close_actions_menu(record.id)}
|
phx-click-away={close_actions_menu(record.id)}
|
||||||
>
|
>
|
||||||
<span class="sr-only">Open options</span>
|
<span class="sr-only"><%= gettext("Open options") %></span>
|
||||||
<svg
|
<svg
|
||||||
class="h-5 w-5"
|
class="h-5 w-5"
|
||||||
viewBox="0 0 20 20"
|
viewBox="0 0 20 20"
|
||||||
@@ -118,7 +122,7 @@
|
|||||||
id={"actions-#{record.id}-show"}
|
id={"actions-#{record.id}-show"}
|
||||||
navigate={~p"/records/#{record}"}
|
navigate={~p"/records/#{record}"}
|
||||||
>
|
>
|
||||||
Show
|
<%= gettext("Show") %>
|
||||||
</.link>
|
</.link>
|
||||||
<a
|
<a
|
||||||
href={musicbrainz_url(record)}
|
href={musicbrainz_url(record)}
|
||||||
@@ -128,7 +132,7 @@
|
|||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
id={"actions-#{record.id}-musicbrainz"}
|
id={"actions-#{record.id}-musicbrainz"}
|
||||||
>
|
>
|
||||||
View on MusicBrainz
|
<%= gettext("View on MusicBrainz") %>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<.link
|
<.link
|
||||||
@@ -138,7 +142,7 @@
|
|||||||
id={"actions-#{record.id}-edit"}
|
id={"actions-#{record.id}-edit"}
|
||||||
patch={~p"/records/#{record}/edit"}
|
patch={~p"/records/#{record}/edit"}
|
||||||
>
|
>
|
||||||
Edit
|
<%= gettext("Edit") %>
|
||||||
</.link>
|
</.link>
|
||||||
|
|
||||||
<.link
|
<.link
|
||||||
@@ -147,9 +151,9 @@
|
|||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
id={"actions-#{record.id}-delete"}
|
id={"actions-#{record.id}-delete"}
|
||||||
phx-click={JS.push("delete", value: %{id: record.id}) |> hide("##{id}")}
|
phx-click={JS.push("delete", value: %{id: record.id}) |> hide("##{id}")}
|
||||||
data-confirm="Are you sure?"
|
data-confirm={gettext("Are you sure?")}
|
||||||
>
|
>
|
||||||
Delete
|
<%= gettext("Delete") %>
|
||||||
</.link>
|
</.link>
|
||||||
</.focus_wrap>
|
</.focus_wrap>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ msgid "You must be logged in to access this page"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/music_library_web/components/layouts/app.html.heex:10
|
#: lib/music_library_web/components/layouts/app.html.heex:10
|
||||||
|
#: lib/music_library_web/live/record_live/index.ex:71
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Collection"
|
msgid "Collection"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@@ -180,3 +181,74 @@ msgstr ""
|
|||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Search for records"
|
msgid "Search for records"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/record_live/index.html.heex:4
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
msgid "All Records"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/record_live/index.html.heex:154
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
msgid "Are you sure?"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/record_live/index.html.heex:156
|
||||||
|
#, 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
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
msgid "Edit"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/record_live/index.ex:114
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
msgid "Error importing record"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/record_live/index.html.heex:21
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
msgid "Import"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/record_live/index.ex:40
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
msgid "Import from MusicBrainz"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/record_live/index.html.heex:87
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
msgid "Open options"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/record_live/index.ex:105
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
msgid "Record imported successfully"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/record_live/index.html.heex:14
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
msgid "Search"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/record_live/index.html.heex:125
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
msgid "Show"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/record_live/index.html.heex:27
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
msgid "Showing <b>%{visible}</b> of <b>%{total}</b> records"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/record_live/index.ex:17
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
msgid "The application has been updated, please reload."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/record_live/index.html.heex:135
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
msgid "View on MusicBrainz"
|
||||||
|
msgstr ""
|
||||||
|
|||||||
Reference in New Issue
Block a user