Skip to content

fix(locale): translate home daily mix section and tray menu#32

Merged
InstaZDLL merged 3 commits into
mainfrom
fix/i18n-untranslated-home-tray
May 16, 2026
Merged

fix(locale): translate home daily mix section and tray menu#32
InstaZDLL merged 3 commits into
mainfrom
fix/i18n-untranslated-home-tray

Conversation

@InstaZDLL
Copy link
Copy Markdown
Owner

@InstaZDLL InstaZDLL commented May 16, 2026

Closes #29.

Summary

  • Add 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.
  • Localise the system tray menu. The tray is built in Rust at startup before i18next has loaded, so we seed the labels in English, stash the MenuItem handles in app state (TrayMenuItems), expose a set_tray_labels Tauri command, and push the translated labels from src/i18n/index.ts once i18nReady resolves and on every languageChanged.
  • Add system.tray.* keys for the 5 menu items across the 17 locales.

Test plan

  • bun run typecheck
  • bun run lint
  • cargo check --manifest-path src-tauri/Cargo.toml --all-targets
  • Manual: switch UI language to English → verify home "For you / Regenerate / No Daily Mix yet…" + tray menu retitles to English.
  • Manual: switch back to French → tray menu updates live without restart.

Summary by CodeRabbit

  • New Features

    • System tray menu now updates dynamically with your selected language (tray labels sync at startup and on language change)
    • Spotify connection UI added to Settings
    • Daily Mix support on Home and Playlist views
    • Seek position display added to player controls
    • Improved playlist cover selection and management
  • Localization

    • Translations added/updated for all new features across 15+ languages (including tray labels)

Review Change Stack

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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: da64fcf5-ab7e-4395-838a-ad823ebf9d8f

📥 Commits

Reviewing files that changed from the base of the PR and between dd1d7a7 and fe3aa19.

📒 Files selected for processing (15)
  • src/i18n/locales/ar.json
  • src/i18n/locales/de.json
  • src/i18n/locales/es.json
  • src/i18n/locales/hi.json
  • src/i18n/locales/id.json
  • src/i18n/locales/it.json
  • src/i18n/locales/ja.json
  • src/i18n/locales/kr.json
  • src/i18n/locales/nl.json
  • src/i18n/locales/pt-BR.json
  • src/i18n/locales/pt.json
  • src/i18n/locales/ru.json
  • src/i18n/locales/tr.json
  • src/i18n/locales/zh-CN.json
  • src/i18n/locales/zh-TW.json

📝 Walkthrough

Walkthrough

This PR implements runtime localization of system tray menu labels and adds multilingual content for new UI features. A Tauri command (set_tray_labels) receives localized label strings from the frontend and applies them to stored menu item handles. The i18n layer invokes this command on initialization and whenever the user changes languages, sourcing labels from locale files.

Changes

System Tray Localization

Layer / File(s) Summary
Tray command backend and data structures
src-tauri/src/commands/tray.rs
TrayMenuItems<R> stores five tray menu item handles; TrayLabels deserializes camelCase-localized strings; set_tray_labels reads state and applies labels via set_text().
Tauri app setup with tray storage and registration
src-tauri/src/commands/mod.rs, src-tauri/src/lib.rs
Exports the tray commands module, seeds tray menu with English MenuItem::with_id items, stores handles via app.manage(TrayMenuItems), and registers commands::tray::set_tray_labels in invoke_handler!.
TypeScript invocation bridge
src/lib/tauri/tray.ts
Adds TrayLabels interface and setTrayLabels(labels) to invoke the Tauri "set_tray_labels" command from the frontend.
i18n integration and wiring
src/i18n/index.ts
Imports setTrayLabels, adds pushTrayLabels() to read system.tray.* via i18n.t() and invoke the command (errors ignored), and wires the push on i18n init and languageChanged.
Multilingual locale content
src/i18n/locales/{en,ar,de,es,fr,hi,id,it,ja,kr,nl,pt-BR,pt,ru,tr,zh-CN,zh-TW}.json
Adds system.tray.* tray action labels and related UI strings (home.recentlyAdded.dailyMix, player.seek, playlistModal cover keys, playlistView.smartLabel, settings.integrations.spotify) across locales so the frontend can supply localized tray labels.

Sequence Diagram

sequenceDiagram
  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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Whiskers twitch at dawn’s new light,

Tray labels dressed in languages bright,
From frontend song to system tray,
Sixteen tongues now lead the way,
Hooray — the rabbit hops in delight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'fix(locale): translate home daily mix section and tray menu' directly addresses the primary objective of the changeset: adding translations for the Home Daily Mix section and tray menu items. The title clearly and concisely summarizes the main changes.
Description check ✅ Passed The PR description comprehensively covers the objectives, test plan, and key implementation details. All required sections from the template are populated with meaningful content, including a summary of changes, testing steps completed, and linked issue reference.
Linked Issues check ✅ Passed The changeset fully addresses the requirements from issue #29: it adds missing translation keys for the Home Daily Mix section across all 17 locales, implements tray menu localization by exposing a Tauri command to update labels at runtime, and provides system.tray translation keys for all five menu items.
Out of Scope Changes check ✅ Passed All changes directly support the stated objectives of fixing untranslated UI text in the Home Daily Mix section and tray menu. The additions of locale keys, Tauri command implementation, and i18n integration are all in scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/i18n-untranslated-home-tray

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 @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added scope: frontend React/Vite frontend (src/) scope: backend Rust/Tauri backend (src-tauri/) scope: i18n Translations (src/i18n/) type: fix Bug fix size: l 200-500 lines labels May 16, 2026
@InstaZDLL InstaZDLL self-assigned this May 16, 2026
…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
@github-actions github-actions Bot added size: xl > 500 lines and removed size: l 200-500 lines labels May 16, 2026
@coderabbitai coderabbitai Bot added the type: feat New feature label May 16, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 921678b and dd1d7a7.

📒 Files selected for processing (22)
  • src-tauri/src/commands/mod.rs
  • src-tauri/src/commands/tray.rs
  • src-tauri/src/lib.rs
  • src/i18n/index.ts
  • src/i18n/locales/ar.json
  • src/i18n/locales/de.json
  • src/i18n/locales/en.json
  • src/i18n/locales/es.json
  • src/i18n/locales/fr.json
  • src/i18n/locales/hi.json
  • src/i18n/locales/id.json
  • src/i18n/locales/it.json
  • src/i18n/locales/ja.json
  • src/i18n/locales/kr.json
  • src/i18n/locales/nl.json
  • src/i18n/locales/pt-BR.json
  • src/i18n/locales/pt.json
  • src/i18n/locales/ru.json
  • src/i18n/locales/tr.json
  • src/i18n/locales/zh-CN.json
  • src/i18n/locales/zh-TW.json
  • src/lib/tauri/tray.ts

Comment thread src/i18n/locales/ar.json
Comment thread src/i18n/locales/de.json
Comment thread src/i18n/locales/fr.json
The key was only declared in en and fr; the other 15 locales fell back
to English. Addresses coderabbit review on #32.
@InstaZDLL InstaZDLL enabled auto-merge May 16, 2026 14:36
@InstaZDLL InstaZDLL merged commit 9bbdd64 into main May 16, 2026
13 checks passed
@InstaZDLL InstaZDLL deleted the fix/i18n-untranslated-home-tray branch May 16, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: backend Rust/Tauri backend (src-tauri/) scope: frontend React/Vite frontend (src/) scope: i18n Translations (src/i18n/) size: xl > 500 lines type: feat New feature type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: some places text not in english

1 participant