Refactor type/format labels to enable translations

This commit is contained in:
Claudio Ortolina
2025-01-29 11:04:19 +00:00
parent 96bd453900
commit 9e1f00c9a8
16 changed files with 193 additions and 132 deletions
@@ -1,7 +1,9 @@
defmodule MusicLibraryWeb.CollectionLive.Show do
use MusicLibraryWeb, :live_view
import MusicLibraryWeb.RecordComponents, only: [toggle_actions_menu: 1, close_actions_menu: 1]
import MusicLibraryWeb.RecordComponents,
only: [toggle_actions_menu: 1, close_actions_menu: 1, format_label: 1, type_label: 1]
alias Phoenix.LiveView.JS
alias MusicLibrary.Records
@@ -22,9 +22,9 @@
{@record.title}
</h2>
<p class="mt-2 text-sm leading-5 text-zinc-500 dark:text-zinc-400">
{Records.Record.format_release(@record.release)} · {Records.Record.format_long_label(
@record.format
)} · {Records.Record.type_long_label(@record.type)}
{Records.Record.format_release(@record.release)} · {format_label(@record.format)} · {type_label(
@record.type
)}
</p>
</div>
<div class="relative flex-none">