diff --git a/config/render-path-translate-baseline.txt b/config/render-path-translate-baseline.txt index 4ddea096e40..87172622471 100644 --- a/config/render-path-translate-baseline.txt +++ b/config/render-path-translate-baseline.txt @@ -1,103 +1,12 @@ # Render-path translate()/getIntlLocale() calls in components and hooks, per file. # This is a RATCHET: counts may only go DOWN. Use useTranslate()/useIntlLocale() from # @/i18n/use-translate. Prune after a fix: pnpm check:render-path-translate-ratchet --prune -8 src/renderer/src/app-shell/AppRootSurfaces.tsx -11 src/renderer/src/app-shell/AppWorkspaceShell.tsx -11 src/renderer/src/app-shell/TitlebarLeftControls.tsx -4 src/renderer/src/app-shell/TitlebarMainStrip.tsx -4 src/renderer/src/app-shell/WindowControls.tsx -2 src/renderer/src/components/BrowserCookieImportDisclosure.tsx -4 src/renderer/src/components/BrowserCookieImportMachineNotice.tsx -6 src/renderer/src/components/ClaudeAccountSwitchDialog.tsx -5 src/renderer/src/components/ClaudeAccountSwitchSessionTree.tsx -5 src/renderer/src/components/CodexRestartChip.tsx -3 src/renderer/src/components/CodexSharedSettingsNoticeCard.tsx -7 src/renderer/src/components/FirstLaunchBanner.tsx -2 src/renderer/src/components/HostedReviewUnlinkMenuItem.tsx -6 src/renderer/src/components/JiraIssueRowCopyMenu.tsx -2 src/renderer/src/components/JiraIssueWorkspace.tsx -2 src/renderer/src/components/JiraLinkedWorkspaceAction.tsx -10 src/renderer/src/components/JiraPromptTemplatePopover.tsx -14 src/renderer/src/components/Landing.tsx -3 src/renderer/src/components/LinearIssueMarkdownDescriptionEditor.tsx -14 src/renderer/src/components/LinearIssueMarkdownToolbar.tsx -2 src/renderer/src/components/LinearIssueTextEditor.tsx -2 src/renderer/src/components/LinearIssueWorkspace.tsx -9 src/renderer/src/components/LinuxPackageInstallRecoveryCard.tsx -3 src/renderer/src/components/NativeChatRemoteResumeActions.tsx -3 src/renderer/src/components/NativeChatResumeAutoNote.tsx -5 src/renderer/src/components/NativeChatResumeDialogHeader.tsx -5 src/renderer/src/components/NativeChatResumeFailureDetails.tsx -2 src/renderer/src/components/NativeChatResumeOnRestartAgentRow.tsx 4 src/renderer/src/components/NativeChatResumeOnRestartGroups.tsx -11 src/renderer/src/components/NativeChatResumeOnRestartModal.tsx -1 src/renderer/src/components/NativeChatResumeRunPanel.tsx -1 src/renderer/src/components/NativeChatResumeRunStatusIcon.tsx -6 src/renderer/src/components/NativeChatResumeRunSummary.tsx -3 src/renderer/src/components/NativeChatResumeTreeRow.tsx -3 src/renderer/src/components/NewWorkspaceComposerCard.tsx -4 src/renderer/src/components/NewWorkspaceComposerModal.tsx -4 src/renderer/src/components/OrcaSignInProgress.tsx -12 src/renderer/src/components/QuickOpen.tsx -1 src/renderer/src/components/SelectedTextCopyMenu.tsx -1 src/renderer/src/components/ShortcutKeyCombo.tsx -8 src/renderer/src/components/StarNagCard.tsx -1 src/renderer/src/components/TerminalLegacyEditorSurface.tsx -7 src/renderer/src/components/TerminalSearch.tsx -11 src/renderer/src/components/TerminalWorkspaceDialogs.tsx -12 src/renderer/src/components/UnexpectedSignoutCard.tsx -3 src/renderer/src/components/UpdateCard.tsx -11 src/renderer/src/components/UpdateErrorCardContent.tsx -3 src/renderer/src/components/WorktreeBaseFallbackDialog.tsx -3 src/renderer/src/components/ZoomOverlay.tsx 2 src/renderer/src/components/agent/AgentLaunchPromptComposer.tsx 9 src/renderer/src/components/agent/AgentLaunchSetupPanel.tsx 5 src/renderer/src/components/automations/use-external-automation-actions.ts -10 src/renderer/src/components/browser-extension-install-dialog.tsx -4 src/renderer/src/components/browser-webauthn-account-dialog.tsx -3 src/renderer/src/components/confirmation-dialog.tsx 1 src/renderer/src/components/diff-comments/useDiffCommentDecorator.tsx 2 src/renderer/src/components/editor/markdown-preview/render-tree/use-markdown-preview-components.tsx 3 src/renderer/src/components/editor/review-note-delivery/ReviewNotesSendMenuContent.tsx -10 src/renderer/src/components/gitlab-item-dialog-parts.tsx -1 src/renderer/src/components/jira-attachment-image.tsx -5 src/renderer/src/components/jira-connect-credential-guide.tsx -30 src/renderer/src/components/jira-connect-dialog.tsx -4 src/renderer/src/components/jira-issue-assignee-control.tsx -10 src/renderer/src/components/jira-issue-transition-control.tsx -5 src/renderer/src/components/jira-issue-workspace-chrome.tsx -12 src/renderer/src/components/jira-issue-workspace-content.tsx -1 src/renderer/src/components/jira-list-columns-menu.tsx -2 src/renderer/src/components/jira-project-picker.tsx -4 src/renderer/src/components/jira-transition-fields-form.tsx -4 src/renderer/src/components/jira-user-picker.tsx -19 src/renderer/src/components/linear-api-key-dialog.tsx -10 src/renderer/src/components/linear-custom-view-table-content.tsx -5 src/renderer/src/components/linear-issue-activity.tsx -9 src/renderer/src/components/linear-issue-attribute-filter-dropdowns.tsx -15 src/renderer/src/components/linear-issue-attribute-filter-sections.tsx -6 src/renderer/src/components/linear-issue-project-selector.tsx -3 src/renderer/src/components/linear-issue-sub-issues.tsx -14 src/renderer/src/components/linear-issue-workspace-header.tsx -8 src/renderer/src/components/linear-issue-workspace-sidebar.tsx -5 src/renderer/src/components/linear-item-drawer-comment-footer.tsx -3 src/renderer/src/components/linear-priority-icon.tsx -17 src/renderer/src/components/linear-project-overview-content.tsx -1 src/renderer/src/components/linear-project-overview-metadata.tsx -10 src/renderer/src/components/linear-project-table-content.tsx -9 src/renderer/src/components/linear-project-view-surfaces.tsx -8 src/renderer/src/components/linear-scope-selector.tsx -5 src/renderer/src/components/linear-workspace-picker.tsx -14 src/renderer/src/components/link-routing-preference-dialog.tsx -1 src/renderer/src/components/local-only-menu-hint.tsx -7 src/renderer/src/components/pr-check-empty-details.tsx -5 src/renderer/src/components/quick-open-install-rg-guidance.tsx 1 src/renderer/src/components/tab-group/useTabGroupCreationCommands.ts -4 src/renderer/src/components/task-project-source-combobox.tsx -1 src/renderer/src/components/use-google-cookie-clear.ts 3 src/renderer/src/components/worktree-creation/PendingNativeChatCreation.tsx -2 src/renderer/src/main.tsx -2 src/renderer/src/popout.tsx -12 src/renderer/src/web/WebConnect.tsx -1 src/renderer/src/web/WebPairingSecurityNotice.tsx -2 src/renderer/src/web/main.tsx diff --git a/src/renderer/src/app-shell/AppRootSurfaces.tsx b/src/renderer/src/app-shell/AppRootSurfaces.tsx index e5bddf19a7d..4288c87f2f4 100644 --- a/src/renderer/src/app-shell/AppRootSurfaces.tsx +++ b/src/renderer/src/app-shell/AppRootSurfaces.tsx @@ -5,7 +5,7 @@ import { useLanguageReadiness } from '../i18n/language-readiness' import { memo, Suspense } from 'react' import { createPortal } from 'react-dom' import { lazyWithRetry as lazy } from '@/lib/lazy-with-retry' -import { translate } from '@/i18n/i18n' +import { useTranslate } from '@/i18n/use-translate' import { RecoverableRenderErrorBoundary } from '../components/error-boundaries/RecoverableRenderErrorBoundary' import NewWorkspaceComposerModal from '../components/NewWorkspaceComposerModal' import { CrashReportDialog } from '../components/crash-report/CrashReportDialog' @@ -119,6 +119,7 @@ export const AppRootSurfaces = memo(function AppRootSurfaces(props: { floatingWorkspace: FloatingWorkspacePanelState onboardingGate: OnboardingGate }): React.JSX.Element { + const t = useTranslate() const { floatingWorkspace, onboardingGate } = props // Memoized: subscribe so a language change still repaints its labels. useTranslation() @@ -151,8 +152,8 @@ export const AppRootSurfaces = memo(function AppRootSurfaces(props: { @@ -346,8 +344,8 @@ export const AppRootSurfaces = memo(function AppRootSurfaces(props: { reportAsCrash={false} resetKey={activeModal} compact - title={translate('auto.App.722d03aa62', 'The crash report dialog hit an error.')} - description={translate( + title={t('auto.App.722d03aa62', 'The crash report dialog hit an error.')} + description={t( 'auto.App.acd66311dc', 'Use the Help menu after retrying if you still need diagnostics.' )} @@ -361,8 +359,8 @@ export const AppRootSurfaces = memo(function AppRootSurfaces(props: { boundaryId="modal.onboarding" surface="modal" className="fixed inset-0 z-40 bg-background" - title={translate('auto.App.f02d37278a', 'Onboarding hit an error.')} - description={translate( + title={t('auto.App.f02d37278a', 'Onboarding hit an error.')} + description={t( 'auto.App.221a95ba38', 'Retry onboarding or close it and continue in the app.' )} diff --git a/src/renderer/src/app-shell/AppWorkspaceShell.tsx b/src/renderer/src/app-shell/AppWorkspaceShell.tsx index 9540fe2cb38..4b890eccee7 100644 --- a/src/renderer/src/app-shell/AppWorkspaceShell.tsx +++ b/src/renderer/src/app-shell/AppWorkspaceShell.tsx @@ -1,6 +1,6 @@ import { memo, Suspense, useCallback, useRef } from 'react' import { lazyWithRetry as lazy } from '@/lib/lazy-with-retry' -import { translate } from '@/i18n/i18n' +import { useTranslate } from '@/i18n/use-translate' import { useAppStore } from '@/store' import { usePluginViewCaptureStore } from '@/store/plugins/capture/plugin-view-capture' import { pendingCreationOpensNativeChat } from '@/lib/workspace/creation/pending-worktree-creation' @@ -47,19 +47,20 @@ function WorktreeSidebar({ layout: AppChromeLayout scrollRefs: WorktreeSidebarScrollRefs }): React.JSX.Element { + const t = useTranslate() return ( const titlebarMainStrip = @@ -135,8 +137,8 @@ export function AppWorkspaceShell(props: { boundaryId="app.workspace-shell" surface="workspace-shell" resetKey={layout.activeView} - title={translate('auto.App.df1d56bf87', 'The workspace shell hit an error.')} - description={translate( + title={t('auto.App.df1d56bf87', 'The workspace shell hit an error.')} + description={t( 'auto.App.8504ddf267', 'The app is still running. Retry the shell or use the menu to report the crash details.' )} @@ -214,11 +216,8 @@ export function AppWorkspaceShell(props: { boundaryId="terminal.workbench" surface="terminal-workbench" resetKey="terminal" - title={translate( - 'auto.App.5a9519aef0', - 'The workspace workbench hit an error.' - )} - description={translate( + title={t('auto.App.5a9519aef0', 'The workspace workbench hit an error.')} + description={t( 'auto.App.98d4ea2823', 'Terminal, browser, or editor rendering failed in this workspace. Retry to remount it.' )} @@ -233,8 +232,8 @@ export function AppWorkspaceShell(props: { boundaryId={`page.${layout.activeView}`} surface="page" resetKey={layout.activeView} - title={translate('auto.App.b7a714db1e', 'This page hit an error.')} - description={translate( + title={t('auto.App.b7a714db1e', 'This page hit an error.')} + description={t( 'auto.App.03a14f6b5b', 'Retry the page or navigate to another Orca surface.' )} @@ -263,8 +262,8 @@ export function AppWorkspaceShell(props: { ? `${layout.rightSidebarTab}:${layout.rightSidebarExplorerView}` : layout.rightSidebarTab } - title={translate('auto.App.ed6b168d00', 'The right sidebar hit an error.')} - description={translate( + title={t('auto.App.ed6b168d00', 'The right sidebar hit an error.')} + description={t( 'auto.App.8d1e160ed1', 'Retry the sidebar or switch tabs to reload this surface.' )} diff --git a/src/renderer/src/app-shell/TitlebarLeftControls.tsx b/src/renderer/src/app-shell/TitlebarLeftControls.tsx index b620debd569..368782096ad 100644 --- a/src/renderer/src/app-shell/TitlebarLeftControls.tsx +++ b/src/renderer/src/app-shell/TitlebarLeftControls.tsx @@ -1,6 +1,6 @@ import { ArrowLeft, ArrowRight, MoreHorizontal, PanelLeft } from 'lucide-react' import logo from '../../../../resources/logo.svg' -import { translate } from '@/i18n/i18n' +import { useTranslate } from '@/i18n/use-translate' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { ContextMenu, @@ -20,6 +20,7 @@ import type { AppChromeLayout } from './use-app-chrome-layout' /** Reuse left chrome across full-width and sidebar-width headers so controls/popovers stay consistent. */ export function TitlebarLeftControls({ layout }: { layout: AppChromeLayout }): React.JSX.Element { + const t = useTranslate() const toggleSidebar = useAppStore((s) => s.toggleSidebar) const updateSettings = useAppStore((s) => s.updateSettings) const canGoBackWorktree = useAppStore(canGoBackWorktreeHistory) @@ -47,14 +48,14 @@ export function TitlebarLeftControls({ layout }: { layout: AppChromeLayout }): R - {translate('auto.App.8b0b8eb54f', 'Application menu')} + {t('auto.App.8b0b8eb54f', 'Application menu')} @@ -64,13 +65,8 @@ export function TitlebarLeftControls({ layout }: { layout: AppChromeLayout }): R {layout.showSidebar && !hasCustomTitleBar && layout.showTitlebarAppName && ( -
- - {translate('auto.App.5096cbbc86', 'Orca')} - +
+ {t('auto.App.5096cbbc86', 'Orca')}
@@ -79,7 +75,7 @@ export function TitlebarLeftControls({ layout }: { layout: AppChromeLayout }): R void updateSettings({ showTitlebarAppName: false }) }} > - {translate('auto.App.e81217c1b7', 'Hide App Name')} + {t('auto.App.e81217c1b7', 'Hide App Name')} @@ -90,13 +86,13 @@ export function TitlebarLeftControls({ layout }: { layout: AppChromeLayout }): R - {translate('auto.App.ce37cf5279', 'Toggle sidebar ({{value0}})', { + {t('auto.App.ce37cf5279', 'Toggle sidebar ({{value0}})', { value0: leftSidebarShortcutLabel })} @@ -113,13 +109,13 @@ export function TitlebarLeftControls({ layout }: { layout: AppChromeLayout }): R className="sidebar-toggle sidebar-toggle-compact" onClick={() => useAppStore.getState().goBackWorktree()} disabled={!canGoBackWorktree} - aria-label={translate('auto.App.064bd07810', 'Go back')} + aria-label={t('auto.App.064bd07810', 'Go back')} > - {translate('auto.App.fe21e8f6f5', 'Go back ({{value0}})', { + {t('auto.App.fe21e8f6f5', 'Go back ({{value0}})', { value0: historyBackShortcutLabel })} @@ -130,13 +126,13 @@ export function TitlebarLeftControls({ layout }: { layout: AppChromeLayout }): R className="sidebar-toggle sidebar-toggle-compact" onClick={() => useAppStore.getState().goForwardWorktree()} disabled={!canGoForwardWorktree} - aria-label={translate('auto.App.cf9099fe98', 'Go forward')} + aria-label={t('auto.App.cf9099fe98', 'Go forward')} > - {translate('auto.App.f7aa73e785', 'Go forward ({{value0}})', { + {t('auto.App.f7aa73e785', 'Go forward ({{value0}})', { value0: historyForwardShortcutLabel })} diff --git a/src/renderer/src/app-shell/TitlebarMainStrip.tsx b/src/renderer/src/app-shell/TitlebarMainStrip.tsx index 475ea5c5471..bf9b5576350 100644 --- a/src/renderer/src/app-shell/TitlebarMainStrip.tsx +++ b/src/renderer/src/app-shell/TitlebarMainStrip.tsx @@ -1,5 +1,5 @@ import { Minimize2, PanelRight } from 'lucide-react' -import { translate } from '@/i18n/i18n' +import { useTranslate } from '@/i18n/use-translate' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { TOGGLE_TERMINAL_PANE_EXPAND_EVENT } from '@/constants/terminal' import { ActivityTitlebarControls } from '../components/activity/ActivityTitlebarControls' @@ -10,6 +10,7 @@ import { hasCustomTitleBar } from './app-window-chrome' import type { AppChromeLayout } from './use-app-chrome-layout' export function RightSidebarToggle(): React.JSX.Element { + const t = useTranslate() const toggleRightSidebar = useAppStore((s) => s.toggleRightSidebar) const rightSidebarShortcutLabel = useShortcutLabel('sidebar.right.toggle') return ( @@ -18,13 +19,13 @@ export function RightSidebarToggle(): React.JSX.Element { - {translate('auto.App.c184e056de', 'Toggle right sidebar ({{value0}})', { + {t('auto.App.c184e056de', 'Toggle right sidebar ({{value0}})', { value0: rightSidebarShortcutLabel })} @@ -33,6 +34,7 @@ export function RightSidebarToggle(): React.JSX.Element { } export function TitlebarMainStrip({ layout }: { layout: AppChromeLayout }): React.JSX.Element { + const t = useTranslate() const handleToggleExpand = (): void => { const { effectiveActiveTabId } = selectActiveTerminalChromeState(useAppStore.getState()) if (!effectiveActiveTabId) { @@ -61,14 +63,14 @@ export function TitlebarMainStrip({ layout }: { layout: AppChromeLayout }): Reac - {translate('auto.App.c1cf0b0e4a', 'Collapse pane')} + {t('auto.App.c1cf0b0e4a', 'Collapse pane')} )} diff --git a/src/renderer/src/app-shell/WindowControls.tsx b/src/renderer/src/app-shell/WindowControls.tsx index 409b68241c0..97c1f71ab30 100644 --- a/src/renderer/src/app-shell/WindowControls.tsx +++ b/src/renderer/src/app-shell/WindowControls.tsx @@ -1,8 +1,9 @@ import { useEffect, useState } from 'react' -import { translate } from '@/i18n/i18n' +import { useTranslate } from '@/i18n/use-translate' // Windows/Linux replace native chrome with renderer controls. export function WindowControls(): React.JSX.Element { + const t = useTranslate() const [maximized, setMaximized] = useState(false) useEffect(() => { // Seed maximization from main; transition events alone miss startup-maximized windows. @@ -22,7 +23,7 @@ export function WindowControls(): React.JSX.Element {
@@ -139,18 +140,18 @@ function SwitchPromptDialog({ prompt }: { prompt: ClaudeAccountSwitchPrompt }): ) } -function promptDescription(prompt: ClaudeAccountSwitchPrompt): string { +function promptDescription(prompt: ClaudeAccountSwitchPrompt, t: Translate = translate): string { const { onAccount, elsewhere, cantMove } = prompt.sessions const next = prompt.nextAccountLabel if (prompt.review) { const count = elsewhere.length + cantMove.length - return translate( + return t( 'accounts.claude.switchSessions.reviewBody', "{{count}} other Claude sessions weren't moved to {{next}}.", { count, next, defaultValue_one: "{{count}} other Claude session wasn't moved to {{next}}." } ) } - return translate( + return t( 'accounts.claude.switchSessions.body', '{{count}} Claude sessions are still running on {{previous}}. Restarting continues each conversation on {{next}}. Busy sessions wait for idle before restarting.', { diff --git a/src/renderer/src/components/ClaudeAccountSwitchSessionTree.tsx b/src/renderer/src/components/ClaudeAccountSwitchSessionTree.tsx index 9ec3cb39102..f4e08c63edf 100644 --- a/src/renderer/src/components/ClaudeAccountSwitchSessionTree.tsx +++ b/src/renderer/src/components/ClaudeAccountSwitchSessionTree.tsx @@ -1,6 +1,7 @@ import { Fragment, useLayoutEffect, useRef, useState } from 'react' import { Folder, GitBranch } from 'lucide-react' import { translate } from '@/i18n/i18n' +import { useTranslate, type Translate } from '@/i18n/use-translate' import { AgentIcon } from '@/lib/agent-catalog' import { formatAgentTypeLabel } from '../../../shared/agent-status/presentation/agent-type-label' import type { ClaudeAccountSwitchPromptSessions } from '@/lib/claude-account-switch-sessions' @@ -46,7 +47,8 @@ export function ClaudeAccountSwitchSessionTree({ sessions: ClaudeAccountSwitchPromptSessions previousAccountLabel: string }): React.JSX.Element { - const groups = sessionGroups(sessions, previousAccountLabel) + const t = useTranslate() + const groups = sessionGroups(sessions, previousAccountLabel, t) const treeRef = useRef(null) const pinnedIndex = useNextGroupBelowFold(treeRef, groups.length) return ( @@ -54,10 +56,7 @@ export function ClaudeAccountSwitchSessionTree({ ref={treeRef} role="tree" tabIndex={0} - aria-label={translate( - 'accounts.claude.switchSessions.listLabel', - 'Claude sessions to restart' - )} + aria-label={t('accounts.claude.switchSessions.listLabel', 'Claude sessions to restart')} className="relative max-h-64 min-h-0 scroll-py-8 overflow-y-auto scrollbar-sleek rounded-md bg-worktree-sidebar p-1.5 pb-2" onKeyDown={moveInTree} > @@ -121,29 +120,30 @@ function useNextGroupBelowFold( function sessionGroups( sessions: ClaudeAccountSwitchPromptSessions, - previousAccountLabel: string + previousAccountLabel: string, + t: Translate = translate ): SessionGroup[] { const groups: SessionGroup[] = [ { key: 'on-account', - title: translate('accounts.claude.switchSessions.groupOnAccount', 'Running on {{account}}', { + title: t('accounts.claude.switchSessions.groupOnAccount', 'Running on {{account}}', { account: previousAccountLabel }), sessions: sessions.onAccount }, { key: 'elsewhere', - title: translate('accounts.claude.switchSessions.groupElsewhere', 'Not on {{account}}', { + title: t('accounts.claude.switchSessions.groupElsewhere', 'Not on {{account}}', { account: previousAccountLabel }), sessions: sessions.elsewhere.map((session) => ({ ...session, reason: session.accountLabel })) }, { key: 'cant-move', - title: translate('accounts.claude.switchSessions.groupCantMove', "Can't move"), + title: t('accounts.claude.switchSessions.groupCantMove', "Can't move"), sessions: sessions.cantMove.map((session) => ({ ...session, - reason: cantMoveReasonLabel(session.reason) + reason: cantMoveReasonLabel(session.reason, t) })), fixed: true } @@ -151,24 +151,21 @@ function sessionGroups( return groups.filter((group) => group.sessions.length > 0) } -function cantMoveReasonLabel(reason: ClaudeSessionCantMoveReason): string { +function cantMoveReasonLabel( + reason: ClaudeSessionCantMoveReason, + t: Translate = translate +): string { switch (reason) { case 'wsl-terminal': - return translate('accounts.claude.switchSessions.reasonWsl', 'WSL terminal') + return t('accounts.claude.switchSessions.reasonWsl', 'WSL terminal') case 'own-folder': - return translate( - 'accounts.claude.switchSessions.reasonOwnFolder', - 'Uses your own Claude folder' - ) + return t('accounts.claude.switchSessions.reasonOwnFolder', 'Uses your own Claude folder') case 'unknown-account': - return translate('accounts.claude.switchSessions.reasonUnknownAccount', 'Account unknown') + return t('accounts.claude.switchSessions.reasonUnknownAccount', 'Account unknown') case 'no-session': - return translate('accounts.claude.switchSessions.reasonNoSession', "Can't resume") + return t('accounts.claude.switchSessions.reasonNoSession', "Can't resume") case 'shared-session': - return translate( - 'accounts.claude.switchSessions.reasonSharedSession', - 'Also open in another pane' - ) + return t('accounts.claude.switchSessions.reasonSharedSession', 'Also open in another pane') } } @@ -189,6 +186,7 @@ function GroupHeader({ selected, onToggle }: SessionTreeProps & { group: SessionGroup; pinnedToBottom: boolean }): React.JSX.Element { + const t = useTranslate() const ptyIds = group.sessions.map((session) => session.ptyId) const selection = resumeSelectionState(ptyIds, selected) return ( @@ -203,7 +201,7 @@ function GroupHeader({ disabled={false} checkboxSlot={group.fixed ? EMPTY_CHECKBOX_SLOT : undefined} onCheckedChange={() => toggleResumeSelection(ptyIds, selection, onToggle)} - checkboxLabel={translate( + checkboxLabel={t( 'accounts.claude.switchSessions.selectGroup', 'Select all sessions in {{group}}', { group: group.title } @@ -268,6 +266,7 @@ function SessionRow({ checked: boolean onToggle: (ptyId: string, checked: boolean) => void }): React.JSX.Element { + const t = useTranslate() const paneKey = makePaneKey(session.tabId, session.leafId) const tabTitle = useAppStore((store) => { const tab = store.tabsByWorktree[session.worktreeId]?.find( @@ -278,7 +277,7 @@ function SessionRow({ const lastPrompt = useAppStore((store) => store.agentStatusByPaneKey[paneKey]?.prompt?.trim()) const busy = useAppStore((store) => isClaudePaneMidTurn(store, paneKey)) const title = - lastPrompt || tabTitle || translate('accounts.claude.switchSessions.session', 'Claude session') + lastPrompt || tabTitle || t('accounts.claude.switchSessions.session', 'Claude session') return ( {session.reason ?? (busy - ? translate('accounts.claude.switchSessions.busy', 'Working') - : translate('accounts.claude.switchSessions.idle', 'Idle'))} + ? t('accounts.claude.switchSessions.busy', 'Working') + : t('accounts.claude.switchSessions.idle', 'Idle'))} ) diff --git a/src/renderer/src/components/CodexRestartChip.tsx b/src/renderer/src/components/CodexRestartChip.tsx index 4a522d42b63..04e75cf5470 100644 --- a/src/renderer/src/components/CodexRestartChip.tsx +++ b/src/renderer/src/components/CodexRestartChip.tsx @@ -2,7 +2,7 @@ import { useEffect, useId, useRef } from 'react' import { RefreshCw } from 'lucide-react' import { Button } from '@/components/ui/button' import { useAppStore } from '../store' -import { translate } from '@/i18n/i18n' +import { useTranslate } from '@/i18n/use-translate' import { shouldFocusMobileDriverAction } from './terminal-pane/mobile-driver/mobile-driver-overlay-focus' import { awaitsCodexRestartAnswer } from './codex-restart-notice-state' @@ -73,6 +73,7 @@ function LoudRestartOverlay({ onDismiss: () => void onRestart: () => void }): React.JSX.Element { + const t = useTranslate() const titleId = useId() const bodyId = useId() const rootRef = useRef(null) @@ -129,10 +130,10 @@ function LoudRestartOverlay({
- {translate('auto.components.CodexRestartChip.d3e8a1f4b2', 'Account switched')} + {t('auto.components.CodexRestartChip.d3e8a1f4b2', 'Account switched')}
- {translate( + {t( 'auto.components.CodexRestartChip.a4c8e1b2f7', 'Codex is still signed in as {{value0}}', { value0: restartNotice.previousAccountLabel } @@ -141,7 +142,7 @@ function LoudRestartOverlay({
- {translate( + {t( 'auto.components.CodexRestartChip.9375620cc3', 'Restart this session to use {{value0}}. It stays on the previous account until you do.', { value0: restartNotice.nextAccountLabel } @@ -149,11 +150,11 @@ function LoudRestartOverlay({
diff --git a/src/renderer/src/components/CodexSharedSettingsNoticeCard.tsx b/src/renderer/src/components/CodexSharedSettingsNoticeCard.tsx index ba4d6065a88..e49400101b7 100644 --- a/src/renderer/src/components/CodexSharedSettingsNoticeCard.tsx +++ b/src/renderer/src/components/CodexSharedSettingsNoticeCard.tsx @@ -1,11 +1,12 @@ import { Info, X } from 'lucide-react' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from './ui/card' import { Button } from './ui/button' -import { translate } from '@/i18n/i18n' +import { useTranslate } from '@/i18n/use-translate' import { useCodexSharedSettingsNotice } from './terminal-pane/provider-notices/codex-settings/codex-shared-settings-notice' /** A persistent one-time notice, so it sits with the other cards rather than as a sticky toast. */ export function CodexSharedSettingsNoticeCard(): React.JSX.Element | null { + const t = useTranslate() const { visible, dismiss } = useCodexSharedSettingsNotice() if (!visible) { return null @@ -17,17 +18,14 @@ export function CodexSharedSettingsNoticeCard(): React.JSX.Element | null {
- {translate( - 'terminal.codexSharedSettingsNotice.title', - 'Codex in Orca now uses ~/.codex' - )} + {t('terminal.codexSharedSettingsNotice.title', 'Codex in Orca now uses ~/.codex')}
@@ -35,7 +33,7 @@ export function CodexSharedSettingsNoticeCard(): React.JSX.Element | null { - {translate( + {t( 'terminal.codexSharedSettingsNotice.description', 'Codex may ask again to trust folders or approve commands. Re-add any MCP servers you added only in Orca.' )} diff --git a/src/renderer/src/components/FirstLaunchBanner.tsx b/src/renderer/src/components/FirstLaunchBanner.tsx index 953d598981b..1a40a437175 100644 --- a/src/renderer/src/components/FirstLaunchBanner.tsx +++ b/src/renderer/src/components/FirstLaunchBanner.tsx @@ -6,7 +6,7 @@ import { X } from 'lucide-react' import { Button } from './ui/button' import { acknowledgeBanner, PRIVACY_URL, setOptIn as telemetrySetOptIn } from '../lib/telemetry' import { useMountedRef } from '@/hooks/useMountedRef' -import { translate } from '@/i18n/i18n' +import { useTranslate } from '@/i18n/use-translate' import { openAppHttpLink } from '@/lib/browser/navigation/app-http-link-open' type FirstLaunchBannerProps = { @@ -18,6 +18,7 @@ export function FirstLaunchBanner({ onResolve, fetchSettings }: FirstLaunchBannerProps): React.JSX.Element { + const t = useTranslate() // Prevent duplicate opt-outs being retagged as settings-origin on a second click. const [inFlight, setInFlight] = useState(false) const mountedRef = useMountedRef() @@ -66,19 +67,16 @@ export function FirstLaunchBanner({
{/* Let text shrink without wrapping the action column. */}

- {translate( - 'auto.components.FirstLaunchBanner.9784b4d7bc', - 'Help us decide what to build next' - )} + {t('auto.components.FirstLaunchBanner.9784b4d7bc', 'Help us decide what to build next')}

- {translate( + {t( 'auto.components.FirstLaunchBanner.958d2cc31b', 'Anonymous counts of which features you use help us prioritize what to build. No file contents, prompts, terminal output, or anything that identifies you. Change anytime in Settings -> Privacy & Telemetry.' )}{' '} @@ -87,7 +85,7 @@ export function FirstLaunchBanner({ className="underline underline-offset-2 hover:text-foreground" onClick={(event) => openAppHttpLink(PRIVACY_URL, { event })} > - {translate('auto.components.FirstLaunchBanner.d1deebb050', 'Privacy policy')} + {t('auto.components.FirstLaunchBanner.d1deebb050', 'Privacy policy')} .

@@ -101,16 +99,16 @@ export function FirstLaunchBanner({ disabled={inFlight} className="border-border/60 text-muted-foreground" > - {translate('auto.components.FirstLaunchBanner.fc5cc29955', 'Opt out')} + {t('auto.components.FirstLaunchBanner.fc5cc29955', 'Opt out')}
{/* Dismiss persists opt-in; it does more than hide the notice. */}