diff --git a/src/components/ContextMenu.tsx b/src/components/ContextMenu.tsx index 40f13c90..16186a68 100644 --- a/src/components/ContextMenu.tsx +++ b/src/components/ContextMenu.tsx @@ -49,6 +49,13 @@ export function AddToPlaylistSubmenu({ songIds, onDone, dropDown, triggerId }: { const recentIds = usePlaylistStore((s) => s.recentIds); const createPlaylist = usePlaylistStore((s) => s.createPlaylist); const touchPlaylist = usePlaylistStore((s) => s.touchPlaylist); + const fetchPlaylists = usePlaylistStore((s) => s.fetchPlaylists); + + // Fetch playlists on first open if the store hasn't been populated yet + useEffect(() => { + if (storePlaylists.length === 0) fetchPlaylists(); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); // Sort playlists by recent usage const playlists = useMemo(() => { diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index fdf3a318..a367a971 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -250,8 +250,8 @@ export default function Sidebar({ className={`sidebar-playlists-toggle ${playlistsExpanded ? 'expanded' : ''}`} onClick={() => setPlaylistsExpanded(!playlistsExpanded)} aria-expanded={playlistsExpanded} - aria-label={playlistsExpanded ? 'Colapsar listas' : 'Expandir listas'} - title={playlistsExpanded ? 'Colapsar listas' : 'Expandir listas'} + aria-label={playlistsExpanded ? t('sidebar.collapsePlaylists') : t('sidebar.expandPlaylists')} + data-tooltip={playlistsExpanded ? t('sidebar.collapsePlaylists') : t('sidebar.expandPlaylists')} > diff --git a/src/locales/de.ts b/src/locales/de.ts index 6ecf447a..b3891b3d 100644 --- a/src/locales/de.ts +++ b/src/locales/de.ts @@ -26,6 +26,8 @@ export const deTranslation = { folderBrowser: 'Ordner-Browser', libraryScope: 'Bibliotheksumfang', allLibraries: 'Alle Bibliotheken', + expandPlaylists: 'Playlists ausklappen', + collapsePlaylists: 'Playlists einklappen', }, home: { hero: 'Featured', diff --git a/src/locales/en.ts b/src/locales/en.ts index e0d1d68d..5dd4f821 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -27,6 +27,8 @@ export const enTranslation = { folderBrowser: 'Folder Browser', libraryScope: 'Library scope', allLibraries: 'All libraries', + expandPlaylists: 'Expand playlists', + collapsePlaylists: 'Collapse playlists', }, home: { hero: 'Featured', diff --git a/src/locales/es.ts b/src/locales/es.ts index e719e5b0..5d74386a 100644 --- a/src/locales/es.ts +++ b/src/locales/es.ts @@ -27,6 +27,8 @@ export const esTranslation = { folderBrowser: 'Explorar Carpetas', libraryScope: 'Ámbito de biblioteca', allLibraries: 'Todas las bibliotecas', + expandPlaylists: 'Expandir listas', + collapsePlaylists: 'Colapsar listas', }, home: { hero: 'Destacado', diff --git a/src/locales/fr.ts b/src/locales/fr.ts index dcfac669..90aeedef 100644 --- a/src/locales/fr.ts +++ b/src/locales/fr.ts @@ -26,6 +26,8 @@ export const frTranslation = { folderBrowser: 'Explorateur de dossiers', libraryScope: 'Portée de la bibliothèque', allLibraries: 'Toutes les bibliothèques', + expandPlaylists: 'Développer les playlists', + collapsePlaylists: 'Réduire les playlists', }, home: { hero: 'En vedette', diff --git a/src/locales/nb.ts b/src/locales/nb.ts index a76fad14..0556bfc7 100644 --- a/src/locales/nb.ts +++ b/src/locales/nb.ts @@ -26,6 +26,8 @@ export const nbTranslation = { folderBrowser: 'Mappeleser', libraryScope: 'Biblioteksomfang', allLibraries: 'Alle biblioteker', + expandPlaylists: 'Utvid spillelister', + collapsePlaylists: 'Skjul spillelister', }, home: { hero: 'Utvalgt', diff --git a/src/locales/nl.ts b/src/locales/nl.ts index 9c90db27..8979e68c 100644 --- a/src/locales/nl.ts +++ b/src/locales/nl.ts @@ -26,6 +26,8 @@ export const nlTranslation = { folderBrowser: 'Mappenverkenner', libraryScope: 'Bibliotheekbereik', allLibraries: 'Alle bibliotheken', + expandPlaylists: 'Afspeellijsten uitklappen', + collapsePlaylists: 'Afspeellijsten inklappen', }, home: { hero: 'Uitgelicht', diff --git a/src/locales/ru.ts b/src/locales/ru.ts index e1beca09..442ea9eb 100644 --- a/src/locales/ru.ts +++ b/src/locales/ru.ts @@ -27,6 +27,8 @@ export const ruTranslation = { folderBrowser: 'Браузер папок', libraryScope: 'Область медиатеки', allLibraries: 'Все библиотеки', + expandPlaylists: 'Развернуть плейлисты', + collapsePlaylists: 'Свернуть плейлисты', }, home: { hero: 'Подборка', diff --git a/src/locales/zh.ts b/src/locales/zh.ts index 2c92d681..bf51c166 100644 --- a/src/locales/zh.ts +++ b/src/locales/zh.ts @@ -26,6 +26,8 @@ export const zhTranslation = { folderBrowser: '文件夹浏览器', libraryScope: '资料库范围', allLibraries: '所有资料库', + expandPlaylists: '展开播放列表', + collapsePlaylists: '收起播放列表', }, home: { hero: '精选',