Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/mail/components/context/command-palette-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ export function CommandPalette() {
/>
)}
<div className="ml-2 flex flex-1 flex-col">
<span>{item.title}</span>
<span>{t(item.title)}</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify translation key structure and add missing translations.

The change correctly adds i18n support, but there are potential issues with the current approach:

  1. Hardcoded titles: Many command titles are hardcoded English strings (e.g., "Compose Email", "Search Emails" on lines 675, 684) rather than translation keys. The t() function will look for these as keys in translation files.

  2. Inconsistent pattern: The existing group title translation (lines 779-780) uses structured keys like common.commandPalette.groups.${groupKey}, suggesting a more organized approach.

Consider updating hardcoded command titles to use proper translation keys:

-    mailCommands.push({
-      title: 'Compose Email',
-      icon: Pencil2,
+    mailCommands.push({
+      title: 'common.commandPalette.commands.composeEmail',
+      icon: Pencil2,

Run this script to identify all hardcoded command titles that need translation keys:


🏁 Script executed:

#!/bin/bash
# Find hardcoded string titles in command definitions
rg -A 2 -B 2 "title:\s*['\"](?!common\.)[^'\"]+['\"]" apps/mail/components/context/command-palette-context.tsx

Length of output: 370


🏁 Script executed:

#!/bin/bash
# Find hardcoded string titles in command definitions excluding common.* keys using PCRE2
rg --pcre2 -n -A 2 -B 2 "title:\s*['\"](?!common\.)[^'\"]+['\"]" apps/mail/components/context/command-palette-context.tsx

Length of output: 1235


Ensure all command titles use structured translation keys

The command-palette titles currently include several hardcoded English strings. To prevent missing keys at runtime and maintain consistency with existing group translations (common.commandPalette.groups.*), please convert these titles to structured keys under common.commandPalette.commands.*. Specifically:

• apps/mail/components/context/command-palette-context.tsx
– Line 458: replace 'Unread Emails'common.commandPalette.commands.unreadEmails
– Line 472: replace 'Starred Emails'common.commandPalette.commands.starredEmails
– Line 486: replace 'With Attachments'common.commandPalette.commands.withAttachments
– Line 500: replace 'Last 7 Days'common.commandPalette.commands.last7Days
– Line 675: replace 'Compose Email'common.commandPalette.commands.composeEmail
– Line 684: replace 'Search Emails'common.commandPalette.commands.searchEmails
– Line 694: replace 'Filter Emails'common.commandPalette.commands.filterEmails
– (Optional) Lines 704 & 713 for commented-out commands ('Saved Searches', 'Filter Builder') should become common.commandPalette.commands.savedSearches and common.commandPalette.commands.filterBuilder

Example diff for one command:

-      title: 'Compose Email',
+      title: 'common.commandPalette.commands.composeEmail',

Also update your translation JSON/PO files with matching entries for each new key.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In apps/mail/components/context/command-palette-context.tsx around lines 458,
472, 486, 500, 675, 684, and 694, replace hardcoded English command titles with
structured translation keys under common.commandPalette.commands.* (e.g.,
'Unread Emails' to common.commandPalette.commands.unreadEmails). This ensures
consistent i18n usage and prevents missing keys at runtime. Also update
translation JSON/PO files to include these new keys and optionally do the same
for commented-out commands on lines 704 and 713.

{item.description && (
<span className="text-muted-foreground text-xs">{item.description}</span>
)}
Expand Down