Merge pull request #208 from GwendalBeaumont/refactor/external/i18n-interpolation

refactor(i18n): replace hardcoded strings in SearchView, PlaylistDetailView, AlbumMenu

cc
This commit is contained in:
victorrhgap committed 2026-03-25 13:08:09 -06:00
commit da32afffee
8 files changed
+148 -67

No files matched your search

+4 -4
View File
@@ -345,13 +345,13 @@
{#if onPlayNext}
<button class="menu-item" onclick={() => handleAction(onPlayNext)}>
<ListPlus size={14} />
<span>Play next</span>
<span>{$t('actions.playNext')}</span>
</button>
{/if}
{#if onPlayLater}
<button class="menu-item" onclick={() => handleAction(onPlayLater)}>
<ListEnd size={14} />
<span>Add to queue</span>
<span>{$t('actions.addToQueue')}</span>
</button>
{/if}
{/if}
@@ -363,7 +363,7 @@
{#if hasLibrary}
<button class="menu-item" onclick={() => handleAction(onAddToPlaylist)}>
<ListMusic size={14} />
<span>Add to playlist</span>
<span>{$t('actions.addToPlaylist')}</span>
</button>
{/if}
@@ -390,7 +390,7 @@
}}
>
<Share2 size={14} />
<span>Share</span>
<span>{$t('actions.share')}</span>
<ChevronRight size={14} class="chevron" />
{#if shareOpen}
<div class="submenu" bind:this={submenuEl} style={submenuStyle}>
@@ -1500,14 +1500,14 @@
}
const sortOptions: { field: SortField; label: string }[] = [
{ field: 'default', label: 'Default' },
{ field: 'title', label: 'Title' },
{ field: 'artist', label: 'Artist' },
{ field: 'album', label: 'Album' },
{ field: 'duration', label: 'Duration' },
{ field: 'added', label: 'Added Recently' },
{ field: 'label', label: 'Label' },
{ field: 'custom', label: 'Custom Order' },
{ field: 'default', label: $t('sort.default') },
{ field: 'title', label: $t('sort.title') },
{ field: 'artist', label: $t('sort.artist') },
{ field: 'album', label: $t('sort.album') },
{ field: 'duration', label: $t('sort.duration') },
{ field: 'added', label: $t('sort.addedRecently') },
{ field: 'label', label: $t('sort.label') },
{ field: 'custom', label: $t('sort.custom') },
];
function formatDuration(seconds: number): string {
@@ -2068,10 +2068,10 @@
<div class="nav-row">
<button class="back-btn" onclick={onBack}>
<ArrowLeft size={16} />
<span>Back</span>
<span>{$t('actions.back')}</span>
</button>
{#if playlist}
<button class="edit-btn" onclick={() => editModalOpen = true} title="Edit playlist">
<button class="edit-btn" onclick={() => editModalOpen = true} title={$t('playlist.editPlaylist')}>
<Edit3 size={16} />
</button>
{/if}
@@ -2080,13 +2080,13 @@
{#if loading}
<div class="loading" class:fading={spinnerFading}>
<div class="spinner"></div>
<p>Loading playlist...</p>
<p>{$t('toast.loadingPlaylist')}</p>
</div>
{:else if error}
<div class="error">
<p>Failed to load playlist</p>
<p>{$t('toast.failedLoadPlaylist')}</p>
<p class="error-detail">{error}</p>
<button class="retry-btn" onclick={loadPlaylist}>Retry</button>
<button class="retry-btn" onclick={loadPlaylist}>{$t('actions.retry')}</button>
</div>
{:else if playlist}
<ViewTransition duration={200} distance={12} direction="up">
@@ -2098,7 +2098,7 @@
<div class="artwork custom-artwork">
<img src={resolveArtworkPath(customArtworkPath)} alt={playlist.name} />
<div class="artwork-overlay">
<button class="artwork-btn artwork-clear" onclick={clearCustomArtwork} title="Remove custom artwork">
<button class="artwork-btn artwork-clear" onclick={clearCustomArtwork} title={$t('playlist.removeCustomArtwork')}>
<X size={20} />
</button>
</div>
@@ -2110,7 +2110,7 @@
size={200}
/>
<div class="artwork-overlay">
<button class="artwork-btn" onclick={selectCustomArtwork} title="Set custom artwork">
<button class="artwork-btn" onclick={selectCustomArtwork} title={$t('playlist.setCustomArtwork')}>
<ImagePlus size={24} />
</button>
</div>
@@ -2120,7 +2120,7 @@
<!-- Playlist Metadata -->
<div class="metadata">
<span class="playlist-label">Playlist</span>
<span class="playlist-label">{$t('playlist.label')}</span>
<h1 class="playlist-title">{playlist.name}</h1>
{#if playlist.description}
<p class="playlist-description">{@html sanitizeHtml(playlist.description)}</p>
@@ -2128,12 +2128,12 @@
<div class="playlist-info">
<span class="owner">{playlist.owner.name}</span>
<span class="separator">•</span>
<span>{totalTrackCount} tracks{#if hasLocalTracks} <span class="local-count">({localTracks.length} local)</span>{/if}</span>
<span>{totalTrackCount} {$t('playlist.tracks')}{#if hasLocalTracks} <span class="local-count">({localTracks.length} local)</span>{/if}</span>
<span class="separator">•</span>
<span>{formatTotalDuration(totalDuration)}</span>
{#if playlistStats && playlistStats.play_count > 0}
<span class="separator">•</span>
<span class="play-count" title="Times played">
<span class="play-count" title={$t('playlist.playCount')}>
<BarChart2 size={12} />
{playlistStats.play_count}
</span>
@@ -2145,14 +2145,14 @@
<button
class="action-btn-circle primary"
onclick={handlePlayAll}
title="Play"
title={$t('actions.play')}
>
<Play size={20} fill="currentColor" color="currentColor" />
</button>
<button
class="action-btn-circle"
onclick={handleShuffle}
title="Shuffle"
title={$t('actions.shuffle')}
>
<Shuffle size={18} />
</button>
@@ -2160,7 +2160,7 @@
class="action-btn-circle"
class:is-active={isFavorite}
onclick={toggleFavorite}
title={isFavorite ? 'Remove from favorites' : 'Add to favorites'}
title={isFavorite ? $t('actions.removeFromFavorites') : $t('actions.addToFavorites')}
>
<Heart
size={18}
@@ -2211,7 +2211,7 @@
<Search size={16} class="search-icon" />
<input
type="text"
placeholder="Search in playlist..."
placeholder={$t('placeholders.searchInPlaylist')}
bind:value={searchQuery}
class="search-input"
/>
@@ -2225,7 +2225,7 @@
<!-- Sort dropdown -->
<div class="sort-container">
<button class="sort-btn" onclick={() => showSortMenu = !showSortMenu}>
<span>Sort: {sortOptions.find(o => o.field === sortBy)?.label}</span>
<span>{$t('sort.sort')}: {sortOptions.find(o => o.field === sortBy)?.label}</span>
<span class="chevron" class:rotated={showSortMenu}><ChevronDown size={14} /></span>
</button>
{#if showSortMenu}
@@ -2287,10 +2287,10 @@
{/if}
<div class="col-number">#</div>
<div class="col-artwork"></div>
<div class="col-title">Title</div>
<div class="col-album">Album</div>
<div class="col-duration">Duration</div>
<div class="col-quality">Quality</div>
<div class="col-title">{$t('playlist.trackTitle')}</div>
<div class="col-album">{$t('playlist.trackAlbum')}</div>
<div class="col-duration">{$t('playlist.trackDuration')}</div>
<div class="col-quality">{$t('playlist.trackQuality')}</div>
<div class="col-icon"><Heart size={14} /></div>
<div class="col-icon"><CloudDownload size={14} /></div>
<div class="col-spacer"></div>
+16 -16
View File
@@ -1143,7 +1143,7 @@
class:active={activeTab === 'all'}
onclick={() => handleTabChange('all')}
>
<span>All</span>
<span>{$t('search.all')}</span>
</button>
<button
class="tab"
@@ -1171,7 +1171,7 @@
class:active={activeTab === 'playlists'}
onclick={() => handleTabChange('playlists')}
>
<span>Playlists</span>
<span>{$t('search.playlists')}</span>
</button>
</div>
@@ -1184,7 +1184,7 @@
checked={filterType === 'MainArtist'}
onchange={() => setFilter('MainArtist')}
/>
<span>Artist</span>
<span>{$t('search.mainArtist')}</span>
</label>
<label class="filter-option">
<input
@@ -1193,7 +1193,7 @@
checked={filterType === 'Performer'}
onchange={() => setFilter('Performer')}
/>
<span>Performer</span>
<span>{$t('search.performer')}</span>
</label>
<label class="filter-option">
<input
@@ -1202,7 +1202,7 @@
checked={filterType === 'Composer'}
onchange={() => setFilter('Composer')}
/>
<span>Composer</span>
<span>{$t('search.composer')}</span>
</label>
<label class="filter-option">
<input
@@ -1211,7 +1211,7 @@
checked={filterType === 'Label'}
onchange={() => setFilter('Label')}
/>
<span>Label</span>
<span>{$t('search.label')}</span>
</label>
<label class="filter-option">
<input
@@ -1220,7 +1220,7 @@
checked={filterType === 'ReleaseName'}
onchange={() => setFilter('ReleaseName')}
/>
<span>Release</span>
<span>{$t('search.releaseName')}</span>
</label>
<button
@@ -1261,7 +1261,7 @@
<div class="top-section">
<div class="most-popular">
<div class="section-header">
<h3><Crown size={18} color="gold" /> Most Popular</h3>
<h3><Crown size={18} color="gold" /> {$t('search.mostPopular')}</h3>
</div>
<div class="most-popular-wrapper">
{#if allResults.most_popular?.type === 'artists'}
@@ -1508,7 +1508,7 @@
<div class="artists-section">
<div class="section-header">
<h3>Artists</h3>
<h3>{$t('search.artists')}</h3>
<div class="carousel-controls">
<button
class="carousel-btn"
@@ -1527,7 +1527,7 @@
<ChevronRight size={20} />
</button>
<button class="view-all-link" onclick={() => handleTabChange('artists')}>
View all ({allResults.artists.total})
{$t('search.viewAll')} ({allResults.artists.total})
</button>
</div>
</div>
@@ -1573,7 +1573,7 @@
{#if allResults.albums.items.length > 0}
<div class="albums-section">
<div class="section-header">
<h3>Albums</h3>
<h3>{$t('search.albums')}</h3>
<div class="carousel-controls">
<button
class="carousel-btn"
@@ -1592,7 +1592,7 @@
<ChevronRight size={20} />
</button>
<button class="view-all-link" onclick={() => handleTabChange('albums')}>
View all ({allResults.albums.total})
{$t('search.viewAll')} ({allResults.albums.total})
</button>
</div>
</div>
@@ -1651,9 +1651,9 @@
{#if allResults.tracks.items.length > 0}
<div class="tracks-section">
<div class="section-header">
<h3>Tracks</h3>
<h3>{$t('search.tracks')}</h3>
<button class="view-all-link" onclick={() => handleTabChange('tracks')}>
View all ({allResults.tracks.total})
{$t('search.viewAll')} ({allResults.tracks.total})
</button>
</div>
<div class="tracks-list-compact">
@@ -1769,9 +1769,9 @@
{#if allResults.playlists && allResults.playlists.items.length > 0}
<div class="playlists-section">
<div class="section-header">
<h3>Playlists</h3>
<h3>{$t('search.playlists')}</h3>
<button class="view-all-link" onclick={() => handleTabChange('playlists')}>
View all ({allResults.playlists.total})
{$t('search.viewAll')} ({allResults.playlists.total})
</button>
</div>
<div class="playlists-preview-grid">
+8
View File
@@ -97,10 +97,18 @@
"recentSearches": "Letzte Suchanfragen",
"clearHistory": "Verlauf löschen",
"startTyping": "Beginne zu tippen, um Qobuz™ zu durchsuchen",
"composer": "Komponist:in",
"label": "Label",
"mainArtist": "Künstler:in",
"mostPopular": "Top-Ergebnis",
"noAlbumsFor": "Keine Alben gefunden für \"{query}\"",
"noTracksFor": "Keine Titel gefunden für \"{query}\"",
"noArtistsFor": "Keine Künstler gefunden für \"{query}\"",
"noPlaylistsFor": "Keine Playlists gefunden für \"{query}\"",
"performer": "Weitere Interpret:innen",
"playlists": "Playlists",
"releaseName": "Album-/Track-Name",
"viewAll": "Alle sehen",
"viewMore": "Mehr anzeigen"
},
"label": {
+25 -6
View File
@@ -100,10 +100,18 @@
"recentSearches": "Recent Searches",
"clearHistory": "Clear History",
"startTyping": "Start typing to search Qobuz™",
"composer": "Composer",
"label": "Label",
"mainArtist": "Main Artist",
"mostPopular": "Most popular",
"noAlbumsFor": "No albums found for \"{query}\"",
"noTracksFor": "No tracks found for \"{query}\"",
"noArtistsFor": "No artists found for \"{query}\"",
"noPlaylistsFor": "No playlists found for \"{query}\"",
"performer": "Performer",
"playlists": "Playlists",
"releaseName": "Release Name",
"viewAll": "View all",
"viewMore": "View more"
},
"label": {
@@ -333,17 +341,22 @@
"sceneStep4": "Preparing results..."
},
"sort": {
"nameAZ": "Name (A-Z)",
"recent": "Recent",
"trackCount": "# of Tracks",
"playCount": "Play Count",
"sort": "Sort",
"addedRecently": "Added recently",
"album": "Album",
"artist": "Artist",
"custom": "Custom",
"default": "Default",
"label": "Label",
"nameAZ": "Name (A-Z)",
"newest": "Newest First",
"oldest": "Oldest First",
"playCount": "Play Count",
"recent": "Recent",
"title": "Title",
"titleAZ": "Title (A-Z)",
"titleZA": "Title (Z-A)",
"artist": "Artist"
"trackCount": "# of Tracks"
},
"playlist": {
"tracks": "tracks",
@@ -422,7 +435,13 @@
"adding": "Adding..."
},
"suggestSongs": "Suggest songs for this playlist",
"suggestionsLargePlaylist": "This playlist has many tracks. Tap the button to generate suggestions."
"suggestionsLargePlaylist": "This playlist has many tracks. Tap the button to generate suggestions.",
"trackTitle": "Title",
"trackAlbum": "Album",
"trackDuration": "Duration",
"trackQuality": "Quality",
"label": "Playlist",
"playCount": "Play count"
},
"favorites": {
"title": "Favorites",
+26 -6
View File
@@ -100,10 +100,18 @@
"recentSearches": "Búsquedas Recientes",
"clearHistory": "Limpiar Historial",
"startTyping": "Escribe para buscar en Qobuz™",
"composer": "Compositor",
"label": "Sello",
"mainArtist": "Artista Principal",
"mostPopular": "Lo más escuchado",
"noAlbumsFor": "No se encontraron álbumes para \"{query}\"",
"noTracksFor": "No se encontraron pistas para \"{query}\"",
"noArtistsFor": "No se encontraron artistas para \"{query}\"",
"noPlaylistsFor": "No se encontraron listas para \"{query}\"",
"performer": "Intérprete",
"playlists": "Playlists",
"releaseName": "Nombre Publicación",
"viewAll": "Ver todo",
"viewMore": "Ver más"
},
"label": {
@@ -333,17 +341,23 @@
"sceneStep4": "Preparando resultados..."
},
"sort": {
"nameAZ": "Nombre (A-Z)",
"recent": "Reciente",
"trackCount": "# de Pistas",
"playCount": "Reproducciones",
"sort": "Ordenar",
"addedRecently": "Fecha de incorporación",
"album": "Álbum",
"artist": "Artista",
"custom": "Personalizado",
"default": "Por defecto",
"duration": "Duración",
"label": "Sello",
"nameAZ": "Nombre (A-Z)",
"newest": "Más Nuevos",
"oldest": "Más Antiguos",
"playCount": "Reproducciones",
"recent": "Reciente",
"title": "Título",
"titleAZ": "Título (A-Z)",
"titleZA": "Título (Z-A)",
"artist": "Artista"
"trackCount": "# de Pistas"
},
"playlist": {
"tracks": "pistas",
@@ -422,7 +436,13 @@
"adding": "Agregando..."
},
"suggestSongs": "Sugerir canciones para esta lista",
"suggestionsLargePlaylist": "Esta lista tiene muchas pistas. Presiona el botón para generar sugerencias."
"suggestionsLargePlaylist": "Esta lista tiene muchas pistas. Presiona el botón para generar sugerencias.",
"trackTitle": "Título",
"trackAlbum": "Álbum",
"trackDuration": "Duración",
"trackQuality": "Calidad",
"label": "Lista",
"playCount": "Reproducciones"
},
"favorites": {
"title": "Favoritos",
+34 -8
View File
@@ -100,10 +100,18 @@
"recentSearches": "Recherches récentes",
"clearHistory": "Effacer l'historique",
"startTyping": "Commencez à taper pour rechercher sur Qobuz™",
"composer": "Compositeur",
"label": "Label",
"mainArtist": "Artiste principal",
"mostPopular": "Plus populaire",
"noAlbumsFor": "Aucun album trouvé pour « {query} »",
"noTracksFor": "Aucun titre trouvé pour « {query} »",
"noArtistsFor": "Aucun artiste trouvé pour « {query} »",
"noPlaylistsFor": "Aucune playlist trouvée pour « {query} »",
"performer": "Interprète",
"playlists": "Playlists",
"releaseName": "Nom / Titre",
"viewAll": "Voir tout",
"viewMore": "Voir plus"
},
"label": {
@@ -324,17 +332,23 @@
"sceneStep4": "Préparation des résultats..."
},
"sort": {
"nameAZ": "Nom (A-Z)",
"recent": "Récent",
"trackCount": "Nombre de titres",
"playCount": "Nombre de lectures",
"sort": "Tri",
"addedRecently": "Ajouté récemment",
"album": "Album",
"artist": "Artiste",
"custom": "Personnalisé",
"default": "Par défaut",
"duration": "Durée",
"label": "Label",
"nameAZ": "Nom (A-Z)",
"newest": "Plus récent d'abord",
"oldest": "Plus ancien d'abord",
"playCount": "Nombre de lectures",
"recent": "Récent",
"title": "Titre",
"titleAZ": "Titre (A-Z)",
"titleZA": "Titre (Z-A)",
"artist": "Artiste"
"trackCount": "Nombre de titres"
},
"playlist": {
"tracks": "titres",
@@ -401,7 +415,19 @@
"addAll": "Ajouter tous les titres",
"addNew": "Ajouter uniquement les nouveaux",
"adding": "Ajout en cours..."
}
},
"suggestSongs": "Suggérer des titres pour cette playlist",
"suggestionsLargePlaylist": "Cette playlist contient de nombreux titres. Appuyer sur le bouton pour générer des suggestions.",
"trackTitle": "Titre",
"trackAlbum": "Album",
"trackDuration": "Durée",
"trackQuality": "Qualité",
"removeCustomArtwork": "Supprimer l'illustration personnalisée",
"setCustomArtwork": "Définir une illustration personnalisée",
"label": "Playlist",
"playCount": "Nombre de lectures",
"copyToLibrary": "Copier dans la bibliothèque",
"customArtwork": "Illustration personnalisée"
},
"favorites": {
"title": "Favoris",
@@ -518,7 +544,7 @@
"mute": "Muet",
"unmute": "Réactiver le son",
"volumeUp": "Augmenter le volume",
"volumeDown": "Baisser le volume",
"volumeDown": "Diminuer le volume",
"volumeLockedHw": "Volume verrouillé à 100% — ALSA Direct hw: (réglez au niveau DAC/matériel)",
"clearQueue": "Vider la file d'attente",
"queueEmpty": "La file d'attente est vide",
@@ -1872,7 +1898,7 @@
"topMixes": {
"title": "TopQ",
"subtitle": "Depuis vos playlists les plus écoutées",
"cardDesc": "Découvrez de la musique à partir de vos playlists <strong>les plus ecoutées</strong>.",
"cardDesc": "Découvrez de la musique à partir de vos playlists <strong>les plus écoutées</strong>.",
"algorithmInfo": "Propulsé par l'algorithme de suggestion Qobuz, alimenté par vos playlists les plus écoutées.",
"emptyPlaylists": "Pas encore de playlists ecoutées. Ecoutez des playlists pour créer votre mix !"
},
+8
View File
@@ -100,10 +100,18 @@
"recentSearches": "Buscas Recentes",
"clearHistory": "Limpar Histórico",
"startTyping": "Comece a digitar para buscar no Qobuz™",
"composer": "Compositor",
"label": "Selo",
"mainArtist": "Artista Principal",
"mostPopular": "Mais populares",
"noAlbumsFor": "Nenhum álbum encontrado para \"{query}\"",
"noTracksFor": "Nenhuma faixa encontrada para \"{query}\"",
"noArtistsFor": "Nenhum artista encontrado para \"{query}\"",
"noPlaylistsFor": "Nenhuma playlist encontrada para \"{query}\"",
"performer": "Intérprete",
"playlists": "Playlists",
"releaseName": "Nome do lançamento",
"viewAll": "Ver tudo",
"viewMore": "Ver mais"
},
"label": {