fix(locale): translate home daily mix section and tray menu#32
Conversation
closes #29 - add home.dailyMix keys (title, regenerate, emptyTitle, …) to all 17 locales — HomeView previously fell back to hard-coded French strings. - localise the system tray menu: seed labels in English, stash MenuItem handles in app state, expose set_tray_labels Tauri command, push the translated labels from i18n once i18nReady resolves and on every languageChanged.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (15)
📝 WalkthroughWalkthroughThis PR implements runtime localization of system tray menu labels and adds multilingual content for new UI features. A Tauri command ( ChangesSystem Tray Localization
Sequence DiagramsequenceDiagram
participant User as User
participant Frontend as i18n Layer
participant Locale as Locale JSON
participant TauriCmd as set_tray_labels (Tauri)
participant State as App State (TrayMenuItems)
participant OS as OS Tray Menu
User->>Frontend: Change language or app starts
Frontend->>Locale: Read system.tray.* via i18n.t()
Locale-->>Frontend: Localized labels
Frontend->>TauriCmd: invoke("set_tray_labels", { playPause, previous, next, show, quit })
TauriCmd->>State: read TrayMenuItems
State-->>TauriCmd: menu item handles
TauriCmd->>OS: MenuItem.set_text(label) for each action
OS-->>User: Display localized tray menu
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Comment |
…ion, and progress bar Audit revealed 22 t() call sites whose key was absent from every locale file, so the inline fallback (mix of English and French) was the actual rendered string regardless of the user's language. Adds the keys with proper translations across all 17 locales. - playlistModal.coverChoose / coverMenu / coverChange / coverRemove / coverAutoHint / coverManualHint - sidebar.nav.spotify, playlistView.smartLabel, player.seek - settings.integrations.spotify.* (title, subtitle, clientIdPlaceholder, redirectHint, connectedAs, disconnect, connecting, connect) - spotify.deviceReady / devicePending / searchPlaceholder / tracks / playlists
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/i18n/locales/ar.json`:
- Around line 1319-1325: The Arabic locale is missing the new i18n key
spotify.emptyPlaylist, causing fallbacks to other languages; add the
spotify.emptyPlaylist property to the ar.json "spotify" object (using the same
key name spotify.emptyPlaylist as in other locales) with an appropriate Arabic
translation so all locales include this new key and maintain completeness.
In `@src/i18n/locales/de.json`:
- Around line 1319-1325: The German locale is missing the i18n key
"spotify.emptyPlaylist", causing fallback text; add "spotify.emptyPlaylist" with
the appropriate German string (e.g., "Wiedergabeliste ist leer" or preferred
translation) inside the existing "spotify" block in de.json, and then verify and
add the same key (with correct translations) to all other locale JSON files to
keep all 17 locales consistent; ensure the new key sits alongside "deviceReady",
"devicePending", "searchPlaceholder", "tracks", and "playlists".
In `@src/i18n/locales/fr.json`:
- Around line 1377-1382: The new i18n key spotify.emptyPlaylist is present in fr
but missing from other locale blocks (es, hi, id, it, ja), causing fallbacks;
add the spotify.emptyPlaylist entry to each locale's JSON "spotify" object (for
all locales listed in guidelines: en, es, de, it, nl, pt, pt-BR, ru, tr, id, ja,
ko/kr, zh-CN, zh-TW, ar, hi) using appropriate translations or a temporary
English placeholder, ensuring the key name exactly matches spotify.emptyPlaylist
so every locale contains the same i18n keys.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 63a8b06b-8ac8-4ec0-81f5-861605115620
📒 Files selected for processing (22)
src-tauri/src/commands/mod.rssrc-tauri/src/commands/tray.rssrc-tauri/src/lib.rssrc/i18n/index.tssrc/i18n/locales/ar.jsonsrc/i18n/locales/de.jsonsrc/i18n/locales/en.jsonsrc/i18n/locales/es.jsonsrc/i18n/locales/fr.jsonsrc/i18n/locales/hi.jsonsrc/i18n/locales/id.jsonsrc/i18n/locales/it.jsonsrc/i18n/locales/ja.jsonsrc/i18n/locales/kr.jsonsrc/i18n/locales/nl.jsonsrc/i18n/locales/pt-BR.jsonsrc/i18n/locales/pt.jsonsrc/i18n/locales/ru.jsonsrc/i18n/locales/tr.jsonsrc/i18n/locales/zh-CN.jsonsrc/i18n/locales/zh-TW.jsonsrc/lib/tauri/tray.ts
The key was only declared in en and fr; the other 15 locales fell back to English. Addresses coderabbit review on #32.
Closes #29.
Summary
home.dailyMix.*keys to all 17 locales — HomeView was falling back to its hard-coded French defaults (Pour vous,Régénérer,Pas encore de Daily Mix, …) because the keys were never declared.MenuItemhandles in app state (TrayMenuItems), expose aset_tray_labelsTauri command, and push the translated labels from src/i18n/index.ts oncei18nReadyresolves and on everylanguageChanged.system.tray.*keys for the 5 menu items across the 17 locales.Test plan
bun run typecheckbun run lintcargo check --manifest-path src-tauri/Cargo.toml --all-targetsSummary by CodeRabbit
New Features
Localization