refactor(i18n): read render-path translations from useTranslate in the remaining renderer files (top-level components, app shell, entry points, hooks, lib) (#39427)

Applies pnpm i18n:reactive-translate --helpers. Output is unchanged: t delegates
to translate() and helpers default the threaded parameter.

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
OrcaWin
2026-11-07 22:03:03 -08:00
committed by GitHub
co-authored by OrcaWin
parent d50ca31308
commit 800ed1976e
136 changed files with 1657 additions and 1772 deletions
-91
View File
@@ -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
+10 -12
View File
@@ -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: {
<OverlayBoundary
boundaryId="overlay.floating-workspace"
resetKey={floatingWorkspace.open}
title={translate('auto.App.1b3024bcd6', 'The floating workspace hit an error.')}
description={translate(
title={t('auto.App.1b3024bcd6', 'The floating workspace hit an error.')}
description={t(
'auto.App.7cbfbf622f',
'Retry the floating workspace or close and reopen it.'
)}
@@ -174,11 +175,8 @@ export const AppRootSurfaces = memo(function AppRootSurfaces(props: {
<OverlayBoundary
boundaryId="overlay.status-bar"
resetKey={activeView}
title={translate('auto.App.2e8ff36f94', 'The status bar hit an error.')}
description={translate(
'auto.App.8a023cea1f',
'Retry the status bar to remount its controls.'
)}
title={t('auto.App.2e8ff36f94', 'The status bar hit an error.')}
description={t('auto.App.8a023cea1f', 'Retry the status bar to remount its controls.')}
>
<StatusBar floatingTerminalOpen={floatingWorkspace.open} />
</OverlayBoundary>
@@ -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.'
)}
@@ -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 (
<RecoverableRenderErrorBoundary
boundaryId="sidebar.worktrees"
surface="sidebar"
resetKey={layout.activeView}
title={translate('auto.App.1468601e7b', 'The workspace list hit an error.')}
title={t('auto.App.1468601e7b', 'The workspace list hit an error.')}
description={
layout.leftTitlebarChromeLayout.shouldMount
? translate(
? t(
'auto.App.bdc71dddc9',
'The active workspace remains open. Retry the list or switch views.'
)
: translate(
: t(
'auto.App.cba0fafda5',
'The active page remains open. Retry the list or switch views.'
)
@@ -114,6 +115,7 @@ export function AppWorkspaceShell(props: {
layout: AppChromeLayout
floatingWorkspace: FloatingWorkspacePanelState
}): React.JSX.Element {
const t = useTranslate()
const { layout, floatingWorkspace } = props
const titlebarLeftControls = <TitlebarLeftControls layout={layout} />
const titlebarMainStrip = <TitlebarMainStrip layout={layout} />
@@ -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.'
)}
@@ -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
<TooltipTrigger asChild>
<button
className="titlebar-icon-button"
aria-label={translate('auto.App.8b0b8eb54f', 'Application menu')}
aria-label={t('auto.App.8b0b8eb54f', 'Application menu')}
onClick={() => window.api.ui.popupMenu()}
>
<MoreHorizontal size={14} />
</button>
</TooltipTrigger>
<TooltipContent side="bottom" sideOffset={6}>
{translate('auto.App.8b0b8eb54f', 'Application menu')}
{t('auto.App.8b0b8eb54f', 'Application menu')}
</TooltipContent>
</Tooltip>
</>
@@ -64,13 +65,8 @@ export function TitlebarLeftControls({ layout }: { layout: AppChromeLayout }): R
{layout.showSidebar && !hasCustomTitleBar && layout.showTitlebarAppName && (
<ContextMenu>
<ContextMenuTrigger asChild>
<div
className="titlebar-app-name"
aria-label={translate('auto.App.5096cbbc86', 'Orca')}
>
<span className="titlebar-app-name-main">
{translate('auto.App.5096cbbc86', 'Orca')}
</span>
<div className="titlebar-app-name" aria-label={t('auto.App.5096cbbc86', 'Orca')}>
<span className="titlebar-app-name-main">{t('auto.App.5096cbbc86', 'Orca')}</span>
</div>
</ContextMenuTrigger>
<ContextMenuContent>
@@ -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')}
</ContextMenuItem>
</ContextMenuContent>
</ContextMenu>
@@ -90,13 +86,13 @@ export function TitlebarLeftControls({ layout }: { layout: AppChromeLayout }): R
<button
className="sidebar-toggle"
onClick={toggleSidebar}
aria-label={translate('auto.App.e4b9e7dff7', 'Toggle sidebar')}
aria-label={t('auto.App.e4b9e7dff7', 'Toggle sidebar')}
>
<PanelLeft size={16} />
</button>
</TooltipTrigger>
<TooltipContent side="bottom" sideOffset={6}>
{translate('auto.App.ce37cf5279', 'Toggle sidebar ({{value0}})', {
{t('auto.App.ce37cf5279', 'Toggle sidebar ({{value0}})', {
value0: leftSidebarShortcutLabel
})}
</TooltipContent>
@@ -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')}
>
<ArrowLeft size={12} />
</button>
</TooltipTrigger>
<TooltipContent side="bottom" sideOffset={6}>
{translate('auto.App.fe21e8f6f5', 'Go back ({{value0}})', {
{t('auto.App.fe21e8f6f5', 'Go back ({{value0}})', {
value0: historyBackShortcutLabel
})}
</TooltipContent>
@@ -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')}
>
<ArrowRight size={12} />
</button>
</TooltipTrigger>
<TooltipContent side="bottom" sideOffset={6}>
{translate('auto.App.f7aa73e785', 'Go forward ({{value0}})', {
{t('auto.App.f7aa73e785', 'Go forward ({{value0}})', {
value0: historyForwardShortcutLabel
})}
</TooltipContent>
@@ -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 {
<button
className="sidebar-toggle mr-2"
onClick={toggleRightSidebar}
aria-label={translate('auto.App.9e0b441a91', 'Toggle right sidebar')}
aria-label={t('auto.App.9e0b441a91', 'Toggle right sidebar')}
>
<PanelRight size={16} />
</button>
</TooltipTrigger>
<TooltipContent side="bottom" sideOffset={6}>
{translate('auto.App.c184e056de', 'Toggle right sidebar ({{value0}})', {
{t('auto.App.c184e056de', 'Toggle right sidebar ({{value0}})', {
value0: rightSidebarShortcutLabel
})}
</TooltipContent>
@@ -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
<button
className="titlebar-icon-button"
onClick={handleToggleExpand}
aria-label={translate('auto.App.c1cf0b0e4a', 'Collapse pane')}
aria-label={t('auto.App.c1cf0b0e4a', 'Collapse pane')}
disabled={!layout.activeTabCanExpand}
>
<Minimize2 size={14} />
</button>
</TooltipTrigger>
<TooltipContent side="bottom" sideOffset={6}>
{translate('auto.App.c1cf0b0e4a', 'Collapse pane')}
{t('auto.App.c1cf0b0e4a', 'Collapse pane')}
</TooltipContent>
</Tooltip>
)}
@@ -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 {
<div className="window-controls">
<button
className="window-controls-btn"
aria-label={translate('auto.App.bbb7f90669', 'Minimize')}
aria-label={t('auto.App.bbb7f90669', 'Minimize')}
onClick={() => window.api.ui.minimize()}
>
<svg width="10" height="10" viewBox="0 0 10 10" aria-hidden>
@@ -32,9 +33,7 @@ export function WindowControls(): React.JSX.Element {
<button
className="window-controls-btn"
aria-label={
maximized
? translate('auto.App.66f0a552e5', 'Restore')
: translate('auto.App.c9d6f98459', 'Maximize')
maximized ? t('auto.App.66f0a552e5', 'Restore') : t('auto.App.c9d6f98459', 'Maximize')
}
onClick={() => window.api.ui.maximize()}
>
@@ -50,7 +49,7 @@ export function WindowControls(): React.JSX.Element {
</button>
<button
className="window-controls-btn window-controls-close"
aria-label={translate('auto.App.e960d18540', 'Close')}
aria-label={t('auto.App.e960d18540', 'Close')}
// Request main’s close event so terminal confirmation runs; sandboxed window.close is unreliable.
onClick={() => window.api.ui.requestClose()}
>
@@ -1,8 +1,9 @@
import { Info } from 'lucide-react'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { DropdownMenuLabel, DropdownMenuSeparator } from '@/components/ui/dropdown-menu'
export function BrowserCookieImportDisclosure(): React.JSX.Element {
const t = useTranslate()
return (
<>
<DropdownMenuSeparator />
@@ -10,13 +11,13 @@ export function BrowserCookieImportDisclosure(): React.JSX.Element {
<Info aria-hidden className="mt-0.5 size-3.5 shrink-0" />
<span className="min-w-0">
<span className="block font-medium leading-4 text-foreground">
{translate(
{t(
'auto.components.BrowserCookieImportDisclosure.title',
"Google logins aren't imported"
)}
</span>
<span className="block leading-4 text-muted-foreground">
{translate(
{t(
'auto.components.BrowserCookieImportDisclosure.description',
'Sign in to Google directly in Orca.'
)}
@@ -1,9 +1,10 @@
import { DropdownMenuLabel } from './ui/dropdown-menu'
import { useAppStore } from '../store'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
// Name the import machine for remote pages: it chooses the browser inventory and receives permission prompts. Local imports need no notice.
export function BrowserCookieImportMachineNotice(): React.JSX.Element | null {
const t = useTranslate()
const detectedBrowsersHost = useAppStore((s) => s.detectedBrowsersHost)
if (!detectedBrowsersHost) {
return null
@@ -14,11 +15,11 @@ export function BrowserCookieImportMachineNotice(): React.JSX.Element | null {
<>
<DropdownMenuLabel>
{clientHosted
? translate(
? t(
'auto.components.BrowserCookieImportMachineNotice.clientLabel',
'Browsers on this device'
)
: translate(
: t(
'auto.components.BrowserCookieImportMachineNotice.remoteLabel',
'Browsers on {{value0}}',
{ value0: hostLabel }
@@ -26,11 +27,11 @@ export function BrowserCookieImportMachineNotice(): React.JSX.Element | null {
</DropdownMenuLabel>
<p className="max-w-60 px-2 pb-1.5 text-[11px] leading-4 text-muted-foreground">
{clientHosted
? translate(
? t(
'auto.components.BrowserCookieImportMachineNotice.clientNoteLocalStorage',
'Imports read this device’s browsers. Cookies are stored locally.'
)
: translate(
: t(
'auto.components.BrowserCookieImportMachineNotice.remoteNoteRemoteStorage',
'Imports read browsers on {{value0}}. Cookies are stored on that machine, and a permission prompt may appear on its screen.',
{ value0: hostLabel }
@@ -11,6 +11,7 @@ import {
DialogTitle
} from '@/components/ui/dialog'
import { translate } from '@/i18n/i18n'
import { useTranslate, type Translate } from '@/i18n/use-translate'
import { ClaudeAccountSwitchSessionTree } from './ClaudeAccountSwitchSessionTree'
import {
answerClaudeAccountSwitchPrompt,
@@ -30,6 +31,7 @@ export default function ClaudeAccountSwitchDialog(): React.JSX.Element | null {
}
function SwitchPromptDialog({ prompt }: { prompt: ClaudeAccountSwitchPrompt }): React.JSX.Element {
const t = useTranslate()
const [dontAskAgain, setDontAskAgain] = useState(false)
const { onAccount, elsewhere, cantMove } = prompt.sessions
// Only sessions on the outgoing account start ticked.
@@ -68,11 +70,11 @@ function SwitchPromptDialog({ prompt }: { prompt: ClaudeAccountSwitchPrompt }):
>
<DialogHeader>
<DialogTitle>
{translate('accounts.claude.switchSessions.title', 'Switched to {{account}}', {
{t('accounts.claude.switchSessions.title', 'Switched to {{account}}', {
account: prompt.nextAccountLabel
})}
</DialogTitle>
<DialogDescription>{promptDescription(prompt)}</DialogDescription>
<DialogDescription>{promptDescription(prompt, t)}</DialogDescription>
</DialogHeader>
{(listedCount > 1 || prompt.review) && (
<ClaudeAccountSwitchSessionTree
@@ -92,13 +94,13 @@ function SwitchPromptDialog({ prompt }: { prompt: ClaudeAccountSwitchPrompt }):
/>
<span className="min-w-0 space-y-0.5">
<span className="block text-sm">
{translate(
{t(
'accounts.claude.switchSessions.dontAskAgain',
"Don't ask again (restart automatically)"
)}
</span>
<span className="block text-xs text-muted-foreground">
{translate(
{t(
'accounts.claude.switchSessions.dontAskAgainHint',
'You can turn this off in Settings → AI Provider Accounts.'
)}
@@ -113,7 +115,7 @@ function SwitchPromptDialog({ prompt }: { prompt: ClaudeAccountSwitchPrompt }):
size="sm"
onClick={() => answerClaudeAccountSwitchPrompt('keep', { dontAskAgain })}
>
{translate('accounts.claude.switchSessions.keep', 'Keep as is')}
{t('accounts.claude.switchSessions.keep', 'Keep as is')}
</Button>
<Button
type="button"
@@ -126,12 +128,11 @@ function SwitchPromptDialog({ prompt }: { prompt: ClaudeAccountSwitchPrompt }):
>
<RefreshCw className="size-3.5" aria-hidden="true" />
{chosen.length <= 1
? translate('accounts.claude.switchSessions.restartOne', 'Restart session')
: translate(
'accounts.claude.switchSessions.restartCount',
'Restart {{count}} sessions',
{ count: chosen.length, defaultValue_one: 'Restart {{count}} session' }
)}
? t('accounts.claude.switchSessions.restartOne', 'Restart session')
: t('accounts.claude.switchSessions.restartCount', 'Restart {{count}} sessions', {
count: chosen.length,
defaultValue_one: 'Restart {{count}} session'
})}
</Button>
</DialogFooter>
</DialogContent>
@@ -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.',
{
@@ -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<HTMLDivElement>(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 (
<ResumeTreeRow
depth={2}
@@ -308,8 +307,8 @@ function SessionRow({
<span className="max-w-40 shrink-0 truncate text-[11px] text-muted-foreground">
{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'))}
</span>
</ResumeTreeRow>
)
@@ -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<HTMLDivElement>(null)
@@ -129,10 +130,10 @@ function LoudRestartOverlay({
</div>
<div className="flex min-w-0 flex-1 flex-col gap-1">
<div className="text-xs font-medium uppercase tracking-wide text-foreground">
{translate('auto.components.CodexRestartChip.d3e8a1f4b2', 'Account switched')}
{t('auto.components.CodexRestartChip.d3e8a1f4b2', 'Account switched')}
</div>
<div id={titleId} className="text-base font-semibold leading-tight">
{translate(
{t(
'auto.components.CodexRestartChip.a4c8e1b2f7',
'Codex is still signed in as {{value0}}',
{ value0: restartNotice.previousAccountLabel }
@@ -141,7 +142,7 @@ function LoudRestartOverlay({
</div>
</div>
<div id={bodyId} className="text-sm leading-relaxed text-muted-foreground">
{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({
</div>
<div className="mt-1 flex flex-wrap justify-end gap-2">
<Button type="button" variant="outline" size="sm" onClick={onDismiss}>
{translate('auto.components.CodexRestartChip.6133594b12', 'Keep old account')}
{t('auto.components.CodexRestartChip.6133594b12', 'Keep old account')}
</Button>
<Button type="button" variant="default" size="sm" onClick={onRestart}>
<RefreshCw />
{translate('auto.components.CodexRestartChip.c72a5fb234', 'Restart')}
{t('auto.components.CodexRestartChip.c72a5fb234', 'Restart')}
</Button>
</div>
</div>
@@ -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 {
<div className="flex items-center gap-2">
<Info className="size-4 text-muted-foreground" />
<CardTitle id="codex-shared-settings-notice-heading">
{translate(
'terminal.codexSharedSettingsNotice.title',
'Codex in Orca now uses ~/.codex'
)}
{t('terminal.codexSharedSettingsNotice.title', 'Codex in Orca now uses ~/.codex')}
</CardTitle>
</div>
<Button
variant="ghost"
size="icon-sm"
onClick={dismiss}
aria-label={translate('terminal.codexSharedSettingsNotice.dismiss', 'Dismiss')}
aria-label={t('terminal.codexSharedSettingsNotice.dismiss', 'Dismiss')}
>
<X />
</Button>
@@ -35,7 +33,7 @@ export function CodexSharedSettingsNoticeCard(): React.JSX.Element | null {
</CardHeader>
<CardContent>
<CardDescription>
{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.'
)}
@@ -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({
<div
className="fixed left-1/2 top-2 z-40 flex w-[min(44.625rem,calc(100vw-2rem))] -translate-x-1/2 items-start gap-4 rounded-lg border border-border bg-card/95 py-3 pl-4 pr-3 shadow-lg backdrop-blur"
role="region"
aria-label={translate('auto.components.FirstLaunchBanner.fcbee32f08', 'Telemetry notice')}
aria-label={t('auto.components.FirstLaunchBanner.fcbee32f08', 'Telemetry notice')}
aria-live="polite"
>
{/* Let text shrink without wrapping the action column. */}
<div className="flex-1 space-y-0.5 pr-1 text-sm">
<p className="font-medium leading-snug">
{translate(
'auto.components.FirstLaunchBanner.9784b4d7bc',
'Help us decide what to build next'
)}
{t('auto.components.FirstLaunchBanner.9784b4d7bc', 'Help us decide what to build next')}
</p>
<p className="text-xs leading-snug text-muted-foreground">
{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')}
</button>
.
</p>
@@ -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')}
</Button>
<Button size="sm" onClick={handleAcknowledge} disabled={inFlight}>
{translate('auto.components.FirstLaunchBanner.94cc673726', 'Got it')}
{t('auto.components.FirstLaunchBanner.94cc673726', 'Got it')}
</Button>
</div>
{/* Dismiss persists opt-in; it does more than hide the notice. */}
<button
type="button"
aria-label={translate('auto.components.FirstLaunchBanner.b9e1b966c7', 'Dismiss notice')}
aria-label={t('auto.components.FirstLaunchBanner.b9e1b966c7', 'Dismiss notice')}
onClick={handleAcknowledge}
disabled={inFlight}
className="absolute right-1.5 top-1.5 rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"
@@ -2,7 +2,7 @@ import type { JSX } from 'react'
import { Unlink } from 'lucide-react'
import { DropdownMenuItem } from '@/components/ui/dropdown-menu'
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
type HostedReviewUnlinkMenuItemProps = {
reviewLabel: string
@@ -19,12 +19,13 @@ export function HostedReviewUnlinkMenuItem({
disabled = false,
onSelect
}: HostedReviewUnlinkMenuItemProps): JSX.Element {
const t = useTranslate()
return (
<Tooltip>
<TooltipTrigger asChild>
<DropdownMenuItem disabled={disabled} onSelect={onSelect}>
<Unlink className="size-3.5" />
{translate(
{t(
'auto.components.HostedReviewUnlinkMenuItem.label',
'Unlink {{value0}} from workspace',
{ value0: reviewLabel }
@@ -32,7 +33,7 @@ export function HostedReviewUnlinkMenuItem({
</DropdownMenuItem>
</TooltipTrigger>
<TooltipContent side="left" sideOffset={8} className="max-w-72 text-pretty">
{translate(
{t(
'auto.components.HostedReviewUnlinkMenuItem.description',
'Orca will hide {{value0}} {{value1}} details for this workspace. The {{value0}} and branch on {{value2}} won’t be changed.',
{ value0: reviewLabel, value1: reviewIdentifier, value2: providerLabel }
@@ -16,7 +16,7 @@ import {
DropdownMenuTrigger
} from '@/components/ui/dropdown-menu'
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import type { JiraIssue } from '../../../shared/jira/jira-types'
import { copyJiraTextToClipboard } from './jira-issue-workspace-actions'
import type { IssueCopyTarget } from './issue-copy-target-messages'
@@ -31,6 +31,7 @@ export function JiraIssueRowCopyMenu({
issue: JiraIssue
children?: ReactNode
}): React.JSX.Element {
const t = useTranslate()
const [templateOpen, setTemplateOpen] = useState(false)
const anchorRef = useRef<HTMLElement | null>(null)
const setAnchor = (element: HTMLDivElement | null) => {
@@ -38,17 +39,17 @@ export function JiraIssueRowCopyMenu({
}
const actions: { label: string; text: string; copyTarget: IssueCopyTarget }[] = [
{
label: translate('auto.components.JiraIssueWorkspace.38839801e8', 'Copy key'),
label: t('auto.components.JiraIssueWorkspace.38839801e8', 'Copy key'),
text: issue.key,
copyTarget: 'key'
},
{
label: translate('auto.components.JiraIssueWorkspace.779bb91ee0', 'Copy URL'),
label: t('auto.components.JiraIssueWorkspace.779bb91ee0', 'Copy URL'),
text: issue.url,
copyTarget: 'url'
},
{
label: translate('auto.components.JiraIssueWorkspace.0cc62bd690', 'Copy prompt'),
label: t('auto.components.JiraIssueWorkspace.0cc62bd690', 'Copy prompt'),
text: buildJiraIssuePrompt(issue),
copyTarget: 'prompt'
}
@@ -69,7 +70,7 @@ export function JiraIssueRowCopyMenu({
<Separator />
<Item onSelect={() => setTemplateOpen(true)}>
<FileText className="size-3.5" />
{translate('jira.prompt.dialogTitle', 'Copy prompt from template')}
{t('jira.prompt.dialogTitle', 'Copy prompt from template')}
</Item>
</>
)
@@ -102,7 +103,7 @@ export function JiraIssueRowCopyMenu({
<Button
variant="ghost"
size="icon-xs"
aria-label={translate('jira.copy.context', 'Copy context for {{key}}', {
aria-label={t('jira.copy.context', 'Copy context for {{key}}', {
key: issue.key
})}
onClick={(event) => event.stopPropagation()}
@@ -112,7 +113,7 @@ export function JiraIssueRowCopyMenu({
</PopoverAnchor>
</DropdownMenuTrigger>
</TooltipTrigger>
<TooltipContent>{translate('jira.copy.actions', 'Copy issue context')}</TooltipContent>
<TooltipContent>{t('jira.copy.actions', 'Copy issue context')}</TooltipContent>
</Tooltip>
<DropdownMenuContent
align="end"
@@ -14,6 +14,7 @@ import {
type TaskSourceContext
} from '../../../shared/task-source-context'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { JiraIssueMetadataBar, JiraIssueWorkspaceHeader } from './jira-issue-workspace-chrome'
import { JiraIssueCommentComposer, JiraIssueWorkspaceContent } from './jira-issue-workspace-content'
import { useJiraIssueWorkspaceActions } from './jira-issue-workspace-actions'
@@ -40,6 +41,7 @@ export default function JiraIssueWorkspace({
onClose,
sourceContext
}: JiraIssueWorkspaceProps): React.JSX.Element {
const t = useTranslate()
const settings = useAppStore((s) => s.settings)
const owner = useMemo(
() => (sourceContext ? taskSourceRuntimeTarget(sourceContext) : defaultScopeHost(settings)),
@@ -193,13 +195,12 @@ export default function JiraIssueWorkspace({
>
<VisuallyHidden.Root asChild>
<SheetTitle>
{displayed?.title ??
translate('auto.components.JiraIssueWorkspace.ef21405c6d', 'Jira issue')}
{displayed?.title ?? t('auto.components.JiraIssueWorkspace.ef21405c6d', 'Jira issue')}
</SheetTitle>
</VisuallyHidden.Root>
<VisuallyHidden.Root asChild>
<SheetDescription>
{translate(
{t(
'auto.components.JiraIssueWorkspace.857bd2f88f',
'Preview, edit, and start work from the selected issue.'
)}
@@ -7,7 +7,7 @@ import {
DropdownMenuSeparator,
DropdownMenuTrigger
} from '@/components/ui/dropdown-menu'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import type { JiraIssue } from '../../../shared/jira/jira-types'
import type { Worktree } from '../../../shared/worktree/types'
@@ -22,7 +22,8 @@ export function JiraLinkedWorkspaceAction({
onOpenWorkspace: (workspace: Worktree) => void
onStartWorkspace: (issue: JiraIssue) => void
}): React.JSX.Element {
const label = translate('jira.workspace.linkedCount', '{{count}} workspaces linked to {{key}}', {
const t = useTranslate()
const label = t('jira.workspace.linkedCount', '{{count}} workspaces linked to {{key}}', {
count: workspaces.length,
key: issue.key,
defaultValue_one: '{{count}} workspace linked to {{key}}'
@@ -55,7 +56,7 @@ export function JiraLinkedWorkspaceAction({
<DropdownMenuSeparator />
<DropdownMenuItem onSelect={() => onStartWorkspace(issue)}>
<ArrowRight className="size-3.5" />
{translate('jira.workspace.startAnother', 'Start new workspace')}
{t('jira.workspace.startAnother', 'Start new workspace')}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
@@ -10,7 +10,7 @@ import {
SelectValue
} from '@/components/ui/select'
import { Textarea } from '@/components/ui/textarea'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import type { JiraIssue } from '../../../shared/jira/jira-types'
import { copyJiraTextToClipboard } from './jira-issue-workspace-actions'
import {
@@ -29,7 +29,8 @@ export function JiraPromptTemplatePopover({
onClose: () => void
onCloseAutoFocus: (event: Event) => void
}): React.JSX.Element {
const templates = getJiraPromptTemplates()
const t = useTranslate()
const templates = getJiraPromptTemplates(t)
const [selectedId, setSelectedId] = useState('implementation')
const [customTemplate, setCustomTemplate] = useState(loadCustomJiraPromptTemplate)
const [otherPrompt, setOtherPrompt] = useState('')
@@ -43,14 +44,14 @@ export function JiraPromptTemplatePopover({
<PopoverContent
align="end"
className="w-[32rem] max-w-[calc(100vw-2rem)]"
aria-label={translate('jira.prompt.dialogTitle', 'Copy prompt from template')}
aria-label={t('jira.prompt.dialogTitle', 'Copy prompt from template')}
onClick={(event) => event.stopPropagation()}
onCloseAutoFocus={onCloseAutoFocus}
>
<div className="max-h-[calc(100vh-4rem)] overflow-y-auto scrollbar-sleek p-4">
<div className="mb-4 space-y-1">
<h3 className="text-sm font-medium">
{translate('jira.prompt.dialogTitle', 'Copy prompt from template')}
{t('jira.prompt.dialogTitle', 'Copy prompt from template')}
</h3>
<p className="text-xs text-muted-foreground">
{issue.key} · {issue.title}
@@ -58,9 +59,7 @@ export function JiraPromptTemplatePopover({
</div>
<div className="space-y-3">
<div className="space-y-2">
<Label htmlFor="jira-prompt-template">
{translate('jira.prompt.template', 'Template')}
</Label>
<Label htmlFor="jira-prompt-template">{t('jira.prompt.template', 'Template')}</Label>
<Select value={selectedId} onValueChange={setSelectedId}>
<SelectTrigger id="jira-prompt-template">
<SelectValue />
@@ -71,19 +70,17 @@ export function JiraPromptTemplatePopover({
{candidate.label}
</SelectItem>
))}
<SelectItem value="custom">
{translate('jira.prompt.custom', 'Custom template')}
</SelectItem>
<SelectItem value="custom">{t('jira.prompt.custom', 'Custom template')}</SelectItem>
</SelectContent>
</Select>
</div>
{selectedId === 'custom' ? (
<div className="space-y-2">
<Label htmlFor="jira-custom-template">
{translate('jira.prompt.templateText', 'Template text')}
{t('jira.prompt.templateText', 'Template text')}
</Label>
<p className="text-xs text-muted-foreground">
{translate(
{t(
'jira.prompt.variables',
'Use $jira-issue for the issue context and $other-prompt for your additional instructions. Saved on this device.'
)}
@@ -100,7 +97,7 @@ export function JiraPromptTemplatePopover({
) : null}
<div className="space-y-2">
<Label htmlFor="jira-other-prompt">
{translate('jira.prompt.other', 'Additional instructions (optional)')}
{t('jira.prompt.other', 'Additional instructions (optional)')}
</Label>
<Textarea
id="jira-other-prompt"
@@ -109,15 +106,13 @@ export function JiraPromptTemplatePopover({
/>
</div>
<div className="space-y-2">
<Label htmlFor="jira-prompt-preview">
{translate('jira.prompt.preview', 'Preview')}
</Label>
<Label htmlFor="jira-prompt-preview">{t('jira.prompt.preview', 'Preview')}</Label>
<Textarea id="jira-prompt-preview" readOnly value={prompt} className="h-40" />
</div>
</div>
<div className="mt-4 flex justify-end gap-2">
<Button variant="ghost" onClick={onClose}>
{translate('common.cancel', 'Cancel')}
{t('common.cancel', 'Cancel')}
</Button>
<Button
disabled={copying || !prompt}
@@ -130,7 +125,7 @@ export function JiraPromptTemplatePopover({
}
}}
>
{translate('auto.components.JiraIssueWorkspace.0cc62bd690', 'Copy prompt')}
{t('auto.components.JiraIssueWorkspace.0cc62bd690', 'Copy prompt')}
</Button>
</div>
</div>
+18 -18
View File
@@ -13,7 +13,7 @@ import { ShortcutKeyCombo } from './ShortcutKeyCombo'
import { useShortcutKeyDetails, type ShortcutKeyComboDetails } from '@/hooks/useShortcutLabel'
import { useMountedRef } from '@/hooks/useMountedRef'
import logo from '../../../../resources/logo.svg'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { hasGitHubBackedProject, type PreflightIssue } from './landing-preflight-issues'
import { useLandingPreflightRuntime } from './landing-preflight-runtime'
import { useLandingOrcaStarState, type LandingStarState } from './landing-github-star-state'
@@ -39,6 +39,7 @@ function GitHubStarButton({
state,
setState
}: StarButtonProps): React.JSX.Element | null {
const t = useTranslate()
const [menuOpen, setMenuOpen] = useState(false)
const wrapperRef = useRef<HTMLDivElement | null>(null)
const mountedRef = useMountedRef()
@@ -117,10 +118,10 @@ function GitHubStarButton({
/>
)}
{state === 'starred'
? translate('auto.components.Landing.ec43b38ba7', 'Starred on GitHub')
? t('auto.components.Landing.ec43b38ba7', 'Starred on GitHub')
: state === 'web-fallback'
? translate('auto.components.Landing.157bb5ecbb', 'Open GitHub')
: translate('auto.components.Landing.0d0ace8861', 'Star on GitHub')}
? t('auto.components.Landing.157bb5ecbb', 'Open GitHub')
: t('auto.components.Landing.0d0ace8861', 'Star on GitHub')}
</button>
{state === 'starred' && menuOpen && (
<div className="absolute right-0 bottom-[calc(100%+4px)] z-10 min-w-[100px] rounded-md border border-border bg-popover py-1 shadow-floating">
@@ -131,7 +132,7 @@ function GitHubStarButton({
setState('hidden')
}}
>
{translate('auto.components.Landing.c1cf168479', 'Hide')}
{t('auto.components.Landing.c1cf168479', 'Hide')}
</button>
</div>
)}
@@ -154,6 +155,7 @@ function PreflightBanner({
issues: PreflightIssue[]
repos: readonly Repo[]
}): React.JSX.Element | null {
const t = useTranslate()
// Recheck dismissals when the GitHub project set changes so expired nudges can reappear.
const githubKey = githubProjectKeys(repos).join('|')
const [dismissed, setDismissed] = useState<Set<string>>(() =>
@@ -202,7 +204,7 @@ function PreflightBanner({
<button
className="-mr-1 -mt-0.5 shrink-0 rounded p-1 text-muted-foreground/70 transition-colors hover:bg-accent hover:text-foreground cursor-pointer"
onClick={() => dismiss(issue)}
aria-label={translate('auto.components.Landing.preflightDismiss', 'Dismiss')}
aria-label={t('auto.components.Landing.preflightDismiss', 'Dismiss')}
>
<X className="size-3.5" />
</button>
@@ -214,18 +216,16 @@ function PreflightBanner({
}
export default function Landing(): React.JSX.Element {
const t = useTranslate()
const repos = useAppStore((s) => s.repos)
const openModal = useAppStore((s) => s.openModal)
const createActionLabel =
repos.length > 0 && repos.every((repo) => isGitRepoKind(repo))
? translate('auto.components.NewWorkspaceComposerModal.createWorktree', 'Create worktree')
: translate('auto.components.NewWorkspaceComposerModal.createWorkspace', 'Create workspace')
const moveUpLabel = translate('auto.components.Landing.moveUpWorkspace', 'Move up workspace')
const moveDownLabel = translate(
'auto.components.Landing.moveDownWorkspace',
'Move down workspace'
)
? t('auto.components.NewWorkspaceComposerModal.createWorktree', 'Create worktree')
: t('auto.components.NewWorkspaceComposerModal.createWorkspace', 'Create workspace')
const moveUpLabel = t('auto.components.Landing.moveUpWorkspace', 'Move up workspace')
const moveDownLabel = t('auto.components.Landing.moveDownWorkspace', 'Move down workspace')
const hasProjects = repos.length > 0
const hasGitHubProject = useMemo(() => hasGitHubBackedProject(repos), [repos])
const showGitHubSupportFooter = repos.length === 0 || hasGitHubProject
@@ -262,23 +262,23 @@ export default function Landing(): React.JSX.Element {
>
<img
src={logo}
alt={translate('auto.components.Landing.520304a067', 'Orca logo')}
alt={t('auto.components.Landing.520304a067', 'Orca logo')}
className="size-12"
/>
</div>
<h1 className="text-4xl font-bold text-foreground tracking-tight">
{translate('auto.components.Landing.6ca6ff404e', 'ORCA')}
{t('auto.components.Landing.6ca6ff404e', 'ORCA')}
</h1>
{preflightIssues.length > 0 && <PreflightBanner issues={preflightIssues} repos={repos} />}
<p className="text-sm text-muted-foreground text-center">
{hasProjects
? translate(
? t(
'auto.components.Landing.9c00bd4adf',
'Select a workspace from the sidebar to begin.'
)
: translate('auto.components.Landing.cd21242762', 'Add a project to get started.')}
: t('auto.components.Landing.cd21242762', 'Add a project to get started.')}
</p>
<div className="flex items-center justify-center gap-2.5 flex-wrap">
@@ -287,7 +287,7 @@ export default function Landing(): React.JSX.Element {
onClick={() => openModal('add-repo')}
>
<FolderPlus className="size-3.5" />
{translate('auto.components.Landing.f9eaa9e12d', 'Add project')}
{t('auto.components.Landing.f9eaa9e12d', 'Add project')}
</button>
<button
@@ -17,6 +17,7 @@ import { RichMarkdownTableControls } from '@/components/editor/rich-markdown/tab
import { isScreenSubmitShortcut } from '@/lib/screen-submit-shortcut'
import { cn } from '@/lib/utils'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { useAppStore } from '@/store'
import {
getRichMarkdownSpellcheckAttribute,
@@ -56,6 +57,7 @@ export function LinearIssueMarkdownDescriptionEditor({
disabled,
submitShortcutLabel
}: LinearIssueMarkdownDescriptionEditorProps): React.JSX.Element {
const t = useTranslate()
const { i18n } = useTranslation()
const language = i18n.resolvedLanguage ?? i18n.language
const lastEditorMarkdownRef = useRef(value)
@@ -86,7 +88,7 @@ export function LinearIssueMarkdownDescriptionEditor({
attributes: {
class: 'rich-markdown-editor',
spellcheck: getRichMarkdownSpellcheckAttribute(richMarkdownSpellcheckEnabled),
'aria-label': translate(
'aria-label': t(
'auto.components.LinearIssueWorkspace.issueDescriptionLabel',
'Issue description'
)
@@ -176,12 +178,12 @@ export function LinearIssueMarkdownDescriptionEditor({
<span className="flex items-center gap-1">
<span>{submitShortcutLabel}</span>
<span>
{translate('auto.components.LinearIssueMarkdownDescriptionEditor.a7301a11f3', 'save')}
{t('auto.components.LinearIssueMarkdownDescriptionEditor.a7301a11f3', 'save')}
</span>
</span>
<span className="text-muted-foreground/35">·</span>
<span>
{translate('auto.components.LinearIssueMarkdownDescriptionEditor.d9c47069ef', 'Markdown')}
{t('auto.components.LinearIssueMarkdownDescriptionEditor.d9c47069ef', 'Markdown')}
</span>
</div>
{disabled ? (
@@ -19,6 +19,7 @@ import {
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { cn } from '@/lib/utils'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
type LinearIssueMarkdownToolbarButtonProps = {
active?: boolean
@@ -95,6 +96,7 @@ export function LinearIssueMarkdownToolbar({
editor: Editor | null
disabled: boolean
}): React.JSX.Element {
const t = useTranslate()
// Why: this toolbar can outlive editor recreation, so subscribe directly to language changes.
useTranslation()
const runCommand = useCallback(
@@ -110,26 +112,20 @@ export function LinearIssueMarkdownToolbar({
return (
<div
className="linear-issue-markdown-toolbar"
aria-label={translate(
aria-label={t(
'auto.components.LinearIssueMarkdownDescriptionEditor.7c52151156',
'Issue description formatting'
)}
>
<LinearIssueMarkdownToolbarButton
label={translate(
'auto.components.LinearIssueMarkdownDescriptionEditor.68a41d5665',
'Body text'
)}
label={t('auto.components.LinearIssueMarkdownDescriptionEditor.68a41d5665', 'Body text')}
disabled={disabled}
onClick={() => runCommand((nextEditor) => nextEditor.chain().focus().setParagraph().run())}
>
<Pilcrow className="size-3.5" />
</LinearIssueMarkdownToolbarButton>
<LinearIssueMarkdownToolbarButton
label={translate(
'auto.components.LinearIssueMarkdownDescriptionEditor.e3f741d258',
'Heading 1'
)}
label={t('auto.components.LinearIssueMarkdownDescriptionEditor.e3f741d258', 'Heading 1')}
active={editor?.isActive('heading', { level: 1 }) ?? false}
disabled={disabled}
onClick={() =>
@@ -139,10 +135,7 @@ export function LinearIssueMarkdownToolbar({
<Heading1 className="size-3.5" />
</LinearIssueMarkdownToolbarButton>
<LinearIssueMarkdownToolbarButton
label={translate(
'auto.components.LinearIssueMarkdownDescriptionEditor.dddaa7a0a6',
'Heading 2'
)}
label={t('auto.components.LinearIssueMarkdownDescriptionEditor.dddaa7a0a6', 'Heading 2')}
active={editor?.isActive('heading', { level: 2 }) ?? false}
disabled={disabled}
onClick={() =>
@@ -153,7 +146,7 @@ export function LinearIssueMarkdownToolbar({
</LinearIssueMarkdownToolbarButton>
<LinearIssueMarkdownToolbarSeparator />
<LinearIssueMarkdownToolbarButton
label={translate('auto.components.LinearIssueMarkdownDescriptionEditor.caa88f50d0', 'Bold')}
label={t('auto.components.LinearIssueMarkdownDescriptionEditor.caa88f50d0', 'Bold')}
active={editor?.isActive('bold') ?? false}
disabled={disabled}
onClick={() => runCommand((nextEditor) => nextEditor.chain().focus().toggleBold().run())}
@@ -161,10 +154,7 @@ export function LinearIssueMarkdownToolbar({
<Bold className="size-3.5" />
</LinearIssueMarkdownToolbarButton>
<LinearIssueMarkdownToolbarButton
label={translate(
'auto.components.LinearIssueMarkdownDescriptionEditor.5666b4493d',
'Italic'
)}
label={t('auto.components.LinearIssueMarkdownDescriptionEditor.5666b4493d', 'Italic')}
active={editor?.isActive('italic') ?? false}
disabled={disabled}
onClick={() => runCommand((nextEditor) => nextEditor.chain().focus().toggleItalic().run())}
@@ -172,10 +162,7 @@ export function LinearIssueMarkdownToolbar({
<Italic className="size-3.5" />
</LinearIssueMarkdownToolbarButton>
<LinearIssueMarkdownToolbarButton
label={translate(
'auto.components.LinearIssueMarkdownDescriptionEditor.28fd951b83',
'Strike'
)}
label={t('auto.components.LinearIssueMarkdownDescriptionEditor.28fd951b83', 'Strike')}
active={editor?.isActive('strike') ?? false}
disabled={disabled}
onClick={() => runCommand((nextEditor) => nextEditor.chain().focus().toggleStrike().run())}
@@ -183,10 +170,7 @@ export function LinearIssueMarkdownToolbar({
<Strikethrough className="size-3.5" />
</LinearIssueMarkdownToolbarButton>
<LinearIssueMarkdownToolbarButton
label={translate(
'auto.components.LinearIssueMarkdownDescriptionEditor.ad1869bd54',
'Inline code'
)}
label={t('auto.components.LinearIssueMarkdownDescriptionEditor.ad1869bd54', 'Inline code')}
active={editor?.isActive('code') ?? false}
disabled={disabled}
onClick={() => runCommand((nextEditor) => nextEditor.chain().focus().toggleCode().run())}
@@ -195,10 +179,7 @@ export function LinearIssueMarkdownToolbar({
</LinearIssueMarkdownToolbarButton>
<LinearIssueMarkdownToolbarSeparator />
<LinearIssueMarkdownToolbarButton
label={translate(
'auto.components.LinearIssueMarkdownDescriptionEditor.c82917e06e',
'Bullet list'
)}
label={t('auto.components.LinearIssueMarkdownDescriptionEditor.c82917e06e', 'Bullet list')}
active={editor?.isActive('bulletList') ?? false}
disabled={disabled}
onClick={() =>
@@ -208,7 +189,7 @@ export function LinearIssueMarkdownToolbar({
<List className="size-3.5" />
</LinearIssueMarkdownToolbarButton>
<LinearIssueMarkdownToolbarButton
label={translate(
label={t(
'auto.components.LinearIssueMarkdownDescriptionEditor.d6b2f3d35b',
'Numbered list'
)}
@@ -221,10 +202,7 @@ export function LinearIssueMarkdownToolbar({
<ListOrdered className="size-3.5" />
</LinearIssueMarkdownToolbarButton>
<LinearIssueMarkdownToolbarButton
label={translate(
'auto.components.LinearIssueMarkdownDescriptionEditor.e2a0267c8c',
'Checklist'
)}
label={t('auto.components.LinearIssueMarkdownDescriptionEditor.e2a0267c8c', 'Checklist')}
active={editor?.isActive('taskList') ?? false}
disabled={disabled}
onClick={() =>
@@ -235,10 +213,7 @@ export function LinearIssueMarkdownToolbar({
</LinearIssueMarkdownToolbarButton>
<LinearIssueMarkdownToolbarSeparator />
<LinearIssueMarkdownToolbarButton
label={translate(
'auto.components.LinearIssueMarkdownDescriptionEditor.9eaf02ac01',
'Quote'
)}
label={t('auto.components.LinearIssueMarkdownDescriptionEditor.9eaf02ac01', 'Quote')}
active={editor?.isActive('blockquote') ?? false}
disabled={disabled}
onClick={() =>
@@ -250,11 +225,8 @@ export function LinearIssueMarkdownToolbar({
<LinearIssueMarkdownToolbarButton
label={
editor?.isActive('link')
? translate(
'auto.components.LinearIssueMarkdownDescriptionEditor.340160f4e8',
'Remove link'
)
: translate('auto.components.LinearIssueMarkdownDescriptionEditor.632096eb1c', 'Link')
? t('auto.components.LinearIssueMarkdownDescriptionEditor.340160f4e8', 'Remove link')
: t('auto.components.LinearIssueMarkdownDescriptionEditor.632096eb1c', 'Link')
}
active={editor?.isActive('link') ?? false}
disabled={disabled}
@@ -22,6 +22,7 @@ import {
resolveLinearIssueTextDraftState
} from './linear-issue-text-draft-state'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { defaultScopeSource } from '@/lib/default-creation-host'
type LinearIssueTextEditorProps = {
@@ -37,6 +38,7 @@ export function LinearIssueTextEditor({
fields = 'all',
sourceContext
}: LinearIssueTextEditorProps): React.JSX.Element {
const t = useTranslate()
const settings = useAppStore((s) => s.settings)
const providerSettings = sourceContext ?? defaultScopeSource(settings)
const [draftState, setDraftState] = useState(() => createLinearIssueTextDraftState(issue))
@@ -169,10 +171,7 @@ export function LinearIssueTextEditor({
onKeyDown={handleTitleKeyDown}
disabled={savingField === 'title'}
rows={1}
aria-label={translate(
'auto.components.LinearIssueTextEditor.04d73b72dc',
'Issue title'
)}
aria-label={t('auto.components.LinearIssueTextEditor.04d73b72dc', 'Issue title')}
// CSS field sizing grows and rewraps titles without JS measurement.
className={cn(
'peer scrollbar-sleek block w-full resize-none overflow-hidden rounded-md border border-transparent bg-transparent px-1 py-0 text-foreground outline-none transition hover:border-border/50 hover:bg-accent/40 focus-visible:border-border focus-visible:bg-background focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-80',
@@ -184,7 +183,7 @@ export function LinearIssueTextEditor({
<kbd className="inline-flex h-4 min-w-4 select-none items-center justify-center rounded border border-border bg-muted/70 px-1 font-mono text-[9px] font-medium shadow-xs">
↵
</kbd>
<span>{translate('auto.components.LinearIssueTextEditor.947ba2d6f4', 'to save')}</span>
<span>{t('auto.components.LinearIssueTextEditor.947ba2d6f4', 'to save')}</span>
</div>
{savingField === 'title' ? (
<LoaderCircle className="absolute right-2 top-2 size-4 animate-spin text-muted-foreground" />
@@ -11,7 +11,7 @@ import { useAppStore } from '@/store'
import { useAllWorktrees } from '@/store/slices/worktrees/listing/use-worktree-catalog'
import type { LinearIssue } from '../../../shared/linear/issue-types'
import type { TaskSourceContext } from '../../../shared/task-source-context'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { LinearIssueActivity } from './linear-issue-activity'
import { LinearIssueSubIssues } from './linear-issue-sub-issues'
import { useLinearIssueWorkspaceDetail } from './linear-issue-workspace-detail-state'
@@ -50,6 +50,7 @@ function LinearIssueWorkspaceIssue({
sourceContext,
requestKey
}: LinearIssueWorkspaceIssueProps): React.JSX.Element {
const t = useTranslate()
const settings = useAppStore((state) => state.settings)
const providerSettings = sourceContext ?? defaultScopeSource(settings)
const allWorktrees = useAllWorktrees()
@@ -138,12 +139,12 @@ function LinearIssueWorkspaceIssue({
<VisuallyHidden.Root asChild>
<SheetTitle>
{detail.displayed.title ??
translate('auto.components.LinearIssueWorkspace.61f424f8ca', 'Linear issue')}
t('auto.components.LinearIssueWorkspace.61f424f8ca', 'Linear issue')}
</SheetTitle>
</VisuallyHidden.Root>
<VisuallyHidden.Root asChild>
<SheetDescription>
{translate(
{t(
'auto.components.LinearIssueWorkspace.ad5dec37b7',
'Preview, edit, and start work from the selected issue.'
)}
@@ -9,6 +9,7 @@ import { getWorktreeAttachmentLabel } from '@/lib/worktree-attachment-label'
import { folderWorkspaceToWorktree } from '../../../shared/folder-workspaces/folder-workspace-worktree'
import { useAppStore } from '@/store'
import { translate } from '@/i18n/i18n'
import { useIntlLocale, useTranslate } from '@/i18n/use-translate'
import { useAllWorktrees } from '@/store/slices/worktrees/listing/use-worktree-catalog'
import type { LinearComment } from '../../../shared/linear/issue-types'
import { linearIssueComments } from '@/runtime/linear/runtime-linear-issue-client'
@@ -33,6 +34,8 @@ export default function LinearItemDrawer({
onClose,
sourceContext
}: LinearItemDrawerProps): React.JSX.Element {
const t = useTranslate()
const intlLocale = useIntlLocale()
const settings = useAppStore((s) => s.settings)
const providerSettings = sourceContext ?? defaultScopeSource(settings)
const scope = getLinearSourceScope(providerSettings)
@@ -173,18 +176,22 @@ export default function LinearItemDrawer({
openLinearIssueWorkspaceOrStart(displayed, () => onUse(displayed))
}, [displayed, onUse])
return renderLinearItemDrawerSheet({
issue,
onClose,
displayed,
sourceContext,
editState,
commentsLoading,
comments,
handleCommentAdded,
attachedWorkspaceLabel,
attachedWorkspace,
handleOpenOrUseIssue,
onUse
})
return renderLinearItemDrawerSheet(
{
issue,
onClose,
displayed,
sourceContext,
editState,
commentsLoading,
comments,
handleCommentAdded,
attachedWorkspaceLabel,
attachedWorkspace,
handleOpenOrUseIssue,
onUse
},
t,
intlLocale
)
}
@@ -6,6 +6,7 @@ import type {
} from '../../../shared/update-status-types'
import { UpdateErrorCardContent } from './UpdateErrorCardContent'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { linuxPackageCommandUnavailableText } from '@/lib/updater-message-copy'
import { useMountedRef } from '@/hooks/useMountedRef'
@@ -36,28 +37,29 @@ export function LinuxPackageInstallRecoveryCard({
releaseUrl?: string
onClose: () => void
}) {
const t = useTranslate()
// Translate on render so persisted-language hydration cannot leave the card frozen in English.
const TITLE = translate(
const TITLE = t(
'auto.components.LinuxPackageInstallRecoveryCard.53e1559f99',
'Manual Install Required'
)
const SUMMARY = translate(
const SUMMARY = t(
'auto.components.LinuxPackageInstallRecoveryCard.a7ac6ec78b',
'Orca downloaded the system package. Quit Orca before finishing the update from a terminal.'
)
const EXPLAINER = translate(
const EXPLAINER = t(
'auto.components.LinuxPackageInstallRecoveryCard.82c6dbea00',
'Copy the command, quit Orca, and run it in a system terminal on the computer where Orca is installed. Reopen Orca after it finishes.'
)
const AGENT_NOTE = translate(
const AGENT_NOTE = t(
'auto.components.LinuxPackageInstallRecoveryCard.53c4b8e148',
'No usable authentication agent answered the privileged install request.'
)
const TRUST_NOTE = translate(
const TRUST_NOTE = t(
'auto.components.LinuxPackageInstallRecoveryCard.b7e7c5bc95',
'Orca checks the downloaded file against the release metadata at the moment it builds this command. The system package itself is not signature-checked, and Orca cannot vouch for the file after that point.'
)
const CHECKING_LABEL = translate(
const CHECKING_LABEL = t(
'auto.components.LinuxPackageInstallRecoveryCard.c732bcbf8f',
'Checking package...'
)
@@ -139,17 +141,14 @@ export function LinuxPackageInstallRecoveryCard({
// Keep the action label stable; toast confirms the copy.
const copyAction = {
label: translate(
'auto.components.LinuxPackageInstallRecoveryCard.55c86654b7',
'Copy Install Command'
),
label: t('auto.components.LinuxPackageInstallRecoveryCard.55c86654b7', 'Copy Install Command'),
pendingLabel: CHECKING_LABEL,
isPending: pendingAction === 'copy',
disabled: pendingAction !== null,
onClick: handleCopyCommand
}
const showAction = {
label: translate('auto.components.LinuxPackageInstallRecoveryCard.e3de29c86a', 'Show Package'),
label: t('auto.components.LinuxPackageInstallRecoveryCard.e3de29c86a', 'Show Package'),
pendingLabel: CHECKING_LABEL,
isPending: pendingAction === 'show',
disabled: pendingAction !== null,
@@ -157,7 +156,7 @@ export function LinuxPackageInstallRecoveryCard({
}
const officialReleaseAction = releaseUrl
? {
label: translate('auto.components.UpdateCard.47126bcf57', 'Download Manually'),
label: t('auto.components.UpdateCard.47126bcf57', 'Download Manually'),
onClick: () => {
setActionError(null)
void window.api.shell.openUrl(releaseUrl).catch((error: unknown) => {
@@ -1,5 +1,5 @@
import { Button } from './ui/button'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import type { NativeChatRestartStore } from './native-chat-resume-on-restart-store'
export function NativeChatRemoteResumeActions({
@@ -19,12 +19,13 @@ export function NativeChatRemoteResumeActions({
dismiss: () => void
resumeButtonRef: React.Ref<HTMLButtonElement>
}): React.JSX.Element {
const t = useTranslate()
const all = [...chosen]
const startedHere = all.filter(store.startedHere)
return (
<>
<Button variant="ghost" size="sm" disabled={busy} onClick={dismiss}>
{translate('auto.components.NativeChatResumeOnRestartModal.serverDismiss', 'Dismiss')}
{t('auto.components.NativeChatResumeOnRestartModal.serverDismiss', 'Dismiss')}
</Button>
<Button
variant="outline"
@@ -32,7 +33,7 @@ export function NativeChatRemoteResumeActions({
disabled={busy || all.length === 0}
onClick={() => resume(all)}
>
{translate(
{t(
'auto.components.NativeChatResumeOnRestartModal.serverResumeAll',
'Resume all {{count}} on {{machine}}',
{ count: all.length, machine: machineName }
@@ -45,7 +46,7 @@ export function NativeChatRemoteResumeActions({
disabled={busy || startedHere.length === 0}
onClick={() => resume(startedHere)}
>
{translate(
{t(
'auto.components.NativeChatResumeOnRestartModal.serverResumeHereCount',
'Resume {{count}} chats started here',
{ count: startedHere.length, defaultValue_one: 'Resume {{count}} chat started here' }
@@ -1,4 +1,4 @@
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { useAppStore } from '../store'
import { Button } from './ui/button'
import { NATIVE_CHAT_RESUME_SETTING_SECTION_ID } from './settings/chat/native-chat-resume-setting-target'
@@ -12,17 +12,18 @@ export function NativeChatResumeAutoNote({
/** Closes the dialog so the settings page is not left under it. */
onOpenSettings: () => void
}): React.JSX.Element {
const t = useTranslate()
const openSettingsPage = useAppStore((state) => state.openSettingsPage)
const openSettingsTarget = useAppStore((state) => state.openSettingsTarget)
return (
<div className="order-last flex min-w-0 flex-wrap items-center text-xs text-muted-foreground sm:order-none sm:mr-auto">
<span>
{inFlight
? translate(
? t(
'auto.components.NativeChatResumeAutoNote.resuming',
'Resuming automatically after the restart.'
)
: translate(
: t(
'auto.components.NativeChatResumeAutoNote.resumed',
'Resumed automatically after the restart.'
)}
@@ -40,10 +41,7 @@ export function NativeChatResumeAutoNote({
})
}}
>
{translate(
'auto.components.NativeChatResumeAutoNote.changeInSettings',
'Change in Settings'
)}
{t('auto.components.NativeChatResumeAutoNote.changeInSettings', 'Change in Settings')}
</Button>
</div>
)
@@ -1,5 +1,5 @@
import { RotateCcw } from 'lucide-react'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { DialogHeader, DialogTitle, DialogDescription } from './ui/dialog'
import type { ResumeRunPanel } from './NativeChatResumeRunPanel'
@@ -14,6 +14,7 @@ export function NativeChatResumeDialogHeader({
remote: boolean
interruptedByUpdate: boolean
}): React.JSX.Element {
const t = useTranslate()
return (
<DialogHeader>
<DialogTitle>
@@ -27,12 +28,12 @@ export function NativeChatResumeDialogHeader({
<span className="flex items-center gap-2">
<RotateCcw className="size-4 text-muted-foreground" />
{remote
? translate(
? t(
'auto.components.NativeChatResumeOnRestartModal.serverTitle',
'{{machine}} restarted',
{ machine: machineName }
)
: translate(
: t(
'auto.components.NativeChatResumeOnRestartModal.title',
'Resume interrupted chats?'
)}
@@ -43,17 +44,17 @@ export function NativeChatResumeDialogHeader({
<DialogDescription>
{runPanel?.description ??
(remote
? translate(
? t(
'auto.components.NativeChatResumeOnRestartModal.serverBody',
'These chats were working when Orca on {{machine}} restarted. Resuming restores each one where it stopped and asks the agent to carry on. Your own prompt is not re-sent.',
{ machine: machineName }
)
: interruptedByUpdate
? translate(
? t(
'auto.components.NativeChatResumeOnRestartModal.updateBody',
'These chats were working when Orca installed an update. Resuming restores each one where it stopped, with its full context, and asks the agent to check what it was doing before carrying on. Your own prompt is not re-sent.'
)
: translate(
: t(
'auto.components.NativeChatResumeOnRestartModal.body',
'These chats were working when Orca closed. Resuming restores each one where it stopped, with its full context, and asks the agent to check what it was doing before carrying on. Your own prompt is not re-sent.'
))}
@@ -2,6 +2,7 @@ import { AlertCircle, Clock, X } from 'lucide-react'
import { Button } from './ui/button'
import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip'
import { translate } from '@/i18n/i18n'
import { useTranslate, type Translate } from '@/i18n/use-translate'
import {
resumeFailureGuidance,
type ResumeFailureAction
@@ -10,12 +11,12 @@ import type { ResumeFailure } from './native-chat-resume-on-restart-grouping'
/** Keep unconfirmed outcomes distinct from refusals; offer Retry only where it can succeed. */
function actionLabel(action: ResumeFailureAction): string {
function actionLabel(action: ResumeFailureAction, t: Translate = translate): string {
return action === 'open'
? translate('auto.components.NativeChatResumeOutcomeRow.openChat', 'Open chat')
? t('auto.components.NativeChatResumeOutcomeRow.openChat', 'Open chat')
: action === 'retry'
? translate('auto.components.NativeChatResumeOutcomeRow.retry', 'Retry')
: translate('auto.components.NativeChatResumeOutcomeRow.dismiss', 'Dismiss')
? t('auto.components.NativeChatResumeOutcomeRow.retry', 'Retry')
: t('auto.components.NativeChatResumeOutcomeRow.dismiss', 'Dismiss')
}
export function ResumeFailureStatus({
@@ -31,14 +32,15 @@ export function ResumeFailureStatus({
disabled: boolean
onAction: (action: ResumeFailureAction) => void
}): React.JSX.Element {
const t = useTranslate()
const canDismiss = failure.executionHostId === undefined || failure.executionHostId === 'local'
const status =
failure.outcome === 'unconfirmed'
? translate(
? t(
'auto.components.NativeChatResumeOutcomeRow.unconfirmed',
'Couldn’t confirm the chat was resumed'
)
: translate('auto.components.NativeChatResumeOutcomeRow.failed', 'Couldn’t resume')
: t('auto.components.NativeChatResumeOutcomeRow.failed', 'Couldn’t resume')
return (
<>
<Tooltip>
@@ -47,7 +49,7 @@ export function ResumeFailureStatus({
<span
tabIndex={0}
role="img"
aria-label={translate(
aria-label={t(
'auto.components.NativeChatResumeOutcomeRow.statusFor',
'{{value0}}: {{value1}}',
{ value0: title, value1: status }
@@ -72,7 +74,7 @@ export function ResumeFailureStatus({
variant="ghost"
size="icon-xs"
disabled={disabled}
aria-label={translate(
aria-label={t(
'auto.components.NativeChatResumeOutcomeRow.dismissChat',
'Dismiss "{{value0}}" in {{value1}}',
{ value0: title, value1: workspaceName }
@@ -95,17 +97,18 @@ export function ResumeFailureGuidanceLine({
disabled: boolean
onAction: (action: ResumeFailureAction) => void
}): React.JSX.Element {
const guidance = resumeFailureGuidance(failure)
const t = useTranslate()
const guidance = resumeFailureGuidance(failure, t)
return (
<div className="mb-1 flex items-center gap-2 rounded-md border border-status-warning-border bg-status-warning-background px-2 py-1.5 text-[11px]">
<span className="min-w-0 flex-1">
<span className="font-semibold">
{translate('auto.components.NativeChatResumeOutcomeRow.toResume', 'To resume:')}
{t('auto.components.NativeChatResumeOutcomeRow.toResume', 'To resume:')}
</span>{' '}
{guidance.text}
</span>
<Button size="xs" disabled={disabled} onClick={() => onAction(guidance.primary)}>
{actionLabel(guidance.primary)}
{actionLabel(guidance.primary, t)}
</Button>
{guidance.secondary &&
(guidance.secondary !== 'dismiss' ||
@@ -117,7 +120,7 @@ export function ResumeFailureGuidanceLine({
disabled={disabled}
onClick={() => onAction(guidance.secondary!)}
>
{actionLabel(guidance.secondary)}
{actionLabel(guidance.secondary, t)}
</Button>
)}
</div>
@@ -3,7 +3,7 @@ import { AgentIcon } from '@/lib/agent-catalog'
import { agentTypeToIconAgent } from '../../../shared/agent-status/presentation/agent-type-icon-agent'
import { formatAgentTypeLabel } from '../../../shared/agent-status/presentation/agent-type-label'
import { formatShortTimeAgo } from '@/lib/short-time-ago'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import type { ResumeCandidate, ResumeFailure } from './native-chat-resume-on-restart-grouping'
import {
resumeFailureSelectable,
@@ -39,12 +39,13 @@ export function ResumeCandidateRow({
onFailureAction?: (action: ResumeFailureAction, sessionId: string) => void
renderStatus?: (sessionId: string, title: string) => React.ReactNode
}): React.JSX.Element {
const t = useTranslate()
const agentLabel = formatAgentTypeLabel(candidate.agent)
const title =
candidate.latestPrompt.trim() ||
translate('auto.components.NativeChatResumeOnRestartModal.untitled', 'Untitled chat')
t('auto.components.NativeChatResumeOnRestartModal.untitled', 'Untitled chat')
const model = candidate.model?.trim() ?? ''
const activity = resumeActivityLabel(candidate.activity)
const activity = resumeActivityLabel(candidate.activity, t)
const depth = useContext(ResumeTreeDepthContext)
const status = renderStatus?.(candidate.sessionId, title)
const act = (action: ResumeFailureAction) => onFailureAction?.(action, candidate.sessionId)
@@ -56,7 +57,7 @@ export function ResumeCandidateRow({
disabled={disabled || (failure !== undefined && !resumeFailureSelectable(failure))}
onCheckedChange={onCheckedChange}
// Identifies the agent AND its workspace: rows would otherwise all read the same.
checkboxLabel={translate(
checkboxLabel={t(
'auto.components.NativeChatResumeOnRestartModal.selectAgent',
'Resume {{value0}} chat "{{value1}}" in {{value2}}',
{ value0: agentLabel, value1: title, value2: workspaceName }
@@ -4,7 +4,7 @@ import { Button } from './ui/button'
import { Checkbox } from './ui/checkbox'
import { Dialog, DialogContent, DialogFooter } from './ui/dialog'
import { useAppStore } from '../store'
import { translate } from '@/i18n/i18n'
import { useTranslate, type Translate } from '@/i18n/use-translate'
import { activateAiVaultStructuredSession } from '@/lib/activate-ai-vault-structured-session'
import { ResumeOnRestartGroups } from './NativeChatResumeOnRestartGroups'
import { ResumeTreeRow } from './NativeChatResumeTreeRow'
@@ -35,11 +35,11 @@ import { moveInTree } from './native-chat-resume-tree-keys'
* The store owns runs across dialog closes. Closing snoozes; Dismiss all deletes durable offers. Row Retry/Dismiss keep the dialog open, and settled runs cannot close a user-reopened dialog. Unretryable failures stay outside Resume. */
/** Pre-selected unless it is a failure a retry cannot fix; resuming that would only fail again. */
function selectedByDefault(failure: ResumeFailure | undefined): boolean {
function selectedByDefault(failure: ResumeFailure | undefined, t?: Translate): boolean {
if (!failure) {
return true
}
const guidance = resumeFailureGuidance(failure)
const guidance = resumeFailureGuidance(failure, t)
return guidance.primary === 'retry' || guidance.secondary === 'retry'
}
@@ -52,6 +52,7 @@ export function NativeChatResumeOccurrenceModal({
machineName?: string
offerEnabled: boolean
}): React.JSX.Element | null {
const t = useTranslate()
const {
continueNativeChatRestartOffer,
dismissNativeChatRestartOffer,
@@ -218,7 +219,7 @@ export function NativeChatResumeOccurrenceModal({
}
const interruptedByUpdate = rows.some((row) => row.trigger === 'update')
const selectAllLabel = translate(
const selectAllLabel = t(
'auto.components.NativeChatResumeOnRestartModal.selectAllLabel',
'Select all'
)
@@ -259,11 +260,11 @@ export function NativeChatResumeOccurrenceModal({
tabIndex={0}
aria-label={
choosing
? translate(
? t(
'auto.components.NativeChatResumeOnRestartModal.listLabel',
'Chats that would be resumed'
)
: translate(
: t(
'auto.components.NativeChatResumeOnRestartModal.resultListLabel',
'Chats in this resume'
)
@@ -283,7 +284,7 @@ export function NativeChatResumeOccurrenceModal({
onCheckedChange={() =>
toggleResumeSelection(selectable, allSelection, toggleSelected)
}
checkboxLabel={translate(
checkboxLabel={t(
'auto.components.NativeChatResumeOnRestartModal.selectAll',
'Select all chats'
)}
@@ -292,7 +293,7 @@ export function NativeChatResumeOccurrenceModal({
{selectAllLabel}
</span>
<span className="ml-auto shrink-0 pl-2 text-[11px] tabular-nums text-muted-foreground">
{translate(
{t(
'auto.components.NativeChatResumeOnRestartModal.selectedCount',
'{{value0}} of {{value1}} selected',
{ value0: allSelection.selectedCount, value1: allSelection.total }
@@ -331,14 +332,14 @@ export function NativeChatResumeOccurrenceModal({
/>
<span className="min-w-0 space-y-0.5">
<span className="block text-sm">
{translate(
{t(
'auto.components.NativeChatResumeOnRestartModal.dontAskAgain',
"Don't ask again (resume automatically)"
)}
</span>
{/* Link to reversal settings; body copy explains the action. */}
<span className="block text-xs text-muted-foreground">
{translate(
{t(
'auto.components.NativeChatResumeOnRestartModal.dontAskAgainHint',
'You can turn this off in Settings → Chat → Behavior.'
)}
@@ -349,7 +350,7 @@ export function NativeChatResumeOccurrenceModal({
)}
{rows.length === 0 || (run?.inFlight === false && !choosing) ? (
<Button ref={resumeButtonRef} variant="default" size="sm" onClick={snooze}>
{translate('auto.components.NativeChatResumeOnRestartModal.done', 'Done')}
{t('auto.components.NativeChatResumeOnRestartModal.done', 'Done')}
</Button>
) : remote ? (
<NativeChatRemoteResumeActions
@@ -368,10 +369,7 @@ export function NativeChatResumeOccurrenceModal({
<>
{/* Dismiss deletes durable records rather than snoozing them. */}
<Button variant="ghost" size="sm" disabled={busy} onClick={() => void dismissAll()}>
{translate(
'auto.components.NativeChatResumeOnRestartModal.dismissAll',
'Dismiss all'
)}
{t('auto.components.NativeChatResumeOnRestartModal.dismissAll', 'Dismiss all')}
</Button>
<Button
ref={resumeButtonRef}
@@ -385,11 +383,8 @@ export function NativeChatResumeOccurrenceModal({
}}
>
{busy
? translate(
'auto.components.NativeChatResumeOnRestartModal.resuming',
'Resuming…'
)
: translate(
? t('auto.components.NativeChatResumeOnRestartModal.resuming', 'Resuming…')
: t(
'auto.components.NativeChatResumeOnRestartModal.resumeChats',
'Resume {{count}} chats',
{ count: chosen.length, defaultValue_one: 'Resume {{count}} chat' }
@@ -1,6 +1,7 @@
import { useState } from 'react'
import { Loader2 } from 'lucide-react'
import { translate } from '@/i18n/i18n'
import { useTranslate, type Translate } from '@/i18n/use-translate'
import { useNow } from '@/hooks/use-now'
import type { ResumeCandidate, ResumeFailure } from './native-chat-resume-on-restart-grouping'
import { resumeRunInFlight, type ResumeRun, type ResumeRunStarter } from './native-chat-resume-run'
@@ -23,32 +24,41 @@ export type ResumeRunPanel = {
}
/** What the run did, in the past tense: the offer's copy describes an action not yet taken. */
function finishedDescription(everyChatResumed: boolean, byUpdate: boolean): string {
function finishedDescription(
everyChatResumed: boolean,
byUpdate: boolean,
t: Translate = translate
): string {
if (everyChatResumed) {
return byUpdate
? translate(
? t(
'auto.components.NativeChatResumeRunPanel.finishedUpdate',
'These chats were working when Orca installed an update. Orca restored each one where it stopped, with its full context, and asked the agent to check what it was doing before carrying on. Your own prompts weren’t re-sent.'
)
: translate(
: t(
'auto.components.NativeChatResumeRunPanel.finished',
'These chats were working when Orca closed. Orca restored each one where it stopped, with its full context, and asked the agent to check what it was doing before carrying on. Your own prompts weren’t re-sent.'
)
}
return byUpdate
? translate(
? t(
'auto.components.NativeChatResumeRunPanel.finishedPartialUpdate',
'These chats were working when Orca installed an update. The ones Orca resumed were restored where they stopped, with their full context, and asked to check what they were doing before carrying on. Your own prompts weren’t re-sent. Check the list for chats that still need attention or can be resumed.'
)
: translate(
: t(
'auto.components.NativeChatResumeRunPanel.finishedPartial',
'These chats were working when Orca closed. The ones Orca resumed were restored where they stopped, with their full context, and asked to check what they were doing before carrying on. Your own prompts weren’t re-sent. Check the list for chats that still need attention or can be resumed.'
)
}
function runTitle(run: ResumeRun, total: number, resumed: number): React.ReactNode {
function runTitle(
run: ResumeRun,
total: number,
resumed: number,
t: Translate = translate
): React.ReactNode {
if (!resumeRunInFlight(run)) {
return translate(
return t(
'auto.components.NativeChatResumeRunPanel.resumedOfTotal',
'Resumed {{resumed}} of {{count}} chats',
{ resumed, count: total, defaultValue_one: 'Resumed {{resumed}} of {{count}} chat' }
@@ -57,11 +67,10 @@ function runTitle(run: ResumeRun, total: number, resumed: number): React.ReactNo
return (
<span className="flex items-center gap-2">
<Loader2 className="size-4 animate-spin text-muted-foreground" />
{translate(
'auto.components.NativeChatResumeRunPanel.resumingCount',
'Resuming {{count}} chats',
{ count: total, defaultValue_one: 'Resuming {{count}} chat' }
)}
{t('auto.components.NativeChatResumeRunPanel.resumingCount', 'Resuming {{count}} chats', {
count: total,
defaultValue_one: 'Resuming {{count}} chat'
})}
</span>
)
}
@@ -79,6 +88,7 @@ export function useResumeRunPanel({
selectableIds: ReadonlySet<string>
open: boolean
}): ResumeRunPanel | null {
const t = useTranslate()
// Each opening and completed run starts on All so its finished rows can be seen.
const inFlight = run !== null && resumeRunInFlight(run)
const [filter, setFilter] = useState<{
@@ -110,15 +120,16 @@ export function useResumeRunPanel({
}
const visibleIds = new Set(view.rows.map((row) => row.sessionId))
return {
title: runTitle(run, view.counts.total, view.counts.resumed),
title: runTitle(run, view.counts.total, view.counts.resumed, t),
description: inFlight
? translate(
? t(
'auto.components.NativeChatResumeRunPanel.description',
'Each chat is restored with its full context and asked to check where it stopped. You can close this; the status bar keeps track.'
)
: finishedDescription(
view.counts.resumed === view.counts.all,
run.entries.some((entry) => entry.candidate.trigger === 'update')
run.entries.some((entry) => entry.candidate.trigger === 'update'),
t
),
summary: (
<ResumeRunSummary
@@ -1,46 +1,46 @@
import { AlertCircle, Check, Clock, Loader2 } from 'lucide-react'
import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip'
import { translate } from '@/i18n/i18n'
import { useTranslate, type Translate } from '@/i18n/use-translate'
import { formatNativeChatDuration } from '../../../shared/native-chat/transcript/native-chat-turn-status'
import type { ResumeRunRowStatus } from './native-chat-resume-run-view'
export type ResumeRunStartPhase = 'starting' | 'ready' | null
/** In flight, the host's feed says how far the agent got; the resume itself does not report it. */
function inFlightText(phase: ResumeRunStartPhase): string {
function inFlightText(phase: ResumeRunStartPhase, t: Translate = translate): string {
return phase === 'ready'
? translate(
'auto.components.NativeChatResumeRunStatusIcon.waitingForReply',
'Waiting for a reply'
)
? t('auto.components.NativeChatResumeRunStatusIcon.waitingForReply', 'Waiting for a reply')
: phase === 'starting'
? translate('auto.components.NativeChatResumeRunStatusIcon.starting', 'Starting')
: translate(
'auto.components.NativeChatResumeRunStatusIcon.waitingToStart',
'Waiting to start'
)
? t('auto.components.NativeChatResumeRunStatusIcon.starting', 'Starting')
: t('auto.components.NativeChatResumeRunStatusIcon.waitingToStart', 'Waiting to start')
}
function statusText(status: ResumeRunRowStatus, phase: ResumeRunStartPhase, now: number): string {
function statusText(
status: ResumeRunRowStatus,
phase: ResumeRunStartPhase,
now: number,
t: Translate = translate
): string {
switch (status.kind) {
case 'in-flight':
return translate(
return t(
'auto.components.NativeChatResumeRunStatusIcon.inFlight',
'{{value0}} · {{value1}}',
{
value0: inFlightText(phase),
value0: inFlightText(phase, t),
value1: formatNativeChatDuration((now - status.startedAt) / 1000)
}
)
case 'resumed':
return translate('auto.components.NativeChatResumeRunStatusIcon.resumed', 'Resumed')
return t('auto.components.NativeChatResumeRunStatusIcon.resumed', 'Resumed')
case 'unconfirmed':
return translate(
return t(
'auto.components.NativeChatResumeOutcomeRow.unconfirmed',
'Couldn’t confirm the chat was resumed'
)
case 'refused':
return translate('auto.components.NativeChatResumeOutcomeRow.failed', 'Couldn’t resume')
return t('auto.components.NativeChatResumeOutcomeRow.failed', 'Couldn’t resume')
}
}
@@ -70,7 +70,8 @@ export function ResumeRunStatusIcon({
/** The chat's name, so the accessible name says which chat this is. */
title: string
}): React.JSX.Element {
const text = statusText(status, phase, now)
const t = useTranslate()
const text = statusText(status, phase, now, t)
return (
<Tooltip>
<TooltipTrigger asChild>
@@ -78,7 +79,7 @@ export function ResumeRunStatusIcon({
<span
tabIndex={0}
role="img"
aria-label={translate(
aria-label={t(
'auto.components.NativeChatResumeOutcomeRow.statusFor',
'{{value0}}: {{value1}}',
{ value0: title, value1: text }
@@ -1,5 +1,6 @@
import { ToggleGroup, ToggleGroupItem } from './ui/toggle-group'
import { translate } from '@/i18n/i18n'
import { useTranslate, type Translate } from '@/i18n/use-translate'
import { formatNativeChatDuration } from '../../../shared/native-chat/transcript/native-chat-turn-status'
import type { ResumeRunFilter, ResumeRunView } from './native-chat-resume-run-view'
import type { ResumeRunStartPhase } from './NativeChatResumeRunStatusIcon'
@@ -8,10 +9,11 @@ import type { ResumeRunStartPhase } from './NativeChatResumeRunStatusIcon'
function progressText(
counts: ResumeRunView['counts'],
phases: readonly ResumeRunStartPhase[]
phases: readonly ResumeRunStartPhase[],
t: Translate = translate
): string {
const parts = [
translate('auto.components.NativeChatResumeRunSummary.done', '{{value0}} of {{value1}} done', {
t('auto.components.NativeChatResumeRunSummary.done', '{{value0}} of {{value1}} done', {
value0: counts.done,
value1: counts.total
})
@@ -21,14 +23,14 @@ function progressText(
const waitingForReply = phases.filter((phase) => phase === 'ready').length
if (starting > 0) {
parts.push(
translate('auto.components.NativeChatResumeRunSummary.starting', '{{value0}} starting', {
t('auto.components.NativeChatResumeRunSummary.starting', '{{value0}} starting', {
value0: starting
})
)
}
if (waitingForReply > 0) {
parts.push(
translate(
t(
'auto.components.NativeChatResumeRunSummary.waitingForReply',
'{{value0}} waiting for a reply',
{ value0: waitingForReply }
@@ -37,7 +39,7 @@ function progressText(
}
if (waitingToStart > 0) {
parts.push(
translate(
t(
'auto.components.NativeChatResumeRunSummary.waitingToStart',
'{{value0}} waiting to start',
{ value0: waitingToStart }
@@ -63,31 +65,28 @@ export function ResumeRunSummary({
filter: ResumeRunFilter
onFilterChange: (filter: ResumeRunFilter) => void
}): React.JSX.Element {
const t = useTranslate()
const filters: readonly [ResumeRunFilter, string, number][] = [
['all', translate('auto.components.NativeChatResumeRunSummary.all', 'All'), counts.all],
['all', t('auto.components.NativeChatResumeRunSummary.all', 'All'), counts.all],
[
'in-progress',
translate('auto.components.NativeChatResumeRunSummary.inProgress', 'In progress'),
t('auto.components.NativeChatResumeRunSummary.inProgress', 'In progress'),
counts.inProgress
],
[
'resumed',
translate('auto.components.NativeChatResumeRunSummary.resumed', 'Resumed'),
counts.resumed
],
['resumed', t('auto.components.NativeChatResumeRunSummary.resumed', 'Resumed'), counts.resumed],
[
'attention',
translate('auto.components.NativeChatResumeRunSummary.attention', 'Need you'),
t('auto.components.NativeChatResumeRunSummary.attention', 'Need you'),
counts.attention
]
]
return (
<div className="flex flex-col gap-2">
<div className="flex items-baseline justify-between gap-3 text-xs text-muted-foreground">
<span className="min-w-0">{progressText(counts, phases)}</span>
<span className="min-w-0">{progressText(counts, phases, t)}</span>
{counts.inProgress > 0 && (
<span className="shrink-0 tabular-nums">
{translate('auto.components.NativeChatResumeRunSummary.running', 'Running {{value0}}', {
{t('auto.components.NativeChatResumeRunSummary.running', 'Running {{value0}}', {
value0: formatNativeChatDuration((now - startedAt) / 1000)
})}
</span>
@@ -109,7 +108,7 @@ export function ResumeRunSummary({
onFilterChange(next)
}
}}
aria-label={translate('auto.components.NativeChatResumeRunSummary.filter', 'Show chats')}
aria-label={t('auto.components.NativeChatResumeRunSummary.filter', 'Show chats')}
>
{filters.map(([value, label, count]) => (
<ToggleGroupItem key={value} value={value}>
@@ -1,6 +1,6 @@
import { useContext } from 'react'
import { ChevronRight } from 'lucide-react'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { Checkbox } from './ui/checkbox'
import { ResumeTreeSelectingContext } from './native-chat-resume-tree-state'
@@ -49,6 +49,7 @@ export function ResumeTreeRow({
below?: React.ReactNode
children: React.ReactNode
}): React.JSX.Element {
const t = useTranslate()
const selecting = useContext(ResumeTreeSelectingContext)
const indent = depth * RESUME_TREE_INDENT_PX
const column = selecting ? RESUME_TREE_CHECKBOX_COLUMN_PX : 0
@@ -92,12 +93,12 @@ export function ResumeTreeRow({
aria-expanded={expanded}
aria-label={
expanded
? translate(
? t(
'auto.components.NativeChatResumeOnRestartModal.collapseNode',
'Collapse {{value0}}',
{ value0: name }
)
: translate(
: t(
'auto.components.NativeChatResumeOnRestartModal.expandNode',
'Expand {{value0}}',
{ value0: name }
@@ -143,12 +144,13 @@ export function ResumeTreeCount({
selectedCount: number
total: number
}): React.JSX.Element | null {
const t = useTranslate()
if (total === 0) {
return null
}
return (
<span className="ml-auto shrink-0 pl-2 text-[11px] tabular-nums text-muted-foreground">
{translate(
{t(
'auto.components.NativeChatResumeOnRestartModal.workspaceSelectedCount',
'{{value0}} of {{value1}}',
{ value0: selectedCount, value1: total }
@@ -17,6 +17,7 @@ import { unwrapRuntimeRpcResult } from '@/runtime/rpc/calls/runtime-rpc-result'
import { withUiConnectTimeout } from '@/ssh/ssh-connect-ui-timeout'
import { isSshConnectInFlight, trackSshConnect } from '@/ssh/ssh-connect-in-flight'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import {
DEFAULT_DISABLED_TUI_AGENTS,
filterEnabledTuiAgents
@@ -55,6 +56,7 @@ const SetProjectLocationDialog = lazyWithRetry(
export default function NewWorkspaceComposerCard(
props: NewWorkspaceComposerCardProps
): React.JSX.Element {
const t = useTranslate()
useTranslation()
const {
contextualTourSource,
@@ -136,11 +138,11 @@ export default function NewWorkspaceComposerCard(
needsSetupProjectHostSetupOptions.length > 0
const sshStatusLabel = selectedRepoSshStatus
? getSshStatusLabel(selectedRepoSshStatus)
: translate('auto.components.NewWorkspaceComposerCard.notConnected', 'Not connected')
: t('auto.components.NewWorkspaceComposerCard.notConnected', 'Not connected')
const connectButtonLabel =
selectedRepoSshStatus === 'disconnected' || selectedRepoSshStatus === null
? translate('auto.components.NewWorkspaceComposerCard.connect', 'Connect')
: translate('auto.components.NewWorkspaceComposerCard.reconnect', 'Reconnect')
? t('auto.components.NewWorkspaceComposerCard.connect', 'Connect')
: t('auto.components.NewWorkspaceComposerCard.reconnect', 'Reconnect')
const showSetupAgentStartupPolicy =
setupControlsEnabled && setupConfig !== null && setupConfig.kind !== 'default-tabs'
const agentCatalog = getAgentCatalog()
@@ -38,6 +38,7 @@ import { shouldAllowComposerEnterSubmitTarget } from '@/lib/new-workspace-enter-
import { isScreenSubmitShortcut } from '@/lib/screen-submit-shortcut'
import type { TuiAgent } from '../../../shared/agent-launch/catalog/tui-agent'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { getWorkspaceComposerInitialFocusTarget } from '@/lib/workspace-composer-initial-focus'
import '@/components/sidebar/workspace-creation/folder/folder-workspace-source-repos'
import { getFolderWorkspacePrimaryActionLabel } from '@/components/sidebar/workspace-creation/folder/folder-workspace-source-selection'
@@ -124,6 +125,7 @@ function QuickTabBody({
isSubmissionCancelled: () => boolean
active: boolean
}): React.JSX.Element {
const t = useTranslate()
const settings = useAppStore((s) => s.settings)
const {
cardProps,
@@ -318,10 +320,10 @@ function QuickTabBody({
)
const isFolderWorkspaceTarget = selectedProjectOption?.kind === 'project-group'
const primaryActionLabel = isFolderWorkspaceTarget
? getFolderWorkspacePrimaryActionLabel()
? getFolderWorkspacePrimaryActionLabel(t)
: cardProps.selectedRepoIsGit
? translate('auto.components.NewWorkspaceComposerModal.createWorktree', 'Create worktree')
: translate('auto.components.NewWorkspaceComposerModal.createWorkspace', 'Create workspace')
? t('auto.components.NewWorkspaceComposerModal.createWorktree', 'Create worktree')
: t('auto.components.NewWorkspaceComposerModal.createWorkspace', 'Create workspace')
// Let Radix own Escape for the topmost layer. This dialog auto-focuses input, so page-style blur-first handling swallowed its first Escape.
const nestedDialogOpen = agentSettingsOpen || addProjectOpen || setLocationOpen
@@ -357,14 +359,14 @@ function QuickTabBody({
<DialogHeader className="gap-1">
<DialogTitle className="text-base font-semibold">
{isFolderWorkspaceTarget
? translate(
? t(
'auto.components.sidebar.FolderWorkspaceComposerDialog.title',
'Create Folder Workspace'
)
: primaryActionLabel}
</DialogTitle>
<DialogDescription className="sr-only">
{translate(
{t(
'components.newWorkspace.createDescription',
'Choose the project and workspace name. Select an agent if you want to start one.'
)}
@@ -2,6 +2,7 @@ import { Loader2 } from 'lucide-react'
import { toast } from 'sonner'
import { Button } from './ui/button'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { cn } from '@/lib/utils'
import { useAppStore } from '../store'
@@ -22,6 +23,7 @@ export function OrcaSignInButton({
disabled,
...props
}: Omit<React.ComponentProps<typeof Button>, 'onClick' | 'type'>): React.JSX.Element {
const t = useTranslate()
const connect = useAppStore((state) => state.connectCurrentOrcaProfile)
const signingIn = useAppStore((state) => Boolean(state.orcaProfileSignInProgress))
return (
@@ -34,7 +36,7 @@ export function OrcaSignInButton({
{signingIn ? (
<>
<Loader2 className="animate-spin" />
{translate('auto.components.OrcaSignInProgress.signingIn', 'Signing in…')}
{t('auto.components.OrcaSignInProgress.signingIn', 'Signing in…')}
</>
) : (
children
@@ -48,6 +50,7 @@ export function OrcaSignInWaitNotice({
}: {
className?: string
}): React.JSX.Element | null {
const t = useTranslate()
const link = useAppStore((state) => state.orcaProfileSignInProgress?.link)
if (!link) {
return null
@@ -61,14 +64,11 @@ export function OrcaSignInWaitNotice({
)}
>
<span className="pr-2">
{translate(
'auto.components.OrcaSignInProgress.waiting',
'Waiting for sign-in in your browser'
)}
{t('auto.components.OrcaSignInProgress.waiting', 'Waiting for sign-in in your browser')}
</span>
<span aria-hidden>·</span>
<Button type="button" variant="link" size="xs" onClick={() => void copySignInLink(link)}>
{translate('auto.components.OrcaSignInProgress.copyLink', 'Copy sign-in link')}
{t('auto.components.OrcaSignInProgress.copyLink', 'Copy sign-in link')}
</Button>
<span aria-hidden>·</span>
<Button
@@ -77,7 +77,7 @@ export function OrcaSignInWaitNotice({
size="xs"
onClick={() => void window.api.orcaProfiles.cancelSignIn().catch(() => {})}
>
{translate('auto.components.OrcaSignInProgress.cancel', 'Cancel')}
{t('auto.components.OrcaSignInProgress.cancel', 'Cancel')}
</Button>
</div>
)
+14 -13
View File
@@ -20,7 +20,7 @@ import { rankQuickOpenFilesWithHistory } from './quick-open-history-ranking'
import { useQuickOpenHistory } from '@/lib/quick-open-file-history'
import { useRuntimeFileListForWorktree } from '@/components/quick-open-file-list'
import { useModalReturnFocus } from '@/hooks/useModalReturnFocus'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import {
parseQuickOpenInstallRgGuidance,
QuickOpenInstallRgGuidance
@@ -56,6 +56,7 @@ export default function QuickOpen(): React.JSX.Element | null {
}
function QuickOpenContent({ visible }: { visible: boolean }): React.JSX.Element {
const t = useTranslate()
const closeModal = useAppStore((s) => s.closeModal)
const activeWorktreeId = useAppStore((s) => s.activeWorktreeId)
const activeWorktree = useActiveWorktree()
@@ -171,11 +172,11 @@ function QuickOpenContent({ visible }: { visible: boolean }): React.JSX.Element
}}
onOpenAutoFocus={handleOpenAutoFocus}
onCloseAutoFocus={handleCloseAutoFocus}
title={translate('auto.components.QuickOpen.ec31e058f7', 'Go to file')}
description={translate('auto.components.QuickOpen.9e97f08d0f', 'Search for a file to open')}
title={t('auto.components.QuickOpen.ec31e058f7', 'Go to file')}
description={t('auto.components.QuickOpen.9e97f08d0f', 'Search for a file to open')}
>
<CommandInput
placeholder={translate('auto.components.QuickOpen.1cb6ef47b7', 'Go to file...')}
placeholder={t('auto.components.QuickOpen.1cb6ef47b7', 'Go to file...')}
value={query}
onValueChange={(value) => {
invalidate()
@@ -198,7 +199,7 @@ function QuickOpenContent({ visible }: { visible: boolean }): React.JSX.Element
) : null}
{loading && !absoluteQuery ? (
<div className="py-6 text-center text-sm text-muted-foreground">
{translate('auto.components.QuickOpen.722a21e1a8', 'Loading files...')}
{t('auto.components.QuickOpen.722a21e1a8', 'Loading files...')}
</div>
) : loadError && !absoluteQuery ? (
(() => {
@@ -217,7 +218,7 @@ function QuickOpenContent({ visible }: { visible: boolean }): React.JSX.Element
})()
) : filtered.length === 0 ? (
<CommandEmpty>
{translate('auto.components.QuickOpen.74e2e1b3e4', 'No matching files.')}
{t('auto.components.QuickOpen.74e2e1b3e4', 'No matching files.')}
</CommandEmpty>
) : (
filtered.map((item) => {
@@ -256,7 +257,7 @@ function QuickOpenContent({ visible }: { visible: boolean }): React.JSX.Element
)}
{truncated && !loading && !loadError ? (
<div className="px-3 py-2 text-center text-xs text-muted-foreground">
{translate(
{t(
'quickOpen.moreMatchesAvailable',
'More matches may be available. Refine your search to narrow the results.'
)}
@@ -265,18 +266,18 @@ function QuickOpenContent({ visible }: { visible: boolean }): React.JSX.Element
</CommandList>
<div className="flex items-center justify-end border-t border-border/60 px-3.5 py-2.5 text-[11px] text-muted-foreground/82">
<div className="flex items-center gap-2">
<FooterKey>{translate('auto.components.QuickOpen.250e5b2dfb', 'Enter')}</FooterKey>
<span>{translate('auto.components.QuickOpen.61b1c871a6', 'Open')}</span>
<FooterKey>{translate('auto.components.QuickOpen.95fccbae88', 'Esc')}</FooterKey>
<span>{translate('auto.components.QuickOpen.73b2c581f1', 'Close')}</span>
<FooterKey>{t('auto.components.QuickOpen.250e5b2dfb', 'Enter')}</FooterKey>
<span>{t('auto.components.QuickOpen.61b1c871a6', 'Open')}</span>
<FooterKey>{t('auto.components.QuickOpen.95fccbae88', 'Esc')}</FooterKey>
<span>{t('auto.components.QuickOpen.73b2c581f1', 'Close')}</span>
<FooterKey>↑↓</FooterKey>
<span>{translate('auto.components.QuickOpen.1dbd3f59ff', 'Move')}</span>
<span>{t('auto.components.QuickOpen.1dbd3f59ff', 'Move')}</span>
</div>
</div>
{/* Announce result count changes to assistive technology. */}
<div aria-live="polite" className="sr-only">
{deferredQuery.trim()
? translate('auto.components.QuickOpen.filesFound', '{{count}} files found', {
? t('auto.components.QuickOpen.filesFound', '{{count}} files found', {
count: filtered.length,
defaultValue_one: '{{count}} file found'
})
@@ -1,7 +1,7 @@
import React from 'react'
import { createPortal } from 'react-dom'
import { Copy } from 'lucide-react'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { addViewportSizeChangeListener } from '@/hooks/viewport-size-change-listener'
import { addAppKeyListener, removeAppKeyListener } from '@/lib/app-keyboard-router'
@@ -43,6 +43,7 @@ export function SelectedTextCopyMenu({
children,
className
}: SelectedTextCopyMenuProps): React.JSX.Element {
const t = useTranslate()
const [menu, setMenu] = React.useState<MenuState | null>(null)
React.useEffect(() => {
@@ -117,7 +118,7 @@ export function SelectedTextCopyMenu({
onClick={handleCopy}
>
<Copy className="size-3.5 text-muted-foreground" />
{translate('auto.components.SelectedTextCopyMenu.9b40d7b018', 'Copy')}
{t('auto.components.SelectedTextCopyMenu.9b40d7b018', 'Copy')}
</button>
</div>,
document.body
@@ -1,6 +1,6 @@
import React from 'react'
import { cn } from '@/lib/utils'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
function KeyCap({
label,
@@ -40,6 +40,7 @@ export function ShortcutKeyCombo({
renderKey,
doubleTap = false
}: ShortcutKeyComboProps): React.JSX.Element {
const t = useTranslate()
const isMac = navigator.userAgent.includes('Mac')
return (
@@ -47,7 +48,7 @@ export function ShortcutKeyCombo({
className={cn('inline-flex items-center gap-1', className)}
title={
doubleTap && keys.length > 0
? translate('auto.components.ShortcutKeyCombo.07eb4985a1', 'Double-tap {{value0}}', {
? t('auto.components.ShortcutKeyCombo.07eb4985a1', 'Double-tap {{value0}}', {
value0: keys[0]
})
: undefined
+10 -9
View File
@@ -3,13 +3,14 @@ import { ExternalLink, Star, X } from 'lucide-react'
import { Card } from './ui/card'
import { Button } from './ui/button'
import { useMountedRef } from '@/hooks/useMountedRef'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
const ORCA_REPO_URL = 'https://github.com/stablyai/orca'
type StarNagMode = 'gh' | 'web'
/** Main owns visibility thresholds and GitHub checks. Keep the card until explicit action; nonterminal exits persist a cooldown. */
export function StarNagCard(): React.JSX.Element | null {
const t = useTranslate()
const [visible, setVisible] = useState(false)
const [busy, setBusy] = useState(false)
const [mode, setMode] = useState<StarNagMode>('gh')
@@ -133,7 +134,7 @@ export function StarNagCard(): React.JSX.Element | null {
<div className="flex items-center gap-2">
<Star className="size-4 fill-amber-400/60 text-amber-400/80" />
<h3 id="star-nag-heading" className="text-sm font-semibold">
{translate('auto.components.StarNagCard.5f6df21046', 'Enjoying Orca?')}
{t('auto.components.StarNagCard.5f6df21046', 'Enjoying Orca?')}
</h3>
</div>
<Button
@@ -142,14 +143,14 @@ export function StarNagCard(): React.JSX.Element | null {
className="size-7 shrink-0"
onClick={handleClose}
disabled={busy}
aria-label={translate('auto.components.StarNagCard.b5e685e4d9', 'Dismiss')}
aria-label={t('auto.components.StarNagCard.b5e685e4d9', 'Dismiss')}
>
<X className="size-3.5" />
</Button>
</div>
<p className="text-sm text-muted-foreground">
{translate(
{t(
'auto.components.StarNagCard.30c36231c1',
'Orca is open source. If it helped today, a GitHub star helps other developers find it.'
)}
@@ -170,11 +171,11 @@ export function StarNagCard(): React.JSX.Element | null {
)}
{busy
? mode === 'web'
? translate('auto.components.StarNagCard.d32015fec7', 'Opening...')
: translate('auto.components.StarNagCard.af3c9bbb37', 'Starring…')
? t('auto.components.StarNagCard.d32015fec7', 'Opening...')
: t('auto.components.StarNagCard.af3c9bbb37', 'Starring…')
: mode === 'web'
? translate('auto.components.StarNagCard.157bb5ecbb', 'Open GitHub')
: translate('auto.components.StarNagCard.2d67b6c849', 'Star on GitHub')}
? t('auto.components.StarNagCard.157bb5ecbb', 'Open GitHub')
: t('auto.components.StarNagCard.2d67b6c849', 'Star on GitHub')}
</Button>
<Button
variant="secondary"
@@ -183,7 +184,7 @@ export function StarNagCard(): React.JSX.Element | null {
onClick={handleLater}
disabled={busy}
>
{translate('auto.components.StarNagCard.8c967b4d15', 'Later')}
{t('auto.components.StarNagCard.8c967b4d15', 'Later')}
</Button>
</div>
</div>
@@ -1,6 +1,6 @@
import { Suspense } from 'react'
import { lazyWithRetry as lazy } from '@/lib/lazy-with-retry'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import type { TerminalController } from './use-terminal-controller'
const EditorPanel = lazy(() => import('./editor/EditorPanel'))
@@ -10,6 +10,7 @@ export function TerminalLegacyEditorSurface({
}: {
controller: TerminalController
}): React.JSX.Element | null {
const t = useTranslate()
const { activeTabType, renderedActiveWorktreeId, worktreeFiles } = controller
if (!renderedActiveWorktreeId || activeTabType !== 'editor' || worktreeFiles.length === 0) {
return null
@@ -18,7 +19,7 @@ export function TerminalLegacyEditorSurface({
<Suspense
fallback={
<div className="flex-1 flex items-center justify-center text-muted-foreground text-sm">
{translate('auto.components.Terminal.5c1d2a32bb', 'Loading editor...')}
{t('auto.components.Terminal.5c1d2a32bb', 'Loading editor...')}
</div>
}
>
@@ -4,7 +4,7 @@ import { ChevronUp, ChevronDown, X, CaseSensitive, Regex } from 'lucide-react'
import type { SearchAddon } from '@xterm/addon-search'
import { Button } from '@/components/ui/button'
import type { SearchState } from '@/components/terminal-pane/input/keyboard/terminal-keyboard-shortcut-matching'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { getFindRequestQuery } from '@/lib/find-query-bounds'
import { safeFind } from './terminal-search-safe-find'
import { buildTerminalSearchOptions } from './terminal-search-options'
@@ -36,6 +36,7 @@ export default function TerminalSearch({
searchStateRef,
inputRef
}: TerminalSearchProps): React.JSX.Element | null {
const t = useTranslate()
const [query, setQuery] = useState('')
const [caseSensitive, setCaseSensitive] = useState(false)
const [regex, setRegex] = useState(false)
@@ -130,7 +131,7 @@ export default function TerminalSearch({
const matchStatus = !requestQuery
? '0/0'
: results.resultCount === 0
? translate('auto.components.TerminalSearch.10e039b591', 'No results')
? t('auto.components.TerminalSearch.10e039b591', 'No results')
: results.resultIndex === -1
? `${results.resultCount}+`
: `${results.resultIndex + 1}/${results.resultCount}`
@@ -147,7 +148,7 @@ export default function TerminalSearch({
type="text"
value={query}
onChange={(e) => setQuery(e.target.value)}
placeholder={translate('auto.components.TerminalSearch.e07012f26e', 'Search...')}
placeholder={t('auto.components.TerminalSearch.e07012f26e', 'Search...')}
className="min-w-0 flex-1 border-none bg-transparent text-sm text-popover-foreground outline-none placeholder:text-muted-foreground"
/>
@@ -158,7 +159,7 @@ export default function TerminalSearch({
aria-pressed={caseSensitive}
onClick={() => setCaseSensitive((v) => !v)}
className="shrink-0"
title={translate('auto.components.TerminalSearch.90c61387d9', 'Case sensitive')}
title={t('auto.components.TerminalSearch.90c61387d9', 'Case sensitive')}
>
<CaseSensitive size={14} />
</Button>
@@ -170,7 +171,7 @@ export default function TerminalSearch({
aria-pressed={regex}
onClick={() => setRegex((v) => !v)}
className="shrink-0"
title={translate('auto.components.TerminalSearch.42e466b9f1', 'Regex')}
title={t('auto.components.TerminalSearch.42e466b9f1', 'Regex')}
>
<Regex size={14} />
</Button>
@@ -187,7 +188,7 @@ export default function TerminalSearch({
size="icon-xs"
onClick={findPrevious}
className="shrink-0"
title={translate('auto.components.TerminalSearch.0f3066256e', 'Previous match')}
title={t('auto.components.TerminalSearch.0f3066256e', 'Previous match')}
>
<ChevronUp size={14} />
</Button>
@@ -198,7 +199,7 @@ export default function TerminalSearch({
size="icon-xs"
onClick={findNext}
className="shrink-0"
title={translate('auto.components.TerminalSearch.7cb40c04eb', 'Next match')}
title={t('auto.components.TerminalSearch.7cb40c04eb', 'Next match')}
>
<ChevronDown size={14} />
</Button>
@@ -211,7 +212,7 @@ export default function TerminalSearch({
size="icon-xs"
onClick={onClose}
className="shrink-0"
title={translate('auto.components.TerminalSearch.db234b7519', 'Close')}
title={t('auto.components.TerminalSearch.db234b7519', 'Close')}
>
<X size={14} />
</Button>
@@ -8,7 +8,7 @@ import {
DialogTitle
} from '@/components/ui/dialog'
import { Button } from '@/components/ui/button'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import type { TerminalController } from './use-terminal-controller'
export function TerminalWorkspaceDialogs({
@@ -16,6 +16,7 @@ export function TerminalWorkspaceDialogs({
}: {
controller: TerminalController
}): React.JSX.Element {
const t = useTranslate()
const {
confirmNativeWindowClose,
handleSaveDialogCancel,
@@ -40,30 +41,27 @@ export function TerminalWorkspaceDialogs({
<DialogContent className="max-w-sm">
<DialogHeader>
<DialogTitle className="text-sm">
{translate('auto.components.Terminal.21295c6b8c', 'Unsaved Changes')}
{t('auto.components.Terminal.21295c6b8c', 'Unsaved Changes')}
</DialogTitle>
<DialogDescription className="text-xs">
{saveDialogFile
? translate(
? t(
'auto.components.Terminal.61ed600d29',
'"{{value0}}" has unsaved changes. Do you want to save before closing?',
{ value0: basename(saveDialogFile.relativePath) }
)
: translate(
'auto.components.Terminal.46e08bc5c8',
'This file has unsaved changes.'
)}
: t('auto.components.Terminal.46e08bc5c8', 'This file has unsaved changes.')}
</DialogDescription>
</DialogHeader>
<DialogFooter className="gap-2">
<Button type="button" variant="outline" size="sm" onClick={handleSaveDialogCancel}>
{translate('auto.components.Terminal.f82e9f02df', 'Cancel')}
{t('auto.components.Terminal.f82e9f02df', 'Cancel')}
</Button>
<Button type="button" variant="outline" size="sm" onClick={handleSaveDialogDiscard}>
{translate('auto.components.Terminal.0037b21794', "Don't Save")}
{t('auto.components.Terminal.0037b21794', "Don't Save")}
</Button>
<Button type="button" size="sm" onClick={handleSaveDialogSave}>
{translate('auto.components.Terminal.cd51e28d8b', 'Save')}
{t('auto.components.Terminal.cd51e28d8b', 'Save')}
</Button>
</DialogFooter>
</DialogContent>
@@ -80,15 +78,15 @@ export function TerminalWorkspaceDialogs({
<DialogContent className="max-w-sm" showCloseButton={false}>
<DialogHeader>
<DialogTitle className="text-sm">
{translate('auto.components.Terminal.2fa9c69ff3', 'Close Window?')}
{t('auto.components.Terminal.2fa9c69ff3', 'Close Window?')}
</DialogTitle>
<DialogDescription className="text-xs">
{windowCloseDialogKind === 'unverifiable'
? translate(
? t(
'auto.components.Terminal.b7c1f0a934',
'A remote host could not be reached, so Orca cannot tell whether work is still running there. Close the window anyway?'
)
: translate(
: t(
'auto.components.Terminal.7958465754',
'There are terminals with running processes. Close the window anyway?'
)}
@@ -101,7 +99,7 @@ export function TerminalWorkspaceDialogs({
size="sm"
onClick={() => setWindowCloseDialogOpen(false)}
>
{translate('auto.components.Terminal.f82e9f02df', 'Cancel')}
{t('auto.components.Terminal.f82e9f02df', 'Cancel')}
</Button>
<Button
type="button"
@@ -113,7 +111,7 @@ export function TerminalWorkspaceDialogs({
confirmNativeWindowClose()
}}
>
{translate('auto.components.Terminal.73768427cf', 'Close')}
{t('auto.components.Terminal.73768427cf', 'Close')}
</Button>
</DialogFooter>
</DialogContent>
@@ -1,7 +1,7 @@
import { useEffect, useState } from 'react'
import { BookOpen, ChevronDown, CircleUserRound, Files, Smartphone, X } from 'lucide-react'
import { useAppStore } from '../store'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { cn } from '@/lib/utils'
import { Button } from './ui/button'
import { Card } from './ui/card'
@@ -44,6 +44,7 @@ function FeatureRow({
}
export function UnexpectedSignoutCard(): React.JSX.Element | null {
const t = useTranslate()
const authStatus = useAppStore((s) => s.orcaProfileAuthStatus)
const persistedUIReady = useAppStore((s) => s.persistedUIReady)
const persistedDismissedVersion = useAppStore((s) => s.dismissedUnexpectedSignoutVersion)
@@ -159,10 +160,7 @@ export function UnexpectedSignoutCard(): React.JSX.Element | null {
<div className="flex items-center gap-2">
<CircleUserRound className="size-4 text-muted-foreground" />
<h3 id="unexpected-signout-heading" className="text-sm font-semibold">
{translate(
'auto.components.UnexpectedSignoutCard.9f2c1a4b7d',
"You've been signed out"
)}
{t('auto.components.UnexpectedSignoutCard.9f2c1a4b7d', "You've been signed out")}
</h3>
</div>
<Button
@@ -170,7 +168,7 @@ export function UnexpectedSignoutCard(): React.JSX.Element | null {
size="icon"
className="size-7 shrink-0"
onClick={handleDismiss}
aria-label={translate('auto.components.UnexpectedSignoutCard.3e8f5c2a91', 'Dismiss')}
aria-label={t('auto.components.UnexpectedSignoutCard.3e8f5c2a91', 'Dismiss')}
>
<X className="size-3.5" />
</Button>
@@ -178,12 +176,12 @@ export function UnexpectedSignoutCard(): React.JSX.Element | null {
<p className="text-sm text-muted-foreground">
{email
? translate(
? t(
'auto.components.UnexpectedSignoutCard.7b4d9e1f2a',
'Sign in again as {{value0}} to restore Artifact sharing, Orca Relay, and skill sharing.',
{ value0: email }
)
: translate(
: t(
'auto.components.UnexpectedSignoutCard.5a1c8d3e6f',
'Sign in again to restore Artifact sharing, Orca Relay, and skill sharing.'
)}
@@ -197,7 +195,7 @@ export function UnexpectedSignoutCard(): React.JSX.Element | null {
className="w-fit gap-1 px-1 text-xs text-muted-foreground"
aria-expanded={expanded}
>
{translate('auto.components.UnexpectedSignoutCard.1f6b2c9d4e', 'What you get back')}
{t('auto.components.UnexpectedSignoutCard.1f6b2c9d4e', 'What you get back')}
<ChevronDown
className={cn('size-3.5 transition-transform', expanded && 'rotate-180')}
/>
@@ -206,30 +204,24 @@ export function UnexpectedSignoutCard(): React.JSX.Element | null {
<CollapsibleContent className="space-y-3 pt-2.5">
<FeatureRow
icon={Files}
title={translate(
'auto.components.UnexpectedSignoutCard.8d2e4f7a1b',
'Artifact sharing'
)}
description={translate(
title={t('auto.components.UnexpectedSignoutCard.8d2e4f7a1b', 'Artifact sharing')}
description={t(
'auto.components.UnexpectedSignoutCard.2c9a5b6e8d',
'Publish HTML and Markdown files and manage every shared link from Orca.'
)}
/>
<FeatureRow
icon={Smartphone}
title={translate('auto.components.UnexpectedSignoutCard.6e3f1a9c5b', 'Orca Relay')}
description={translate(
title={t('auto.components.UnexpectedSignoutCard.6e3f1a9c5b', 'Orca Relay')}
description={t(
'auto.components.UnexpectedSignoutCard.4b7d2e8f1a',
'Connect Orca Mobile to this desktop across cellular or any Wi-Fi.'
)}
/>
<FeatureRow
icon={BookOpen}
title={translate(
'auto.components.UnexpectedSignoutCard.9a4c6b2d7e',
'Skill sharing'
)}
description={translate(
title={t('auto.components.UnexpectedSignoutCard.9a4c6b2d7e', 'Skill sharing')}
description={t(
'auto.components.UnexpectedSignoutCard.3d8e5f1b9c',
'Share skills behind an unlisted link and install them on any machine you use.'
)}
@@ -239,7 +231,7 @@ export function UnexpectedSignoutCard(): React.JSX.Element | null {
<div className="mt-0.5 flex gap-2">
<OrcaSignInButton variant="default" size="sm" className="flex-1" disabled={!canConnect}>
{translate('auto.components.UnexpectedSignoutCard.c5b3e8a17d', 'Sign in to Orca')}
{t('auto.components.UnexpectedSignoutCard.c5b3e8a17d', 'Sign in to Orca')}
</OrcaSignInButton>
</div>
<OrcaSignInWaitNotice />
+22 -18
View File
@@ -5,7 +5,7 @@ import { usePrefersReducedMotion } from '@/hooks/usePrefersReducedMotion'
import { useAppStore } from '../store'
import { Card } from './ui/card'
import { Button } from './ui/button'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { updaterMessageText } from '@/lib/updater-message-copy'
import { UpdateCardStateContent } from './maintenance/update-card/UpdateCardStateContent'
import { buildUpdateCardErrorModel } from './maintenance/update-card/update-card-error-model'
@@ -18,6 +18,7 @@ import {
export { isHttp2ProtocolError }
export function UpdateCard(): React.JSX.Element | null {
const t = useTranslate()
const status = useAppStore((state) => state.updateStatus)
const changelog: ChangelogData | null = useAppStore((state) => state.updateChangelog)
const updateUserInitiatedCycle = useAppStore((state) => state.updateUserInitiatedCycle)
@@ -145,7 +146,7 @@ export function UpdateCard(): React.JSX.Element | null {
const message = String((error as Error)?.message ?? error)
console.error('[updates] failed to enable HTTP/1.1 compatibility:', error)
setCompatibilitySetupError(
translate(
t(
'auto.components.UpdateCard.compatibilityModeFailed',
'Could not enable compatibility mode. {{message}}',
{ message }
@@ -154,19 +155,22 @@ export function UpdateCard(): React.JSX.Element | null {
setCompatibilityRelaunching(false)
})
}
const errorCard = buildUpdateCardErrorModel({
status,
isLocalBuild,
cachedVersion,
installError,
compatibilityRelaunching,
compatibilitySetupError,
onChooseLocalBuild: () => void window.api.updater.check({ localBuild: true }),
onEnableHttp1Compatibility: handleEnableHttp1Compatibility,
onRetryDownload: handleUpdate,
onRecheck: () => void window.api.updater.check({ includePrerelease: false }),
onInstallRetry: handleInstallRetry
})
const errorCard = buildUpdateCardErrorModel(
{
status,
isLocalBuild,
cachedVersion,
installError,
compatibilityRelaunching,
compatibilitySetupError,
onChooseLocalBuild: () => void window.api.updater.check({ localBuild: true }),
onEnableHttp1Compatibility: handleEnableHttp1Compatibility,
onRetryDownload: handleUpdate,
onRecheck: () => void window.api.updater.check({ includePrerelease: false }),
onInstallRetry: handleInstallRetry
},
t
)
const linuxPackageRecovery =
status.state === 'error' && status.recovery?.kind === 'linux-package-install'
? { recovery: status.recovery, diagnostic: updaterMessageText(status) }
@@ -251,7 +255,7 @@ export function UpdateCard(): React.JSX.Element | null {
<div className="flex items-center gap-3 p-3">
<div className="flex-1 min-w-0">
<p className="text-xs text-muted-foreground">
{translate(
{t(
'auto.components.UpdateCard.b1d867f4fb',
"Your terminal sessions won't be interrupted during the update."
)}
@@ -262,7 +266,7 @@ export function UpdateCard(): React.JSX.Element | null {
size="icon"
className="size-7 shrink-0"
onClick={markReassuranceSeen}
aria-label={translate('auto.components.UpdateCard.7274ef6e59', 'Dismiss tip')}
aria-label={t('auto.components.UpdateCard.7274ef6e59', 'Dismiss tip')}
>
<X className="size-3.5" />
</Button>
@@ -271,7 +275,7 @@ export function UpdateCard(): React.JSX.Element | null {
)}
<Card
role="complementary"
aria-label={getUpdateCardAriaLabel(status)}
aria-label={getUpdateCardAriaLabel(status, t)}
aria-live="polite"
tabIndex={-1}
onKeyDown={handleKeyDown}
@@ -11,7 +11,7 @@ import {
} from 'lucide-react'
import type { UpdateInstallBlocker } from '../../../shared/update-status-types'
import { Button } from './ui/button'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
export type UpdateErrorCardAction = {
label: string
@@ -84,6 +84,7 @@ export function UpdateErrorCardContent({
footnote,
onClose
}: UpdateErrorCardModel & { onClose: () => void }) {
const t = useTranslate()
// Lead with the summary; raw diagnostics stay collapsed.
const [showDetails, setShowDetails] = useState(false)
const detailId = useId()
@@ -117,7 +118,7 @@ export function UpdateErrorCardContent({
size="icon"
className="shrink-0 min-w-[44px] min-h-[44px] -m-2"
onClick={onClose}
aria-label={translate('auto.components.UpdateCard.8acbdd3961', 'Minimize to status bar')}
aria-label={t('auto.components.UpdateCard.8acbdd3961', 'Minimize to status bar')}
>
<Minus className="size-3.5" />
</Button>
@@ -131,22 +132,22 @@ export function UpdateErrorCardContent({
{blockers && blockers.length > 0 && (
<ul
aria-label={translate('updates.installBlock.instancesLabel', 'Instances using Orca')}
aria-label={t('updates.installBlock.instancesLabel', 'Instances using Orca')}
className="space-y-2"
>
{blockers.map(({ pid, kind }) => (
<li key={pid} className="flex items-center justify-between gap-3 text-xs">
<span>
{kind === 'browser'
? translate('updates.installBlock.browserLabel', 'Background browser')
? t('updates.installBlock.browserLabel', 'Background browser')
: kind === 'server'
? translate('updates.installBlock.serverLabel', 'Background server')
? t('updates.installBlock.serverLabel', 'Background server')
: kind === 'window'
? translate('updates.installBlock.windowLabel', 'Other Orca window')
: translate('updates.installBlock.instanceLabel', 'Other Orca instance')}
? t('updates.installBlock.windowLabel', 'Other Orca window')
: t('updates.installBlock.instanceLabel', 'Other Orca instance')}
</span>
<span className="font-mono text-muted-foreground">
{translate('updates.installBlock.processId', 'PID {{pid}}', { pid })}
{t('updates.installBlock.processId', 'PID {{pid}}', { pid })}
</span>
</li>
))}
@@ -169,13 +170,13 @@ export function UpdateErrorCardContent({
className={`size-3.5 transition-transform motion-reduce:transition-none ${showDetails ? 'rotate-90' : ''}`}
/>
{showDetails
? translate('auto.components.UpdateCard.5194358929', 'Hide details')
: translate('auto.components.UpdateCard.8bc9e17d8f', 'Show details')}
? t('auto.components.UpdateCard.5194358929', 'Hide details')
: t('auto.components.UpdateCard.8bc9e17d8f', 'Show details')}
</Button>
{showDetails ? (
<div id={detailId} className="rounded-md bg-muted/40 px-3 py-2">
<p className="mb-1 text-[11px] font-medium uppercase text-muted-foreground">
{translate('auto.components.UpdateCard.3553a8672f', 'Details')}
{t('auto.components.UpdateCard.3553a8672f', 'Details')}
</p>
<p className="scrollbar-sleek max-h-20 overflow-auto break-words font-mono text-xs leading-relaxed text-muted-foreground">
{detail}
@@ -211,8 +212,7 @@ export function UpdateErrorCardContent({
}}
className="flex-1"
>
{manualLabel ??
translate('auto.components.UpdateCard.47126bcf57', 'Download Manually')}
{manualLabel ?? t('auto.components.UpdateCard.47126bcf57', 'Download Manually')}
</Button>
)}
</div>
@@ -9,7 +9,7 @@ import {
DialogHeader,
DialogTitle
} from '@/components/ui/dialog'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { useAppStore } from '@/store'
import {
dismissWorktreeBaseFallbackNotice,
@@ -18,6 +18,7 @@ import {
} from './worktree-base-fallback-notice'
export default function WorktreeBaseFallbackDialog(): React.JSX.Element {
const t = useTranslate()
const notice = useSyncExternalStore(
subscribeWorktreeBaseFallbackNotice,
getWorktreeBaseFallbackNotice,
@@ -55,14 +56,14 @@ export default function WorktreeBaseFallbackDialog(): React.JSX.Element {
<DialogHeader>
<DialogTitle className="flex items-center gap-2 text-sm">
<TriangleAlert className="size-4 text-muted-foreground" aria-hidden="true" />
{translate(
{t(
'auto.components.WorktreeBaseFallbackDialog.title',
'Workspace created from a local base'
)}
</DialogTitle>
{displayedNotice ? (
<DialogDescription className="text-xs leading-relaxed">
{translate(
{t(
'auto.components.WorktreeBaseFallbackDialog.description',
'The remote-tracking ref "{{value0}}" was unavailable, so Orca used local "{{value1}}" instead. This workspace may not include the latest remote changes.',
{ value0: displayedNotice.requestedRef, value1: displayedNotice.localRef }
@@ -72,7 +73,7 @@ export default function WorktreeBaseFallbackDialog(): React.JSX.Element {
</DialogHeader>
<DialogFooter>
<Button type="button" size="sm" autoFocus onClick={dismissWorktreeBaseFallbackNotice}>
{translate('auto.components.WorktreeBaseFallbackDialog.dismiss', 'Got it')}
{t('auto.components.WorktreeBaseFallbackDialog.dismiss', 'Got it')}
</Button>
</DialogFooter>
</DialogContent>
+5 -4
View File
@@ -2,13 +2,14 @@ import { useEffect, useRef, useState } from 'react'
import { Search } from 'lucide-react'
import { ZOOM_LEVEL_CHANGED_EVENT } from '@/lib/zoom-events'
import type { ZoomLevelChangedEventDetail } from '@/lib/zoom-events'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
// Unmount after fading so the fixed overlay cannot interfere with Radix layering, outside clicks or focus.
const DISPLAY_MS = 1500
const FADE_MS = 300
export function ZoomOverlay(): React.JSX.Element | null {
const t = useTranslate()
const [visible, setVisible] = useState(false)
const [detail, setDetail] = useState<ZoomLevelChangedEventDetail | null>(null)
const hideTimerRef = useRef<number | undefined>(undefined)
@@ -46,10 +47,10 @@ export function ZoomOverlay(): React.JSX.Element | null {
const title =
detail.type === 'ui'
? translate('auto.components.ZoomOverlay.uiZoom', 'UI Zoom')
? t('auto.components.ZoomOverlay.uiZoom', 'UI Zoom')
: detail.type === 'editor'
? translate('auto.components.ZoomOverlay.editorZoom', 'Editor Zoom')
: translate('auto.components.ZoomOverlay.terminalZoom', 'Terminal Zoom')
? t('auto.components.ZoomOverlay.editorZoom', 'Editor Zoom')
: t('auto.components.ZoomOverlay.terminalZoom', 'Terminal Zoom')
return (
<div
@@ -11,6 +11,7 @@ import {
DialogTitle
} from '@/components/ui/dialog'
import { translate } from '@/i18n/i18n'
import { useTranslate, type Translate } from '@/i18n/use-translate'
import { useAppStore } from '@/store'
import type { BrowserExtensionInstallPromptRequest } from '../../../shared/browser/extensions/browser-extension-webstore'
import {
@@ -24,13 +25,14 @@ function InstallBody({
}: {
request: BrowserExtensionInstallPromptRequest
}): React.JSX.Element {
const access = describeBrowserExtensionAccess(request.permissions, request.hostPermissions)
const unsupported = describeUnsupportedBrowserExtensionFeatures(request.permissions)
const t = useTranslate()
const access = describeBrowserExtensionAccess(request.permissions, request.hostPermissions, t)
const unsupported = describeUnsupportedBrowserExtensionFeatures(request.permissions, t)
return (
<div className="space-y-2">
{access.length === 0 ? (
<p className="text-sm text-muted-foreground">
{translate(
{t(
'browserExtensions.install.noAccess',
'It does not ask to read or change data on websites.'
)}
@@ -38,7 +40,7 @@ function InstallBody({
) : (
<>
<p className="text-sm font-medium">
{translate('browserExtensions.install.canHeading', 'It can:')}
{t('browserExtensions.install.canHeading', 'It can:')}
</p>
<ul className="scrollbar-sleek max-h-48 list-disc space-y-1 overflow-y-auto pl-5 text-sm">
{access.map((message) => (
@@ -52,28 +54,32 @@ function InstallBody({
)
}
function promptDescription(request: BrowserExtensionInstallPromptRequest): string {
function promptDescription(
request: BrowserExtensionInstallPromptRequest,
t: Translate = translate
): string {
if (request.kind === 'permissions') {
return translate(
return t(
'browserExtensions.permissions.description',
'It is asking for access it did not have when you added it.'
)
}
if (request.kind === 'uninstall') {
// Why the Settings wording: removing from the store page removes it from every profile too.
return browserExtensionRemovalDescription('webstore')
return browserExtensionRemovalDescription('webstore', t)
}
return request.profileLabel
? translate(
? t(
'browserExtensions.install.profileDescription',
'It runs in tabs that use the {{profile}} profile.',
{ profile: request.profileLabel }
)
: translate('browserExtensions.install.description', 'It runs in Orca browser tabs.')
: t('browserExtensions.install.description', 'It runs in Orca browser tabs.')
}
/** Orca's confirmation for store installs and store-page removals; main waits on the answer. */
export function BrowserExtensionInstallDialog(): React.JSX.Element {
const t = useTranslate()
const [requests, setRequests] = useState<BrowserExtensionInstallPromptRequest[]>([])
const [respondingRequestId, setRespondingRequestId] = useState<string | null>(null)
const requestsRef = useRef(requests)
@@ -168,19 +174,15 @@ export function BrowserExtensionInstallDialog(): React.JSX.Element {
<div className="min-w-0 space-y-1">
<DialogTitle className="break-words">
{isPermissionRequest
? translate(
'browserExtensions.permissions.title',
'Allow {{name}} more access?',
{
name
}
)
? t('browserExtensions.permissions.title', 'Allow {{name}} more access?', {
name
})
: isInstall
? translate('browserExtensions.install.title', 'Add {{name}}?', { name })
: translate('browserExtensions.uninstall.title', 'Remove {{name}}?', { name })}
? t('browserExtensions.install.title', 'Add {{name}}?', { name })
: t('browserExtensions.uninstall.title', 'Remove {{name}}?', { name })}
</DialogTitle>
<DialogDescription>
{displayed ? promptDescription(displayed) : null}
{displayed ? promptDescription(displayed, t) : null}
</DialogDescription>
</div>
</div>
@@ -191,14 +193,14 @@ export function BrowserExtensionInstallDialog(): React.JSX.Element {
<DialogFooter>
<Button type="button" variant="ghost" disabled={busy} onClick={() => respond(false)}>
{isPermissionRequest
? translate('browserExtensions.permissions.deny', 'Deny')
: translate('browserExtensions.install.cancel', 'Cancel')}
? t('browserExtensions.permissions.deny', 'Deny')
: t('browserExtensions.install.cancel', 'Cancel')}
</Button>
{isInstall ? (
<Button ref={confirmRef} type="button" disabled={busy} onClick={() => respond(true)}>
{isPermissionRequest
? translate('browserExtensions.permissions.confirm', 'Allow')
: translate('browserExtensions.install.confirm', 'Add extension')}
? t('browserExtensions.permissions.confirm', 'Allow')
: t('browserExtensions.install.confirm', 'Add extension')}
</Button>
) : (
<Button
@@ -208,7 +210,7 @@ export function BrowserExtensionInstallDialog(): React.JSX.Element {
disabled={busy}
onClick={() => respond(true)}
>
{translate('browserExtensions.uninstall.confirm', 'Remove')}
{t('browserExtensions.uninstall.confirm', 'Remove')}
</Button>
)}
</DialogFooter>
@@ -14,92 +14,79 @@ import {
const MAX_NAMED_HOSTS = 3
function permissionMessage(warning: BrowserExtensionPermissionWarning): string {
function permissionMessage(
warning: BrowserExtensionPermissionWarning,
t: Translate = translate
): string {
switch (warning) {
case 'history':
return translate('browserExtensions.permission.history', 'Read your browsing history')
return t('browserExtensions.permission.history', 'Read your browsing history')
case 'historyWrite':
return translate(
'browserExtensions.permission.historyWrite',
'Read and change your browsing history'
)
return t('browserExtensions.permission.historyWrite', 'Read and change your browsing history')
case 'bookmarks':
return translate('browserExtensions.permission.bookmarks', 'Read and change your bookmarks')
return t('browserExtensions.permission.bookmarks', 'Read and change your bookmarks')
case 'clipboardRead':
return translate('browserExtensions.permission.clipboardRead', 'Read data you copy and paste')
return t('browserExtensions.permission.clipboardRead', 'Read data you copy and paste')
case 'clipboardWrite':
return translate(
'browserExtensions.permission.clipboardWrite',
'Modify data you copy and paste'
)
return t('browserExtensions.permission.clipboardWrite', 'Modify data you copy and paste')
case 'downloads':
return translate('browserExtensions.permission.downloads', 'Manage your downloads')
return t('browserExtensions.permission.downloads', 'Manage your downloads')
case 'nativeMessaging':
return translate(
return t(
'browserExtensions.permission.nativeMessaging',
'Communicate with cooperating native applications'
)
case 'notifications':
return translate('browserExtensions.permission.notifications', 'Display notifications')
return t('browserExtensions.permission.notifications', 'Display notifications')
case 'privacy':
return translate(
'browserExtensions.permission.privacy',
'Change your privacy-related settings'
)
return t('browserExtensions.permission.privacy', 'Change your privacy-related settings')
case 'management':
return translate('browserExtensions.permission.management', 'Manage your other extensions')
return t('browserExtensions.permission.management', 'Manage your other extensions')
case 'proxy':
return translate('browserExtensions.permission.proxy', 'Change your proxy settings')
return t('browserExtensions.permission.proxy', 'Change your proxy settings')
case 'contentSettings':
return translate(
return t(
'browserExtensions.permission.contentSettings',
'Change which sites can use cookies, JavaScript, your camera, microphone and location'
)
case 'geolocation':
return translate('browserExtensions.permission.geolocation', 'Detect your physical location')
return t('browserExtensions.permission.geolocation', 'Detect your physical location')
case 'topSites':
return translate(
return t(
'browserExtensions.permission.topSites',
'Read a list of your most frequently visited websites'
)
case 'blockContent':
return translate('browserExtensions.permission.blockContent', 'Block content on any page')
return t('browserExtensions.permission.blockContent', 'Block content on any page')
case 'debugger':
return translate('browserExtensions.permission.debugger', 'Access the page debugger backend')
return t('browserExtensions.permission.debugger', 'Access the page debugger backend')
case 'screenCapture':
return translate(
'browserExtensions.permission.screenCapture',
'Capture content of your screen'
)
return t('browserExtensions.permission.screenCapture', 'Capture content of your screen')
case 'email':
return translate('browserExtensions.permission.email', 'Know your email address')
return t('browserExtensions.permission.email', 'Know your email address')
}
}
function hostMessage(hostPermissions: string[]): string | null {
function hostMessage(hostPermissions: string[], t: Translate = translate): string | null {
const warning = browserExtensionHostWarning(hostPermissions)
if (!warning) {
return null
}
if (warning.kind === 'allSites') {
return translate(
return t(
'browserExtensions.permission.allSites',
'Read and change all your data on all websites'
)
}
const { hosts } = warning
if (hosts.length <= MAX_NAMED_HOSTS) {
return translate(
'browserExtensions.permission.someSites',
'Read and change your data on {{hosts}}',
{
hosts: hosts.join(', ')
}
)
return t('browserExtensions.permission.someSites', 'Read and change your data on {{hosts}}', {
hosts: hosts.join(', ')
})
}
const named = hosts.slice(0, MAX_NAMED_HOSTS).join(', ')
const count = hosts.length - MAX_NAMED_HOSTS
return translate(
return t(
'browserExtensions.permission.manyOtherSites',
'Read and change your data on {{hosts}} and {{count}} other sites',
{
@@ -113,14 +100,15 @@ function hostMessage(hostPermissions: string[]): string | null {
/** Why skip unsupported ones: "It can" must not promise what Orca does not do; they get their own line. */
export function describeBrowserExtensionAccess(
permissions: string[],
hostPermissions: string[]
hostPermissions: string[],
t?: Translate
): string[] {
const messages = [
hostMessage(hostPermissions),
hostMessage(hostPermissions, t),
...permissions
.filter((permission) => unsupportedBrowserExtensionFeatures([permission]).length === 0)
.map(browserExtensionPermissionWarning)
.map((warning) => (warning ? permissionMessage(warning) : null))
.map((warning) => (warning ? permissionMessage(warning, t) : null))
]
return [...new Set(messages.filter((message): message is string => message !== null))]
}
@@ -1,14 +1,18 @@
import { translate } from '@/i18n/i18n'
import type { Translate } from '@/i18n/use-translate'
import type { BrowserExtensionSource } from '../../../shared/browser/extensions/browser-extension-types'
/** One wording for every remove prompt (Settings, toolbar, store page): Orca removes it everywhere. */
export function browserExtensionRemovalDescription(source: BrowserExtensionSource): string {
export function browserExtensionRemovalDescription(
source: BrowserExtensionSource,
t: Translate = translate
): string {
return source === 'unpacked'
? translate(
? t(
'settings.browser.extensions.removeUnpackedDescription',
'It is removed from every Orca browser profile, with its saved data. The folder on disk stays where it is.'
)
: translate(
: t(
'settings.browser.extensions.removeDescription',
'It is removed from every Orca browser profile, with its saved data.'
)
@@ -11,6 +11,7 @@ import {
DialogTitle
} from '@/components/ui/dialog'
import { translate } from '@/i18n/i18n'
import { useTranslate, type Translate } from '@/i18n/use-translate'
import { useAppStore } from '@/store'
import type {
BrowserWebAuthnAccount,
@@ -19,17 +20,19 @@ import type {
function accountLabels(
account: BrowserWebAuthnAccount,
index: number
index: number,
t: Translate = translate
): { primary: string; secondary: string | null } {
const primary =
account.displayName?.trim() ||
account.name?.trim() ||
`${translate('auto.components.browser.webauthn.account.fallback', 'Passkey')} ${index + 1}`
`${t('auto.components.browser.webauthn.account.fallback', 'Passkey')} ${index + 1}`
const secondary = account.name?.trim()
return { primary, secondary: secondary && secondary !== primary ? secondary : null }
}
export function BrowserWebAuthnAccountDialog(): React.JSX.Element {
const t = useTranslate()
const [requests, setRequests] = useState<BrowserWebAuthnAccountRequest[]>([])
const [respondingRequestId, setRespondingRequestId] = useState<string | null>(null)
const requestsRef = useRef(requests)
@@ -120,10 +123,10 @@ export function BrowserWebAuthnAccountDialog(): React.JSX.Element {
>
<DialogHeader>
<DialogTitle>
{translate('auto.components.browser.webauthn.account.title', 'Choose a passkey')}
{t('auto.components.browser.webauthn.account.title', 'Choose a passkey')}
</DialogTitle>
<DialogDescription>
{translate(
{t(
'auto.components.browser.webauthn.account.description',
'Choose the account to use with this security key.'
)}
@@ -132,7 +135,7 @@ export function BrowserWebAuthnAccountDialog(): React.JSX.Element {
<div className="space-y-2">
{displayedRequest?.accounts.map((account, index) => {
const labels = accountLabels(account, index)
const labels = accountLabels(account, index, t)
return (
<Button
key={account.credentialId}
@@ -159,13 +162,13 @@ export function BrowserWebAuthnAccountDialog(): React.JSX.Element {
</div>
<p className="text-xs text-muted-foreground">
{translate('auto.components.browser.webauthn.account.site', 'Site')}{' '}
{t('auto.components.browser.webauthn.account.site', 'Site')}{' '}
<span className="font-mono text-foreground">{displayedRequest?.relyingPartyId}</span>
</p>
<DialogFooter>
<Button type="button" variant="ghost" onClick={() => respond(null)}>
{translate('auto.components.browser.webauthn.account.cancel', 'Cancel')}
{t('auto.components.browser.webauthn.account.cancel', 'Cancel')}
</Button>
</DialogFooter>
</DialogContent>
@@ -18,7 +18,7 @@ import {
type ConfirmationDialogOptions
} from '@/components/confirmation-dialog-context'
import { useAppStore } from '@/store'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { cn } from '@/lib/utils'
type ConfirmationDialogRequest = {
@@ -32,6 +32,7 @@ export function ConfirmationDialogProvider({
}: {
children: React.ReactNode
}): React.JSX.Element {
const t = useTranslate()
const nextIdRef = useRef(0)
const confirmButtonRef = useRef<HTMLButtonElement>(null)
const [queue, setQueue] = useState<ConfirmationDialogRequest[]>([])
@@ -216,7 +217,7 @@ export function ConfirmationDialogProvider({
className="text-sm font-normal text-foreground/80"
>
{displayedRequest.options.dontAskAgain.label ??
translate('auto.components.confirmation.dialog.92bac3217e', "Don't ask again")}
t('auto.components.confirmation.dialog.92bac3217e', "Don't ask again")}
</Label>
</div>
) : null}
@@ -240,7 +241,7 @@ export function ConfirmationDialogProvider({
}}
>
{displayedRequest?.options.cancelLabel ??
translate('auto.components.confirmation.dialog.56f5c60e0c', 'Cancel')}
t('auto.components.confirmation.dialog.56f5c60e0c', 'Cancel')}
</Button>
)}
<Button
@@ -256,7 +257,7 @@ export function ConfirmationDialogProvider({
}}
>
{displayedRequest?.options.confirmLabel ??
translate('auto.components.confirmation.dialog.8490e5d36a', 'Confirm')}
t('auto.components.confirmation.dialog.8490e5d36a', 'Confirm')}
</Button>
</DialogFooter>
</DialogContent>
@@ -271,7 +271,7 @@ function AgentCapabilitySetupControls(props: {
"Replace with Orca's copy"
)
: props.installAction?.kind === 'run' && props.installAction.changes
? bundledSkillSetupActionLabel(props.installAction.changes)
? bundledSkillSetupActionLabel(props.installAction.changes, t)
: t(
'auto.components.feature.wall.AgentCapabilitiesSetupAction.installSkills',
'Install skills'
@@ -300,6 +300,7 @@ function AgentCapabilitySetupChecklist(props: {
onChange: (value: OnboardingFeatureSetupSelection) => void
installStatus: Record<OnboardingFeatureSetupId, AgentCapabilityInstallStatus>
}): React.JSX.Element {
const t = useTranslate()
return (
<section className="mt-6">
<div className="grid gap-3 md:grid-cols-3">
@@ -312,7 +313,7 @@ function AgentCapabilitySetupChecklist(props: {
type="button"
role="checkbox"
aria-checked={selected}
aria-label={capabilityToggleLabel(selected, row.title)}
aria-label={capabilityToggleLabel(selected, row.title, t)}
className={cn(
'flex min-h-24 flex-col rounded-lg border px-4 py-3.5 text-left transition-colors',
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',
@@ -4,7 +4,8 @@ import { toast } from 'sonner'
import { Button } from '@/components/ui/button'
import CommentMarkdown from '@/components/sidebar/CommentMarkdown'
import { cn } from '@/lib/utils'
import { getIntlLocale, translate } from '@/i18n/i18n'
import { translate } from '@/i18n/i18n'
import { useIntlLocale, useTranslate } from '@/i18n/use-translate'
import type {
GitLabAssignableUser,
GitLabPipelineJob,
@@ -127,6 +128,8 @@ export function CommentCard({
resolving?: boolean
onResolve?: (threadId: string, resolved: boolean) => void
}): React.JSX.Element {
const t = useTranslate()
const intlLocale = useIntlLocale()
const hasThread = Boolean(comment.threadId)
return (
<div className="rounded-md border border-border/40 bg-muted/30 p-3">
@@ -145,7 +148,7 @@ export function CommentCard({
<span className="font-medium text-foreground">{comment.author}</span>
{comment.isResolved ? (
<span className="rounded-full bg-emerald-500/15 px-1.5 py-0.5 text-[10px] font-medium text-emerald-700 dark:text-emerald-300">
{translate('auto.components.GitLabItemDialog.f23ea85341', 'resolved')}
{t('auto.components.GitLabItemDialog.f23ea85341', 'resolved')}
</span>
) : null}
</div>
@@ -161,14 +164,12 @@ export function CommentCard({
>
{resolving ? <LoaderCircle className="size-3 animate-spin" /> : null}
{comment.isResolved
? translate('auto.components.GitLabItemDialog.65e784c1f1', 'Reopen')
: translate('auto.components.GitLabItemDialog.4168eb2c51', 'Resolve')}
? t('auto.components.GitLabItemDialog.65e784c1f1', 'Reopen')
: t('auto.components.GitLabItemDialog.4168eb2c51', 'Resolve')}
</Button>
) : null}
<span>
{comment.createdAt
? new Date(comment.createdAt).toLocaleDateString(getIntlLocale())
: ''}
{comment.createdAt ? new Date(comment.createdAt).toLocaleDateString(intlLocale) : ''}
</span>
</div>
</div>
@@ -202,6 +203,7 @@ export function PipelineJobRow({
onToggleTrace: (job: GitLabPipelineJob) => void
onRetry: (job: GitLabPipelineJob) => void
}): React.JSX.Element {
const t = useTranslate()
const canRetry = ['failed', 'canceled', 'cancelled'].includes(job.status)
return (
<div className="rounded-md">
@@ -240,7 +242,7 @@ export function PipelineJobRow({
className="h-6"
>
{retrying ? <LoaderCircle className="size-3 animate-spin" /> : null}
{translate('auto.components.GitLabItemDialog.fa3e042203', 'Retry')}
{t('auto.components.GitLabItemDialog.fa3e042203', 'Retry')}
</Button>
) : null}
{job.webUrl ? (
@@ -249,7 +251,7 @@ export function PipelineJobRow({
variant="ghost"
size="icon-xs"
onClick={(event) => openAppHttpLink(job.webUrl, { event })}
title={translate('auto.components.GitLabItemDialog.032ae1312b', 'Open job in GitLab')}
title={t('auto.components.GitLabItemDialog.032ae1312b', 'Open job in GitLab')}
>
<ExternalLink className="size-3" />
</Button>
@@ -259,15 +261,15 @@ export function PipelineJobRow({
{expanded ? (
<div className="mx-3 mb-2 rounded-md border border-border/50 bg-muted/20">
<div className="flex items-center justify-between border-b border-border/40 px-2.5 py-1.5 text-[11px] text-muted-foreground">
<span>{translate('auto.components.GitLabItemDialog.2f9b27f838', 'Job log')}</span>
<span>{t('auto.components.GitLabItemDialog.2f9b27f838', 'Job log')}</span>
<Button type="button" variant="ghost" size="xs" onClick={() => onToggleTrace(job)}>
{translate('auto.components.GitLabItemDialog.028bde664e', 'Hide')}
{t('auto.components.GitLabItemDialog.028bde664e', 'Hide')}
</Button>
</div>
{traceState?.loading ? (
<div className="flex items-center gap-2 px-2.5 py-3 text-xs text-muted-foreground">
<LoaderCircle className="size-3.5 animate-spin" />
{translate('auto.components.GitLabItemDialog.d600c2619a', 'Loading log')}
{t('auto.components.GitLabItemDialog.d600c2619a', 'Loading log')}
</div>
) : traceState?.error ? (
<div className="px-2.5 py-3 text-xs text-destructive">{traceState.error}</div>
@@ -275,7 +277,7 @@ export function PipelineJobRow({
<pre className="max-h-64 overflow-auto whitespace-pre-wrap break-words px-2.5 py-2 font-mono text-[11px] leading-4 text-foreground scrollbar-sleek">
{traceState?.trace?.trim()
? traceState.trace
: translate('auto.components.GitLabItemDialog.32f8bef818', 'No log output.')}
: t('auto.components.GitLabItemDialog.32f8bef818', 'No log output.')}
</pre>
)}
</div>
@@ -14,6 +14,7 @@ import { cn } from '@/lib/utils'
import { boundHostList } from './bounded-host-list'
import { HostListOverflowNote } from './HostListOverflowNote'
import { noHostsMatchLabel, searchHostsLabel } from './host-picker-copy'
import { useTranslate } from '@/i18n/use-translate'
export type HostComboboxOption = {
id: string
@@ -64,6 +65,7 @@ export function HostCombobox({
disabled?: boolean
notifyOnReselect?: boolean
}): React.JSX.Element {
const t = useTranslate()
const [open, setOpen] = useState(false)
const [query, setQuery] = useState('')
const selected = options.find((option) => option.id === value)
@@ -101,15 +103,15 @@ export function HostCombobox({
</Button>
</PopoverTrigger>
<PopoverContent align="start" className="w-[min(20rem,calc(100vw-1rem))]">
<Command shouldFilter={false} density="menu" label={searchHostsLabel()}>
<Command shouldFilter={false} density="menu" label={searchHostsLabel(t)}>
<CommandInput
value={query}
onValueChange={setQuery}
placeholder={searchHostsLabel()}
aria-label={searchHostsLabel()}
placeholder={searchHostsLabel(t)}
aria-label={searchHostsLabel(t)}
/>
<CommandList>
<CommandEmpty>{noHostsMatchLabel()}</CommandEmpty>
<CommandEmpty>{noHostsMatchLabel(t)}</CommandEmpty>
{groupOptions(shown).map((group) => (
<CommandGroup key={group.heading ?? ''} heading={group.heading}>
{group.options.map((option) => (
@@ -2,6 +2,7 @@ import { useRef } from 'react'
import { DropdownMenuItem } from '@/components/ui/dropdown-menu'
import { Input } from '@/components/ui/input'
import { searchHostsLabel } from './host-picker-copy'
import { useTranslate } from '@/i18n/use-translate'
const MENU_ITEM_SELECTOR = '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]'
@@ -28,14 +29,15 @@ function HostListSearchInput({
inputRef?: React.RefObject<HTMLInputElement | null>
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>
}): React.JSX.Element {
const t = useTranslate()
return (
<Input
ref={inputRef}
value={value}
onChange={(event) => onChange(event.target.value)}
onKeyDown={onKeyDown}
placeholder={searchHostsLabel()}
aria-label={searchHostsLabel()}
placeholder={searchHostsLabel(t)}
aria-label={searchHostsLabel(t)}
className="h-7"
/>
)
@@ -5,8 +5,8 @@ export function searchHostsLabel(t: Translate = translate): string {
return t('auto.components.hostPicker.searchHosts', 'Search hosts…')
}
export function noHostsMatchLabel(): string {
return translate('auto.components.hostPicker.noHostsMatch', 'No hosts match.')
export function noHostsMatchLabel(t: Translate = translate): string {
return t('auto.components.hostPicker.noHostsMatch', 'No hosts match.')
}
export function moreHostsLabel(count: number): string {
@@ -6,7 +6,7 @@ import {
onJiraImageCacheInvalidated
} from '@/runtime/jira/runtime-jira-image-cache'
import { jiraImageProtocolUrl } from '@/runtime/jira/runtime-jira-image-client'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { ExpandableMarkdownImage } from './sidebar/MarkdownImageLightbox'
type JiraAttachmentImageProps = {
@@ -27,6 +27,7 @@ function ResolvedJiraAttachmentImage({
alt,
compact
}: JiraAttachmentImageProps): React.JSX.Element {
const t = useTranslate()
const [resolved, setResolved] = useState<string | null>(null)
const [failed, setFailed] = useState(false)
const [generation, setGeneration] = useState(0)
@@ -78,11 +79,7 @@ function ResolvedJiraAttachmentImage({
}
}, [generation, localProtocol, reference, target])
if (!src || failed) {
return (
<span>
{alt || translate('auto.components.sidebar.MarkdownImageLightbox.image', 'Image')}
</span>
)
return <span>{alt || t('auto.components.sidebar.MarkdownImageLightbox.image', 'Image')}</span>
}
return (
<ExpandableMarkdownImage
@@ -1,5 +1,6 @@
import { Trans } from 'react-i18next'
import { i18n, translate } from '@/i18n/i18n'
import { i18n } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
export function JiraConnectCredentialGuide({
isServer,
@@ -10,15 +11,16 @@ export function JiraConnectCredentialGuide({
isServerBasic: boolean
supportsScopedTokens: boolean
}): React.JSX.Element {
const t = useTranslate()
if (isServer) {
return (
<p className="text-xs text-muted-foreground">
{isServerBasic
? translate(
? t(
'auto.components.jira.connect.dialog.d8737db691',
'Use your Jira Server or Data Center account username and password.'
)
: translate(
: t(
'auto.components.jira.connect.dialog.ccfb086d3e',
'Create a personal access token in your Jira profile under Personal Access Tokens.'
)}
@@ -30,7 +32,7 @@ export function JiraConnectCredentialGuide({
<p>
<Trans
i18n={i18n}
defaults={translate(
defaults={t(
'auto.components.jira.connect.dialog.createTokenInSettings',
'Create a token in <link>Atlassian account settings</link>.'
)}
@@ -51,11 +53,11 @@ export function JiraConnectCredentialGuide({
</p>
<p>
{supportsScopedTokens
? translate(
? t(
'jira.connect.scopedTokenGuide',
'Scoped tokens need read:jira-work, write:jira-work, and read:jira-user. Leave email empty to use Bearer authentication.'
)
: translate(
: t(
'jira.connect.oldHostGuide',
'This remote runtime requires an email and an unscoped API token. Update the remote runtime to use scoped tokens.'
)}
@@ -22,7 +22,7 @@ import {
isEnvironmentRuntimeContextKey
} from '@/lib/provider-runtime-context'
import { preventOutsideDismissWhenDirty } from '@/lib/outside-dismiss-guard'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { JiraConnectCredentialGuide } from './jira-connect-credential-guide'
type JiraConnectDialogProps = {
@@ -45,6 +45,7 @@ export function JiraConnectDialog({
overlayClassName,
contentClassName
}: JiraConnectDialogProps): React.JSX.Element {
const t = useTranslate()
const connectJira = useAppStore((s) => s.connectJira)
const settings = useAppStore((s) => s.settings)
const hostSupportsScopedTokens = useAppStore((s) => s.jiraStatus?.supportsScopedTokens === true)
@@ -93,7 +94,7 @@ export function JiraConnectDialog({
(!requiresIdentity || Boolean(email.trim())) &&
Boolean(apiToken.trim()) &&
connectState !== 'connecting'
const credentialStorageCopy = jiraCredentialStorageCopy(remoteRuntime)
const credentialStorageCopy = jiraCredentialStorageCopy(remoteRuntime, t)
const clearErrorOnEdit = (): void => {
if (connectState === 'error') {
@@ -163,7 +164,7 @@ export function JiraConnectDialog({
setConnectError(
error instanceof Error
? taskProviderErrorText(error.message)
: translate('taskProviders.jira.connectionFailed', 'Connection failed')
: t('taskProviders.jira.connectionFailed', 'Connection failed')
)
}
}
@@ -179,25 +180,25 @@ export function JiraConnectDialog({
>
<DialogHeader className="gap-3">
<DialogTitle className="leading-tight">
{translate('auto.components.jira.connect.dialog.8388bdea2b', 'Connect Jira site')}
{t('auto.components.jira.connect.dialog.8388bdea2b', 'Connect Jira site')}
</DialogTitle>
<DialogDescription>
{!isServer
? supportsScopedTokens
? translate(
? t(
'jira.connect.scopedDescription',
'Use a Jira Cloud site URL and API token to browse issues. Scoped tokens can omit the email.'
)
: translate(
: t(
'auto.components.jira.connect.dialog.d785c42b8b',
'Use a Jira Cloud site URL, Atlassian email, and API token to browse issues.'
)
: isServerBasic
? translate(
? t(
'auto.components.jira.connect.dialog.1d947a07ab',
'Use a self-hosted Jira base URL, username, and password to browse issues.'
)
: translate(
: t(
'auto.components.jira.connect.dialog.2e2b69e48e',
'Use a self-hosted Jira base URL and a personal access token to browse issues.'
)}
@@ -224,16 +225,13 @@ export function JiraConnectDialog({
setInstanceType(value as JiraInstanceType)
clearCredentialsOnModeSwitch()
}}
aria-label={translate(
'auto.components.jira.connect.dialog.b67e919bd5',
'Jira instance type'
)}
aria-label={t('auto.components.jira.connect.dialog.b67e919bd5', 'Jira instance type')}
>
<ToggleGroupItem value="cloud" className="h-8 px-3 text-xs">
{translate('auto.components.jira.connect.dialog.17787d6e4b', 'Atlassian Cloud')}
{t('auto.components.jira.connect.dialog.17787d6e4b', 'Atlassian Cloud')}
</ToggleGroupItem>
<ToggleGroupItem value="server" className="h-8 px-3 text-xs">
{translate('auto.components.jira.connect.dialog.bc7a831773', 'Self-hosted')}
{t('auto.components.jira.connect.dialog.bc7a831773', 'Self-hosted')}
</ToggleGroupItem>
</ToggleGroup>
{isServer ? (
@@ -249,44 +247,35 @@ export function JiraConnectDialog({
setServerAuthMethod(value as ServerAuthMethod)
clearCredentialsOnModeSwitch()
}}
aria-label={translate(
aria-label={t(
'auto.components.jira.connect.dialog.f49708c369',
'Jira authentication method'
)}
>
<ToggleGroupItem value="pat" className="h-8 px-3 text-xs">
{translate(
'auto.components.jira.connect.dialog.730d973bae',
'Personal access token'
)}
{t('auto.components.jira.connect.dialog.730d973bae', 'Personal access token')}
</ToggleGroupItem>
<ToggleGroupItem value="basic" className="h-8 px-3 text-xs">
{translate(
'auto.components.jira.connect.dialog.84a810dd0e',
'Username & password'
)}
{t('auto.components.jira.connect.dialog.84a810dd0e', 'Username & password')}
</ToggleGroupItem>
</ToggleGroup>
) : null}
<div className="space-y-2">
<Label htmlFor={siteUrlId} className="text-xs">
{isServer
? translate('auto.components.jira.connect.dialog.3489e186d6', 'Jira site URL')
: translate(
'auto.components.jira.connect.dialog.e176f9d0c5',
'Jira Cloud site URL'
)}
? t('auto.components.jira.connect.dialog.3489e186d6', 'Jira site URL')
: t('auto.components.jira.connect.dialog.e176f9d0c5', 'Jira Cloud site URL')}
</Label>
<Input
id={siteUrlId}
autoFocus
placeholder={
isServer
? translate(
? t(
'auto.components.jira.connect.dialog.cbc27fa599',
'https://jira.example.com'
)
: translate(
: t(
'auto.components.jira.connect.dialog.70fcd360c4',
'https://example.atlassian.net'
)
@@ -303,27 +292,21 @@ export function JiraConnectDialog({
<div className="space-y-2">
<Label htmlFor={emailId} className="text-xs">
{isServerBasic
? translate('auto.components.jira.connect.dialog.8d1223fa5c', 'Username')
? t('auto.components.jira.connect.dialog.8d1223fa5c', 'Username')
: supportsScopedTokens
? translate(
? t(
'jira.connect.optionalEmail',
'Atlassian email (optional for scoped tokens)'
)
: translate(
'auto.components.jira.connect.dialog.2849ddb295',
'Atlassian email'
)}
: t('auto.components.jira.connect.dialog.2849ddb295', 'Atlassian email')}
</Label>
<Input
id={emailId}
type={isServerBasic ? 'text' : 'email'}
placeholder={
isServerBasic
? translate('auto.components.jira.connect.dialog.be9eba0a1b', 'username')
: translate(
'auto.components.jira.connect.dialog.e91b9a4073',
'you@example.com'
)
? t('auto.components.jira.connect.dialog.be9eba0a1b', 'username')
: t('auto.components.jira.connect.dialog.e91b9a4073', 'you@example.com')
}
value={email}
onChange={(event) => {
@@ -337,32 +320,23 @@ export function JiraConnectDialog({
<div className="space-y-2">
<Label htmlFor={tokenId} className="text-xs">
{isServerBasic
? translate('auto.components.jira.connect.dialog.70035652d7', 'Password')
? t('auto.components.jira.connect.dialog.70035652d7', 'Password')
: isServer
? translate(
'auto.components.jira.connect.dialog.730d973bae',
'Personal access token'
)
: translate('auto.components.jira.connect.dialog.3d81bf3ab3', 'API token')}
? t('auto.components.jira.connect.dialog.730d973bae', 'Personal access token')
: t('auto.components.jira.connect.dialog.3d81bf3ab3', 'API token')}
</Label>
<Input
id={tokenId}
type="password"
placeholder={
isServerBasic
? translate(
'auto.components.jira.connect.dialog.c50abbf340',
'Jira account password'
)
? t('auto.components.jira.connect.dialog.c50abbf340', 'Jira account password')
: isServer
? translate(
? t(
'auto.components.jira.connect.dialog.8b9c7b9e7b',
'Jira personal access token'
)
: translate(
'auto.components.jira.connect.dialog.7b3967c12f',
'Atlassian API token'
)
: t('auto.components.jira.connect.dialog.7b3967c12f', 'Atlassian API token')
}
value={apiToken}
onChange={(event) => {
@@ -395,16 +369,16 @@ export function JiraConnectDialog({
onClick={() => onOpenChange(false)}
disabled={connectState === 'connecting'}
>
{translate('auto.components.jira.connect.dialog.79e7aaed39', 'Cancel')}
{t('auto.components.jira.connect.dialog.79e7aaed39', 'Cancel')}
</Button>
<Button type="submit" disabled={!canSubmit}>
{connectState === 'connecting' ? (
<>
<LoaderCircle className="size-4 animate-spin" />
{translate('auto.components.jira.connect.dialog.4a2ab52781', 'Verifying…')}
{t('auto.components.jira.connect.dialog.4a2ab52781', 'Verifying…')}
</>
) : (
translate('auto.components.jira.connect.dialog.63ce735809', 'Connect')
t('auto.components.jira.connect.dialog.63ce735809', 'Connect')
)}
</Button>
</DialogFooter>
@@ -1,12 +1,16 @@
import { translate } from '@/i18n/i18n'
import type { Translate } from '@/i18n/use-translate'
export function jiraCredentialStorageCopy(remoteRuntime: boolean): string {
export function jiraCredentialStorageCopy(
remoteRuntime: boolean,
t: Translate = translate
): string {
return remoteRuntime
? translate(
? t(
'taskProviders.jira.remoteTokenStorage',
'Your token is sent to the selected remote runtime and stored there with runtime-supported encryption.'
)
: translate(
: t(
'taskProviders.jira.localTokenStorage',
'Your token is stored locally and encrypted when local runtime storage supports it.'
)
@@ -6,7 +6,7 @@ import { useJiraSourceConnection } from '@/components/new-workspace/use-jira-sou
import { useAppStore } from '@/store'
import { compareBaseSensitivityLocaleText } from '../../../shared/locale-text-collators'
import { jiraListAssignableUsersForTarget } from '@/runtime/jira/runtime-jira-user-fields-client'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import {
getTaskSourceCacheScope,
type TaskSourceContext
@@ -33,6 +33,7 @@ export function JiraIssueAssigneeControl({
optimistic?: Partial<JiraIssue>
) => Promise<unknown>
}): React.JSX.Element {
const t = useTranslate()
const defaultStatus = useAppStore((state) => state.jiraStatus)
const defaultStatusKey = useAppStore((state) => state.jiraStatusContextKey)
const connection = useJiraSourceConnection({
@@ -81,16 +82,16 @@ export function JiraIssueAssigneeControl({
siteId={issue.siteId}
value={
issue.assignee?.accountId ??
translate('auto.components.JiraIssueWorkspace.0b6b5646ed', 'Unassigned')
t('auto.components.JiraIssueWorkspace.0b6b5646ed', 'Unassigned')
}
selectedUser={issue.assignee ?? null}
onSelect={assign}
disabled={disabled}
label={translate('components.jiraIssueAssigneeField.label', 'Assignee')}
label={t('components.jiraIssueAssigneeField.label', 'Assignee')}
fixedOptions={[
{
key: 'unassigned',
label: translate('auto.components.JiraIssueWorkspace.0b6b5646ed', 'Unassigned'),
label: t('auto.components.JiraIssueWorkspace.0b6b5646ed', 'Unassigned'),
onSelect: () => assign(null)
}
]}
@@ -99,7 +100,7 @@ export function JiraIssueAssigneeControl({
</div>
{self && issue.assignee?.accountId !== self.accountId ? (
<Button variant="ghost" size="xs" disabled={disabled} onClick={() => assign(self)}>
{translate('components.jiraIssueAssigneeField.assignToMe', 'Assign to me ({{name}})', {
{t('components.jiraIssueAssigneeField.assignToMe', 'Assign to me ({{name}})', {
name: self.displayName
})}
</Button>
@@ -3,7 +3,7 @@ import { useState } from 'react'
import { ChevronDown, CircleAlert, ExternalLink, Loader2 } from 'lucide-react'
import { Button } from '@/components/ui/button'
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { classifyTransitionRequirements } from '../../../shared/jira/jira-transition-fields'
import { JiraTransitionFieldsForm } from './jira-transition-fields-form'
import type {
@@ -36,6 +36,7 @@ export function JiraIssueTransitionControl({
onRetry,
onTransition
}: Props): React.JSX.Element {
const t = useTranslate()
const [open, setOpen] = useState(false)
const [selected, setSelected] = useState<JiraTransition | null>(null)
const [submitError, setSubmitError] = useState<string | null>(null)
@@ -61,10 +62,7 @@ export function JiraIssueTransitionControl({
setSubmitError(
error instanceof Error
? taskProviderErrorText(error.message)
: translate(
'auto.components.JiraIssueWorkspace.ea21952aa3',
'Failed to update Jira issue.'
)
: t('auto.components.JiraIssueWorkspace.ea21952aa3', 'Failed to update Jira issue.')
)
}
}
@@ -95,7 +93,7 @@ export function JiraIssueTransitionControl({
<Button
variant="secondary"
size="sm"
aria-label={translate('jira.transitions.changeStatus', 'Change status: {{status}}', {
aria-label={t('jira.transitions.changeStatus', 'Change status: {{status}}', {
status: issue.status.name
})}
aria-invalid={Boolean(error)}
@@ -116,15 +114,15 @@ export function JiraIssueTransitionControl({
{error ? (
<>
<p className="text-xs text-destructive" role="alert">
{translate('jira.transitions.loadError', 'Could not load status changes.')} {error}
{t('jira.transitions.loadError', 'Could not load status changes.')} {error}
</p>
<Button variant="secondary" size="sm" onClick={onRetry} disabled={loading}>
{translate('jira.transitions.retry', 'Retry')}
{t('jira.transitions.retry', 'Retry')}
</Button>
</>
) : loading ? (
<p className="text-xs text-muted-foreground" role="status">
{translate('jira.transitions.loading', 'Loading status changes…')}
{t('jira.transitions.loading', 'Loading status changes…')}
</p>
) : null}
{requirement?.kind === 'form' && selected ? (
@@ -137,12 +135,12 @@ export function JiraIssueTransitionControl({
) : error || loading ? null : requirement?.kind === 'unsupported' ? (
<>
<p className="text-sm font-medium">
{translate('jira.transitions.completeInJira', 'Complete “{{name}}” in Jira', {
{t('jira.transitions.completeInJira', 'Complete “{{name}}” in Jira', {
name: selected?.name
})}
</p>
<p className="text-xs text-muted-foreground">
{translate(
{t(
'jira.transitions.unsupported',
'Jira requires fields Orca cannot collect yet: {{fields}}.',
{ fields: requirement.fields.map((field) => field.name).join(', ') }
@@ -151,7 +149,7 @@ export function JiraIssueTransitionControl({
</>
) : selected && submitError ? null : transitions.length === 0 ? (
<p className="text-xs text-muted-foreground">
{translate('jira.transitions.empty', 'No status changes available.')}
{t('jira.transitions.empty', 'No status changes available.')}
</p>
) : (
<div className="flex flex-col gap-1">
@@ -177,7 +175,7 @@ export function JiraIssueTransitionControl({
{requirement?.kind === 'unsupported' || submitError ? (
<div className="flex justify-end gap-2">
<Button variant="ghost" size="sm" onClick={reset} disabled={busy}>
{translate('jira.transitions.back', 'Back')}
{t('jira.transitions.back', 'Back')}
</Button>
<Button
variant="secondary"
@@ -185,7 +183,7 @@ export function JiraIssueTransitionControl({
onClick={(event) => openAppHttpLink(issue.url, { event })}
>
<ExternalLink className="size-3" />
{translate('auto.components.JiraIssueWorkspace.69da9a208c', 'Open in Jira')}
{t('auto.components.JiraIssueWorkspace.69da9a208c', 'Open in Jira')}
</Button>
</div>
) : null}
@@ -2,6 +2,7 @@ import { useCallback, useMemo } from 'react'
import { Clipboard, ExternalLink, GitBranch } from 'lucide-react'
import { toast } from 'sonner'
import { translate } from '@/i18n/i18n'
import type { Translate } from '@/i18n/use-translate'
import type {
JiraIssue,
JiraIssueUpdate,
@@ -97,28 +98,28 @@ export async function copyJiraTextToClipboard(
}
}
export function getJiraIssueWorkspaceActions(issue: JiraIssue): JiraIssueWorkspaceAction[] {
export function getJiraIssueWorkspaceActions(
issue: JiraIssue,
t: Translate = translate
): JiraIssueWorkspaceAction[] {
return [
{
label: translate('auto.components.JiraIssueWorkspace.69da9a208c', 'Open in Jira'),
label: t('auto.components.JiraIssueWorkspace.69da9a208c', 'Open in Jira'),
icon: ExternalLink,
action: () => openAppHttpLink(issue.url)
},
{
label: translate('auto.components.JiraIssueWorkspace.779bb91ee0', 'Copy URL'),
label: t('auto.components.JiraIssueWorkspace.779bb91ee0', 'Copy URL'),
icon: Clipboard,
action: () => void copyJiraTextToClipboard(issue.url, 'url')
},
{
label: translate('auto.components.JiraIssueWorkspace.38839801e8', 'Copy key'),
label: t('auto.components.JiraIssueWorkspace.38839801e8', 'Copy key'),
icon: Clipboard,
action: () => void copyJiraTextToClipboard(issue.key, 'key')
},
{
label: translate(
'auto.components.JiraIssueWorkspace.80efa101c5',
'Copy suggested branch name'
),
label: t('auto.components.JiraIssueWorkspace.80efa101c5', 'Copy suggested branch name'),
icon: GitBranch,
action: () =>
void copyJiraTextToClipboard(
@@ -127,7 +128,7 @@ export function getJiraIssueWorkspaceActions(issue: JiraIssue): JiraIssueWorkspa
)
},
{
label: translate('auto.components.JiraIssueWorkspace.0cc62bd690', 'Copy prompt'),
label: t('auto.components.JiraIssueWorkspace.0cc62bd690', 'Copy prompt'),
icon: Clipboard,
action: () => void copyJiraTextToClipboard(buildJiraIssuePrompt(issue), 'prompt')
}
@@ -6,7 +6,7 @@ import { JiraIssueAssigneeControl } from '@/components/jira-issue-assignee-contr
import type { RuntimeClientTarget } from '../../../shared/runtime-client-target'
import type { TaskSourceContext } from '../../../shared/task-source-context'
import { JiraIssueTransitionControl } from './jira-issue-transition-control'
import { translate } from '@/i18n/i18n'
import { useIntlLocale, useTranslate } from '@/i18n/use-translate'
import { formatUiRelativeTimeFromDate } from '@/i18n/relative-time-format'
import type {
JiraIssue,
@@ -27,6 +27,8 @@ export function JiraIssueWorkspaceHeader({
onUse: (issue: JiraIssue) => void
onClose: () => void
}): React.JSX.Element {
const t = useTranslate()
const intlLocale = useIntlLocale()
return (
<div className="flex-none border-b border-border/50 bg-muted/30 px-4 py-3">
<div className="flex items-start gap-3">
@@ -35,7 +37,7 @@ export function JiraIssueWorkspaceHeader({
<span className="font-mono">{displayed.key}</span>
{displayed.siteName ? <span>{displayed.siteName}</span> : null}
<span>{displayed.project.key}</span>
<span>{formatUiRelativeTimeFromDate(displayed.updatedAt)}</span>
<span>{formatUiRelativeTimeFromDate(displayed.updatedAt, undefined, intlLocale)}</span>
{issueLoading ? <LoaderCircle className="size-3 animate-spin" /> : null}
</div>
<h2 className="mt-1 text-[20px] font-semibold leading-tight text-foreground">
@@ -47,7 +49,7 @@ export function JiraIssueWorkspaceHeader({
className="hidden shrink-0 gap-2 sm:inline-flex"
size="sm"
>
{translate('auto.components.JiraIssueWorkspace.2441be6f9f', 'Start workspace')}
{t('auto.components.JiraIssueWorkspace.2441be6f9f', 'Start workspace')}
<ArrowRight className="size-4" />
</Button>
<Tooltip>
@@ -57,7 +59,7 @@ export function JiraIssueWorkspaceHeader({
size="icon-sm"
className="shrink-0"
onClick={onClose}
aria-label={translate(
aria-label={t(
'auto.components.JiraIssueWorkspace.76513c7898',
'Close Jira issue preview'
)}
@@ -66,7 +68,7 @@ export function JiraIssueWorkspaceHeader({
</Button>
</TooltipTrigger>
<TooltipContent side="bottom" sideOffset={6}>
{translate('auto.components.JiraIssueWorkspace.7a96985ca0', 'Close')}
{t('auto.components.JiraIssueWorkspace.7a96985ca0', 'Close')}
</TooltipContent>
</Tooltip>
</div>
@@ -103,6 +105,7 @@ export function JiraIssueMetadataBar({
optimistic?: Partial<JiraIssue>
) => Promise<JiraMutationResult>
}): React.JSX.Element {
const t = useTranslate()
return (
<div className="flex flex-wrap items-center gap-x-3 gap-y-2 border-b border-border/60 px-4 py-2.5">
<JiraIssueTransitionControl
@@ -126,7 +129,7 @@ export function JiraIssueMetadataBar({
className="rounded-md px-1.5 py-0.5 text-[11px] text-muted-foreground transition hover:bg-muted/40 disabled:opacity-50"
>
{displayed.priority?.name ??
translate('auto.components.JiraIssueWorkspace.51bed73f88', 'No priority')}
t('auto.components.JiraIssueWorkspace.51bed73f88', 'No priority')}
{pendingField === 'priority' ? (
<LoaderCircle className="ml-1 inline size-3 animate-spin" />
) : null}
@@ -140,7 +143,7 @@ export function JiraIssueMetadataBar({
}
className="flex w-full items-center rounded-sm px-2 py-1.5 text-left text-[12px] hover:bg-accent"
>
{translate('auto.components.JiraIssueWorkspace.51bed73f88', 'No priority')}
{t('auto.components.JiraIssueWorkspace.51bed73f88', 'No priority')}
</button>
{priorities.map((priority) => (
<button
@@ -6,7 +6,7 @@ import { JiraIcon } from '@/components/icons/JiraIcon'
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { translate } from '@/i18n/i18n'
import { useIntlLocale, useTranslate } from '@/i18n/use-translate'
import { formatUiRelativeTimeFromDate } from '@/i18n/relative-time-format'
import type { JiraComment, JiraIssue } from '../../../shared/jira/jira-types'
@@ -49,13 +49,15 @@ export function JiraIssueWorkspaceContent({
onUse: (issue: JiraIssue) => void
actionItems: JiraIssueWorkspaceAction[]
}): React.JSX.Element {
const t = useTranslate()
const intlLocale = useIntlLocale()
return (
<div className="grid min-h-0 flex-1 grid-cols-1 xl:grid-cols-[minmax(0,1fr)_228px]">
<div className="min-h-0 overflow-y-auto scrollbar-sleek">
<section className="border-b border-border/40 px-4 py-4">
<div className="grid gap-2">
<label className="text-[11px] font-medium text-muted-foreground">
{translate('auto.components.JiraIssueWorkspace.444865b4a8', 'Title')}
{t('auto.components.JiraIssueWorkspace.444865b4a8', 'Title')}
</label>
<div className="flex gap-2">
<Input
@@ -83,16 +85,13 @@ export function JiraIssueWorkspaceContent({
</Button>
</div>
<label className="mt-2 text-[11px] font-medium text-muted-foreground">
{translate('auto.components.JiraIssueWorkspace.aee97b6913', 'Labels')}
{t('auto.components.JiraIssueWorkspace.aee97b6913', 'Labels')}
</label>
<div className="flex gap-2">
<Input
value={labelsDraft}
onChange={(event) => setLabelsDraft(event.target.value)}
placeholder={translate(
'auto.components.JiraIssueWorkspace.0f3c07a901',
'backend, bug'
)}
placeholder={t('auto.components.JiraIssueWorkspace.0f3c07a901', 'backend, bug')}
className="h-8 text-xs"
/>
<Button
@@ -118,7 +117,7 @@ export function JiraIssueWorkspaceContent({
<span className="text-xs text-muted-foreground">
{displayed.project.key} ·{' '}
{displayed.assignee?.displayName ??
translate('auto.components.JiraIssueWorkspace.0b6b5646ed', 'Unassigned')}
t('auto.components.JiraIssueWorkspace.0b6b5646ed', 'Unassigned')}
</span>
</div>
{displayed.description?.trim() ? (
@@ -129,10 +128,7 @@ export function JiraIssueWorkspaceContent({
/>
) : (
<p className="text-sm italic text-muted-foreground">
{translate(
'auto.components.JiraIssueWorkspace.c4889a47e4',
'No description provided.'
)}
{t('auto.components.JiraIssueWorkspace.c4889a47e4', 'No description provided.')}
</p>
)}
</section>
@@ -141,7 +137,7 @@ export function JiraIssueWorkspaceContent({
<div className="mb-3 flex items-center justify-between gap-3">
<div className="flex items-center gap-2">
<span className="text-[13px] font-medium text-foreground">
{translate('auto.components.JiraIssueWorkspace.9a980b06b9', 'Comments')}
{t('auto.components.JiraIssueWorkspace.9a980b06b9', 'Comments')}
</span>
{comments.length > 0 ? (
<span className="text-[12px] text-muted-foreground">{comments.length}</span>
@@ -160,7 +156,7 @@ export function JiraIssueWorkspaceContent({
) : (
<RefreshCw className="size-3" />
)}
{translate('auto.components.JiraIssueWorkspace.5cd09beaf9', 'Retry')}
{t('auto.components.JiraIssueWorkspace.5cd09beaf9', 'Retry')}
</Button>
) : null}
</div>
@@ -174,7 +170,7 @@ export function JiraIssueWorkspaceContent({
</div>
) : comments.length === 0 ? (
<p className="text-sm text-muted-foreground">
{translate('auto.components.JiraIssueWorkspace.9178090e26', 'No comments yet.')}
{t('auto.components.JiraIssueWorkspace.9178090e26', 'No comments yet.')}
</p>
) : (
<div className="flex flex-col gap-3">
@@ -190,10 +186,10 @@ export function JiraIssueWorkspaceContent({
) : null}
<span className="truncate text-[13px] font-semibold text-foreground">
{comment.user?.displayName ??
translate('auto.components.JiraIssueWorkspace.666cfdd835', 'Unknown')}
t('auto.components.JiraIssueWorkspace.666cfdd835', 'Unknown')}
</span>
<span className="shrink-0 text-[12px] text-muted-foreground">
{formatUiRelativeTimeFromDate(comment.createdAt)}
{formatUiRelativeTimeFromDate(comment.createdAt, undefined, intlLocale)}
</span>
</div>
<div className="px-3 py-2">
@@ -216,7 +212,7 @@ export function JiraIssueWorkspaceContent({
onClick={() => onUse(displayed)}
className="mb-3 w-full justify-center gap-2 sm:hidden"
>
{translate('auto.components.JiraIssueWorkspace.2441be6f9f', 'Start workspace')}
{t('auto.components.JiraIssueWorkspace.2441be6f9f', 'Start workspace')}
<ArrowRight className="size-4" />
</Button>
<div className="grid gap-1">
@@ -259,16 +255,14 @@ export function JiraIssueCommentComposer({
canSubmitComment: boolean
handleSubmitComment: () => void
}): React.JSX.Element {
const t = useTranslate()
return (
<div className="flex-none border-t border-border/50 bg-background px-3 py-3">
<div className="flex gap-2">
<textarea
value={commentDraft}
onChange={(event) => setCommentDraft(event.target.value)}
placeholder={translate(
'auto.components.JiraIssueWorkspace.a585fd204e',
'Add a Jira comment...'
)}
placeholder={t('auto.components.JiraIssueWorkspace.a585fd204e', 'Add a Jira comment...')}
rows={2}
disabled={commentSubmitting}
className="min-h-10 flex-1 resize-none rounded-md border border-input bg-transparent px-3 py-2 text-sm outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50"
@@ -283,7 +277,7 @@ export function JiraIssueCommentComposer({
) : (
<Send className="size-4" />
)}
{translate('auto.components.JiraIssueWorkspace.b0b92666c9', 'Comment')}
{t('auto.components.JiraIssueWorkspace.b0b92666c9', 'Comment')}
</Button>
</div>
</div>
@@ -8,7 +8,7 @@ import {
DropdownMenuTrigger
} from '@/components/ui/dropdown-menu'
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import {
JIRA_LIST_COLUMNS,
getJiraListColumnLabel,
@@ -22,7 +22,8 @@ export function JiraListColumnsMenu({
ids: ReadonlySet<JiraListColumnId>
onToggle: (column: JiraListColumnId) => void
}): React.JSX.Element {
const label = translate('auto.components.TaskPage.jiraColumnsPicker', 'Columns')
const t = useTranslate()
const label = t('auto.components.TaskPage.jiraColumnsPicker', 'Columns')
return (
<DropdownMenu>
<Tooltip>
@@ -44,7 +45,7 @@ export function JiraListColumnsMenu({
onSelect={(event) => event.preventDefault()}
onCheckedChange={() => onToggle(column.id)}
>
{getJiraListColumnLabel(column.id)}
{getJiraListColumnLabel(column.id, t)}
</DropdownMenuCheckboxItem>
))}
</DropdownMenuContent>
@@ -4,7 +4,7 @@ import {
type JiraProjectReference
} from '../../../shared/jira/jira-project-reference'
import { getJiraProjectSelectionKey } from './task-page/jira/task-page-jira-project-selection'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { WorkItemScopePicker, type WorkItemScopeOption } from './work-item-scope-picker'
export function JiraProjectPicker({
@@ -22,6 +22,7 @@ export function JiraProjectPicker({
emptyLabel: string
disabled?: boolean
}): React.JSX.Element {
const t = useTranslate()
const options: WorkItemScopeOption<JiraProjectReference>[] = projects.flatMap((project) => {
const reference = normalizeJiraProjectReference(project)
return reference
@@ -44,8 +45,8 @@ export function JiraProjectPicker({
onChange={onChange}
label={label}
allLabel={emptyLabel}
searchPlaceholder={translate('components.jiraProjectPicker.search', 'Search Jira projects')}
emptyLabel={translate('components.jiraProjectPicker.empty', 'No projects found.')}
searchPlaceholder={t('components.jiraProjectPicker.search', 'Search Jira projects')}
emptyLabel={t('components.jiraProjectPicker.empty', 'No projects found.')}
disabled={disabled}
/>
)
@@ -1,30 +1,31 @@
import type { JiraIssue } from '../../../shared/jira/jira-types'
import { translate } from '@/i18n/i18n'
import type { Translate } from '@/i18n/use-translate'
export function buildJiraIssuePrompt(issue: JiraIssue): string {
return `Complete Jira issue ${issue.key}: ${issue.title}\n\n${issue.url}${issue.description?.trim() ? `\n\n${issue.description.trim()}` : ''}`
}
export function getJiraPromptTemplates() {
export function getJiraPromptTemplates(t: Translate = translate) {
return [
{
id: 'implementation',
label: translate('jira.prompt.implementation', 'Start implementation'),
label: t('jira.prompt.implementation', 'Start implementation'),
text: 'Implement the following Jira issue. Inspect the existing code, make the changes, and verify them.\n\n$jira-issue\n\n$other-prompt'
},
{
id: 'bug',
label: translate('jira.prompt.bug', 'Investigate bug'),
label: t('jira.prompt.bug', 'Investigate bug'),
text: 'Investigate this Jira issue. Reproduce the problem, explain the cause, and propose a fix supported by evidence.\n\n$jira-issue\n\n$other-prompt'
},
{
id: 'test-plan',
label: translate('jira.prompt.testPlan', 'Write test plan'),
label: t('jira.prompt.testPlan', 'Write test plan'),
text: 'Write a test plan for this Jira issue, covering normal behavior, edge cases, and regressions.\n\n$jira-issue\n\n$other-prompt'
},
{
id: 'pr-summary',
label: translate('jira.prompt.prSummary', 'Draft PR summary'),
label: t('jira.prompt.prSummary', 'Draft PR summary'),
text: 'Draft a pull request summary for this Jira issue. Describe the problem, changes, validation, and remaining risks. Do not claim unverified work is complete.\n\n$jira-issue\n\n$other-prompt'
}
]
@@ -9,7 +9,7 @@ import {
SelectValue
} from '@/components/ui/select'
import { Textarea } from '@/components/ui/textarea'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { getCommentBodySubmitState } from '@/lib/comment-body-submit-state'
import {
buildResolutionFieldValue,
@@ -32,6 +32,7 @@ export function JiraTransitionFieldsForm({
onBack,
onSubmit
}: Props): React.JSX.Element | null {
const t = useTranslate()
const [resolution, setResolution] = useState('')
const [comment, setComment] = useState('')
const requirement = classifyTransitionRequirements(transition)
@@ -70,7 +71,7 @@ export function JiraTransitionFieldsForm({
<Select value={resolution} onValueChange={setResolution} disabled={pending}>
<SelectTrigger id="jira-transition-resolution" className="w-full" autoFocus>
<SelectValue
placeholder={translate('jira.transitions.chooseResolution', 'Choose a resolution')}
placeholder={t('jira.transitions.chooseResolution', 'Choose a resolution')}
/>
</SelectTrigger>
<SelectContent>
@@ -91,7 +92,7 @@ export function JiraTransitionFieldsForm({
{requirement.commentRequired ? (
<div className="space-y-2">
<Label htmlFor="jira-transition-comment">
{translate('jira.transitions.comment', 'Comment')}
{t('jira.transitions.comment', 'Comment')}
</Label>
<Textarea
id="jira-transition-comment"
@@ -106,10 +107,10 @@ export function JiraTransitionFieldsForm({
) : null}
<div className="flex justify-end gap-2">
<Button type="button" variant="ghost" size="sm" onClick={onBack} disabled={pending}>
{translate('jira.transitions.back', 'Back')}
{t('jira.transitions.back', 'Back')}
</Button>
<Button type="submit" size="sm" disabled={pending || !canSubmit}>
{translate('jira.transitions.apply', 'Change status')}
{t('jira.transitions.apply', 'Change status')}
</Button>
</div>
</form>
@@ -5,7 +5,7 @@ import { Input } from '@/components/ui/input'
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'
import { jiraSearchUsers } from '@/runtime/jira/runtime-jira-user-fields-client'
import type { RowLessSource as RuntimeJiraSettings } from '@/lib/default-creation-host'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { useUiLanguageRevision } from '@/i18n/use-ui-language-revision'
import type { JiraUser } from '../../../shared/jira/jira-types'
@@ -69,6 +69,7 @@ export function JiraUserPicker({
searchUsers?: (query: string) => Promise<JiraUser[]>
allowKnownUserId?: boolean
}): React.JSX.Element {
const t = useTranslate()
const languageRevision = useUiLanguageRevision()
const [open, setOpen] = useState(false)
const [query, setQuery] = useState('')
@@ -112,12 +113,12 @@ export function JiraUserPicker({
}
return (
value ||
translate('components.jiraUserPicker.select', 'Select {{value0}}', {
t('components.jiraUserPicker.select', 'Select {{value0}}', {
value0: label
})
)
// oxlint-disable-next-line react-hooks/exhaustive-deps -- translate() reads the UI language implicitly.
}, [label, selectedUser, value, languageRevision])
}, [label, selectedUser, value, languageRevision, t])
return (
<Popover open={open} onOpenChange={setOpen}>
@@ -138,7 +139,7 @@ export function JiraUserPicker({
<Input
value={query}
onChange={(event) => setQuery(event.target.value)}
placeholder={translate('components.jiraUserPicker.search', 'Search users')}
placeholder={t('components.jiraUserPicker.search', 'Search users')}
className="mb-1 h-7 text-[12px]"
autoFocus
/>
@@ -157,7 +158,7 @@ export function JiraUserPicker({
))}
{users.length === 0 && !loading ? (
<p className="px-2 py-1.5 text-[12px] text-muted-foreground">
{translate('components.jiraUserPicker.empty', 'No users found')}
{t('components.jiraUserPicker.empty', 'No users found')}
</p>
) : (
<JiraUserOptionList
@@ -177,7 +178,7 @@ export function JiraUserPicker({
}}
className="flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs hover:bg-accent"
>
{translate('components.jiraUserPicker.useKnownId', 'Use known user ID "{{value0}}"', {
{t('components.jiraUserPicker.useKnownId', 'Use known user ID "{{value0}}"', {
value0: knownUserId
})}
</button>
@@ -1,4 +1,5 @@
import { translate } from '@/i18n/i18n'
import type { Translate } from '@/i18n/use-translate'
import { projectHostSetupProjectionFromRepos } from '../../../shared/project-host-setup-projection'
import type { Repo } from '../../../shared/repo-types'
@@ -28,19 +29,20 @@ export function hasGitHubBackedProject(repos: readonly Repo[]): boolean {
export function getLandingPreflightIssues(
status: LandingPreflightStatus,
options: LandingPreflightIssueOptions
options: LandingPreflightIssueOptions,
t: Translate = translate
): PreflightIssue[] {
const issues: PreflightIssue[] = []
if (!status.git.installed) {
issues.push({
id: 'git',
title: translate('auto.components.Landing.e5b7296d9d', 'Git is not installed'),
description: translate(
title: t('auto.components.Landing.e5b7296d9d', 'Git is not installed'),
description: t(
'auto.components.Landing.b673e7cf1b',
'Git is required for Git projects, source control, and workspace management.'
),
fixLabel: translate('auto.components.Landing.installGit', 'Install Git'),
fixLabel: t('auto.components.Landing.installGit', 'Install Git'),
fixUrl: 'https://git-scm.com/downloads'
})
}
@@ -53,24 +55,24 @@ export function getLandingPreflightIssues(
if (!status.gh.installed) {
issues.push({
id: 'gh',
title: translate('auto.components.Landing.5beaef5f9e', 'GitHub CLI is not installed'),
description: translate(
title: t('auto.components.Landing.5beaef5f9e', 'GitHub CLI is not installed'),
description: t(
'auto.components.Landing.73e1ad4282',
'Orca uses the GitHub CLI (gh) to show pull requests, issues, and checks.'
),
fixLabel: translate('auto.components.Landing.installGitHubCli', 'Install GitHub CLI'),
fixLabel: t('auto.components.Landing.installGitHubCli', 'Install GitHub CLI'),
fixUrl: 'https://cli.github.com',
dismissible: true
})
} else if (!status.gh.authenticated) {
issues.push({
id: 'gh-auth',
title: translate('auto.components.Landing.9f96d018b7', 'GitHub CLI is not authenticated'),
description: translate(
title: t('auto.components.Landing.9f96d018b7', 'GitHub CLI is not authenticated'),
description: t(
'auto.components.Landing.00cee697c1',
'Run "gh auth login" in a terminal to connect your GitHub account.'
),
fixLabel: translate('auto.components.Landing.learnMore', 'Learn more'),
fixLabel: t('auto.components.Landing.learnMore', 'Learn more'),
fixUrl: 'https://cli.github.com/manual/gh_auth_login',
dismissible: true
})
@@ -26,7 +26,7 @@ import {
createLinearApiKeyDialogState,
resolveLinearApiKeyDialogState
} from './linear-api-key-dialog-state'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
type LinearApiKeyDialogProps = {
open: boolean
@@ -51,6 +51,7 @@ export function LinearApiKeyDialog({
overlayClassName,
contentClassName
}: LinearApiKeyDialogProps): React.JSX.Element {
const t = useTranslate()
const settings = useAppStore((s) => s.settings)
const connectLinear = useAppStore((s) => s.connectLinear)
const mountedRef = useMountedRef()
@@ -65,8 +66,8 @@ export function LinearApiKeyDialog({
const submitLabel =
connectLabel ??
(workspace
? translate('taskProviders.linear.updateAccess', 'Update access')
: translate('taskProviders.linear.connect', 'Connect'))
? t('taskProviders.linear.updateAccess', 'Update access')
: t('taskProviders.linear.connect', 'Connect'))
const resolvedDialogState = resolveLinearApiKeyDialogState(dialogState, open)
if (resolvedDialogState !== dialogState) {
// Reset hidden drafts/errors before paint because parent closure can race a connect request.
@@ -114,7 +115,7 @@ export function LinearApiKeyDialog({
connectError:
error instanceof Error
? taskProviderErrorText(error.message)
: translate('taskProviders.linear.connectionFailed', 'Connection failed')
: t('taskProviders.linear.connectionFailed', 'Connection failed')
}))
}
}
@@ -123,31 +124,29 @@ export function LinearApiKeyDialog({
const resolvedTitle =
title ??
(workspace
? translate(
'taskProviders.linear.updateWorkspaceAccess',
'Update Linear access for {{workspace}}',
{ workspace: workspace.organizationName }
)
: translate('taskProviders.linear.addAccess', 'Add Linear access'))
? t('taskProviders.linear.updateWorkspaceAccess', 'Update Linear access for {{workspace}}', {
workspace: workspace.organizationName
})
: t('taskProviders.linear.addAccess', 'Add Linear access'))
const resolvedDescription =
description ??
(workspace
? translate(
? t(
'taskProviders.linear.workspaceApiKeyHint',
'Paste a Personal API key for {{workspace}}. If this workspace is already connected, Orca replaces its stored key.',
{ workspace: workspace.organizationName }
)
: translate(
: t(
'taskProviders.linear.apiKeyHint',
'Paste a Personal API key for the Linear workspace you want Orca to use. If that workspace is already connected, Orca replaces its stored key.'
))
const storageCopy =
runtimeTarget.kind === 'environment'
? translate(
? t(
'taskProviders.linear.remoteKeyStorage',
'This key is stored by the active remote runtime.'
)
: translate(
: t(
'taskProviders.linear.localKeyStorage',
'Local runtime keys are stored on this device using Electron encrypted storage when available.'
)
@@ -173,16 +172,13 @@ export function LinearApiKeyDialog({
<div className="space-y-3">
<div className="space-y-2">
<Label htmlFor={apiKeyInputId} className="text-xs">
{translate('auto.components.linear.api.key.dialog.7d498f653c', 'Personal API key')}
{t('auto.components.linear.api.key.dialog.7d498f653c', 'Personal API key')}
</Label>
<Input
id={apiKeyInputId}
autoFocus
type="password"
placeholder={translate(
'auto.components.linear.api.key.dialog.edec49dfae',
'lin_api_...'
)}
placeholder={t('auto.components.linear.api.key.dialog.edec49dfae', 'lin_api_...')}
value={apiKeyDraft}
onChange={(event) => {
const nextDraft = event.target.value
@@ -204,25 +200,25 @@ export function LinearApiKeyDialog({
) : null}
<div className="space-y-2 text-xs leading-relaxed text-muted-foreground">
<p>
{translate(
{t(
'auto.components.linear.api.key.dialog.af52a6227f',
'Create a Personal API key from Account > Security & Access.'
)}{' '}
{!workspace
? translate(
? t(
'auto.components.linear.api.key.dialog.c9889a09f8',
'Use Linear to choose the intended workspace before creating the key.'
)
: null}
</p>
<p>
{translate(
{t(
'auto.components.linear.api.key.dialog.d56d3629f4',
'Prefer full access when Orca should show every team the account can access in that workspace. Restricted keys only expose permitted teams, and private teams require the key owner to have access.'
)}
</p>
<p>
{translate(
{t(
'auto.components.linear.api.key.dialog.e3100b36b9',
'If member API keys are blocked, ask a workspace admin to allow them from workspace API settings.'
)}
@@ -234,7 +230,7 @@ export function LinearApiKeyDialog({
onClick={() => window.api.shell.openUrl(personalKeyUrl)}
>
<ExternalLink className="size-3" />
{translate('auto.components.linear.api.key.dialog.dc7ccb0f7c', 'Personal API keys')}
{t('auto.components.linear.api.key.dialog.dc7ccb0f7c', 'Personal API keys')}
</button>
<span className="text-muted-foreground/60">|</span>
<button
@@ -243,10 +239,7 @@ export function LinearApiKeyDialog({
onClick={() => window.api.shell.openUrl(workspaceApiUrl)}
>
<ExternalLink className="size-3" />
{translate(
'auto.components.linear.api.key.dialog.e603ee9156',
'Workspace API settings'
)}
{t('auto.components.linear.api.key.dialog.e603ee9156', 'Workspace API settings')}
</button>
</div>
</div>
@@ -261,7 +254,7 @@ export function LinearApiKeyDialog({
onClick={() => onOpenChange(false)}
disabled={connectState === 'connecting'}
>
{translate('auto.components.linear.api.key.dialog.f8f704a019', 'Cancel')}
{t('auto.components.linear.api.key.dialog.f8f704a019', 'Cancel')}
</Button>
<Button
onClick={() => void handleConnect()}
@@ -270,7 +263,7 @@ export function LinearApiKeyDialog({
{connectState === 'connecting' ? (
<>
<LoaderCircle className="size-4 animate-spin" />
{translate('auto.components.linear.api.key.dialog.834a52c084', 'Verifying...')}
{t('auto.components.linear.api.key.dialog.834a52c084', 'Verifying...')}
</>
) : (
submitLabel
@@ -4,7 +4,7 @@ import { ExternalLink, Layers3 } from 'lucide-react'
import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button'
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { translate } from '@/i18n/i18n'
import { useIntlLocale, useTranslate } from '@/i18n/use-translate'
import { cn } from '@/lib/utils'
import type { LinearCustomViewSummary } from '../../../shared/linear/project-types'
import {
@@ -44,23 +44,21 @@ function LinearCustomViewTableSkeleton(): React.JSX.Element {
}
function LinearCustomViewTableEmpty({ hasError }: { hasError?: boolean }): React.JSX.Element {
const t = useTranslate()
return (
<div className="px-4 py-10 text-center">
<p className="text-sm font-medium text-foreground">
{hasError
? translate(
'auto.components.linear.project.view.surfaces.c0a50f96a4',
'Unable to load views'
)
: translate('auto.components.linear.project.view.surfaces.ef90b21366', 'No views found')}
? t('auto.components.linear.project.view.surfaces.c0a50f96a4', 'Unable to load views')
: t('auto.components.linear.project.view.surfaces.ef90b21366', 'No views found')}
</p>
<p className="mt-2 text-sm text-muted-foreground">
{hasError
? translate(
? t(
'auto.components.linear.project.view.surfaces.f4c79cff5f',
'Review the workspace error below, then refresh.'
)
: translate(
: t(
'auto.components.linear.project.view.surfaces.9f0f51fd9e',
'Create or save views in Linear, then refresh.'
)}
@@ -78,6 +76,8 @@ export function LinearCustomViewTableContent({
onSelectView,
onOpenView
}: LinearCustomViewTableContentProps): React.JSX.Element {
const t = useTranslate()
const intlLocale = useIntlLocale()
if (loading && views.length === 0) {
return <LinearCustomViewTableSkeleton />
}
@@ -131,17 +131,17 @@ export function LinearCustomViewTableContent({
</Badge>
<span className="truncate text-[12px] text-muted-foreground">
{view.shared
? translate('auto.components.linear.project.view.surfaces.27d91cb1a6', 'Shared')
: translate('auto.components.linear.project.view.surfaces.f059181bd9', 'Private')}
? t('auto.components.linear.project.view.surfaces.27d91cb1a6', 'Shared')
: t('auto.components.linear.project.view.surfaces.f059181bd9', 'Private')}
</span>
<span className="truncate text-[12px] text-muted-foreground">
{linearProjectUnknownText(view.owner ?? view.creator) ??
translate('auto.components.linear.project.view.surfaces.20b9d09b7d', 'Unknown')}
t('auto.components.linear.project.view.surfaces.20b9d09b7d', 'Unknown')}
</span>
<span className="truncate text-[12px] text-muted-foreground">
{view.updatedAt
? linearProjectDateLabel(view.updatedAt)
: translate('auto.components.linear.project.view.surfaces.20b9d09b7d', 'Unknown')}
? linearProjectDateLabel(view.updatedAt, t, intlLocale)
: t('auto.components.linear.project.view.surfaces.20b9d09b7d', 'Unknown')}
</span>
<div className="flex justify-end md:opacity-0 md:transition-opacity md:group-hover/row:opacity-100 md:group-focus-within/row:opacity-100">
<Tooltip>
@@ -153,7 +153,7 @@ export function LinearCustomViewTableContent({
event.stopPropagation()
onOpenView(view)
}}
aria-label={translate(
aria-label={t(
'auto.components.linear.project.view.surfaces.openInLinear',
'Open {{value0}} in Linear',
{ value0: view.name }
@@ -163,10 +163,7 @@ export function LinearCustomViewTableContent({
</Button>
</TooltipTrigger>
<TooltipContent side="bottom" sideOffset={6}>
{translate(
'auto.components.linear.project.view.surfaces.aac9a4afc6',
'Open in Linear'
)}
{t('auto.components.linear.project.view.surfaces.aac9a4afc6', 'Open in Linear')}
</TooltipContent>
</Tooltip>
</div>
@@ -4,7 +4,7 @@ import { LoaderCircle, RefreshCw } from 'lucide-react'
import { LinearIssueCommentFooter, type LinearLocalComment } from '@/components/LinearItemDrawer'
import CommentMarkdown from '@/components/sidebar/CommentMarkdown'
import { Button } from '@/components/ui/button'
import { translate } from '@/i18n/i18n'
import { useIntlLocale, useTranslate } from '@/i18n/use-translate'
import { formatLinearIssueRelativeTime } from '@/components/linear-issue-workspace-text'
import type { LinearComment, LinearIssue } from '../../../shared/linear/issue-types'
import type { TaskSourceContext } from '../../../shared/task-source-context'
@@ -49,11 +49,13 @@ export function LinearIssueActivity({
onCommentAdded: (comment: LinearLocalComment) => void
sourceContext?: TaskSourceContext | null
}): React.JSX.Element {
const t = useTranslate()
const intlLocale = useIntlLocale()
return (
<section className="mt-12 border-t border-border/60 pt-9">
<div className="mb-8 flex items-center justify-between gap-3">
<h2 className="text-xl font-semibold text-foreground">
{translate('auto.components.LinearIssueWorkspace.543970c87a', 'Activity')}
{t('auto.components.LinearIssueWorkspace.543970c87a', 'Activity')}
</h2>
<div className="flex items-center gap-3 text-sm text-muted-foreground">
<LinearIssueAvatar
@@ -72,18 +74,18 @@ export function LinearIssueActivity({
/>
<span>
{issue.assignee?.displayName
? translate(
? t(
'auto.components.LinearIssueWorkspace.namedUserUpdatedIssue',
'{{name}} updated the issue · {{time}}',
{
name: issue.assignee.displayName,
time: formatLinearIssueRelativeTime(issue.updatedAt)
time: formatLinearIssueRelativeTime(issue.updatedAt, intlLocale)
}
)
: translate(
: t(
'auto.components.LinearIssueWorkspace.someoneUpdatedIssue',
'Someone updated the issue · {{time}}',
{ time: formatLinearIssueRelativeTime(issue.updatedAt) }
{ time: formatLinearIssueRelativeTime(issue.updatedAt, intlLocale) }
)}
</span>
</div>
@@ -103,7 +105,7 @@ export function LinearIssueActivity({
) : (
<RefreshCw className="size-3" />
)}
{translate('auto.components.LinearIssueWorkspace.b0eac92d85', 'Retry')}
{t('auto.components.LinearIssueWorkspace.b0eac92d85', 'Retry')}
</Button>
</div>
) : null}
@@ -125,10 +127,10 @@ export function LinearIssueActivity({
<div className="mb-1 flex min-w-0 items-center gap-2 text-sm">
<span className="truncate font-semibold text-foreground">
{comment.user?.displayName ??
translate('auto.components.LinearIssueWorkspace.ca8778c124', 'Unknown')}
t('auto.components.LinearIssueWorkspace.ca8778c124', 'Unknown')}
</span>
<span className="shrink-0 text-muted-foreground">
{formatLinearIssueRelativeTime(comment.createdAt)}
{formatLinearIssueRelativeTime(comment.createdAt, intlLocale)}
</span>
</div>
<div className="rounded-lg border border-border/60 bg-card px-4 py-3">
@@ -1,19 +1,25 @@
// A capped row remains checked when any id survives; report the actual per-team coverage.
import React from 'react'
import { translate } from '@/i18n/i18n'
import { useTranslate, type Translate } from '@/i18n/use-translate'
import { linearMetadataGroupCoverage } from './linear-issue-attribute-filter-team-ids'
type LinearCoverageFacet = 'status' | 'labels'
function shortfallMessage(facet: LinearCoverageFacet, applied: number, intended: number): string {
function shortfallMessage(
facet: LinearCoverageFacet,
applied: number,
intended: number,
t: Translate = translate
): string {
const counts = { value0: applied, value1: intended }
return facet === 'status'
? translate(
? t(
'auto.components.linear-issue-attribute-filter-coverage-notice.statusPartialTeamCoverage',
'Filtering {{value0}} of {{value1}} team statuses — issues from the remaining teams are not included.',
counts
)
: translate(
: t(
'auto.components.linear-issue-attribute-filter-coverage-notice.labelsPartialTeamCoverage',
'Filtering {{value0}} of {{value1}} team labels — issues from the remaining teams are not included.',
counts
@@ -21,14 +27,14 @@ function shortfallMessage(facet: LinearCoverageFacet, applied: number, intended:
}
/** Why: a row the cap could not fit leaves no trace, so the spent budget is what we can state. */
function idLimitMessage(facet: LinearCoverageFacet, max: number): string {
function idLimitMessage(facet: LinearCoverageFacet, max: number, t: Translate = translate): string {
return facet === 'status'
? translate(
? t(
'auto.components.linear-issue-attribute-filter-coverage-notice.statusAtIdLimit',
'Filtering the most this can carry: {{value0}} team statuses. Rows picked past that are left out.',
{ value0: max }
)
: translate(
: t(
'auto.components.linear-issue-attribute-filter-coverage-notice.labelsAtIdLimit',
'Filtering the most this can carry: {{value0}} team labels. Rows picked past that are left out.',
{ value0: max }
@@ -49,13 +55,16 @@ export function LinearFacetCoverageNotice({
/** Recorded where the cap ran, not inferred from the ids it left behind (STA-5996). */
truncated: boolean
}): React.JSX.Element | null {
const t = useTranslate()
const { applied, intended } = linearMetadataGroupCoverage(options, selectedIds)
if (intended <= applied && !truncated) {
return null
}
return (
<p className="border-t border-border/50 px-3 py-2 text-xs text-muted-foreground">
{intended > applied ? shortfallMessage(facet, applied, intended) : idLimitMessage(facet, max)}
{intended > applied
? shortfallMessage(facet, applied, intended, t)
: idLimitMessage(facet, max, t)}
</p>
)
}
@@ -5,7 +5,7 @@ import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { useTeamsLabels, useTeamsMembers, useTeamsStates } from '@/hooks/useIssueMetadata'
import type { RowLessSource as RuntimeLinearSettings } from '@/lib/default-creation-host'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import {
LINEAR_ISSUE_ATTRIBUTE_FILTER_MAX_LABEL_IDS,
LINEAR_ISSUE_ATTRIBUTE_FILTER_MAX_STATE_IDS,
@@ -59,6 +59,7 @@ function ActivePill({
partial: boolean
onClear: () => void
}): React.JSX.Element {
const t = useTranslate()
return (
<span className="inline-flex h-6 items-center gap-1 rounded-full border border-border/60 bg-muted/50 pl-2 pr-1 text-[11px] text-foreground">
<span className="text-muted-foreground">{label}:</span>
@@ -71,14 +72,14 @@ function ActivePill({
type="button"
className="rounded-sm text-muted-foreground underline decoration-dotted underline-offset-2 outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50"
>
{translate(
{t(
'auto.components.linear-issue-attribute-filter-dropdowns.partialCoverage',
'partial'
)}
</button>
</TooltipTrigger>
<TooltipContent side="top" sideOffset={4}>
{translate(
{t(
'auto.components.linear-issue-attribute-filter-dropdowns.partialCoverageTitle',
'Some teams may be left out of this filter. Open Filters for details.'
)}
@@ -87,7 +88,7 @@ function ActivePill({
) : null}
<button
type="button"
aria-label={translate(
aria-label={t(
'auto.components.linear-issue-attribute-filter-dropdowns.removeFilter',
'Remove {{value0}} filter',
{ value0: label }
@@ -111,6 +112,7 @@ export default function LinearIssueAttributeFilterDropdowns({
teamsSettled,
settings
}: Props): React.JSX.Element {
const t = useTranslate()
const [popoverOpen, setPopoverOpen] = useState(false)
const [openSection, setOpenSection] = useState<LinearIssueFilterSectionKey | null>(null)
// Tie truncation records to the surviving ids so pruning, clearing or workspace changes retire stale warnings.
@@ -244,16 +246,19 @@ export default function LinearIssueAttributeFilterDropdowns({
[members.data]
)
const pills = linearIssueAttributeFilterPillLabels({
value,
stateNamesById,
memberNamesById,
labelNamesById,
statusOptions,
labelOptions,
statusTruncated,
labelsTruncated
})
const pills = linearIssueAttributeFilterPillLabels(
{
value,
stateNamesById,
memberNamesById,
labelNamesById,
statusOptions,
labelOptions,
statusTruncated,
labelsTruncated
},
t
)
// Cap expanded ids before IPC rejects them; spread slots across rows so lexical order cannot erase a picked row.
const applyPickedFilter = (next: LinearIssueAttributeFilter): void => {
@@ -287,7 +292,7 @@ export default function LinearIssueAttributeFilterDropdowns({
}
const teamRequiredMessage = !primaryTeam
? translate(
? t(
'auto.components.linear-issue-attribute-filter-dropdowns.teamRequired',
'Select a team to load status, assignees, and labels for this workspace.'
)
@@ -310,16 +315,13 @@ export default function LinearIssueAttributeFilterDropdowns({
variant="outline"
size="sm"
className="h-7 gap-1.5 px-2 text-xs"
aria-label={translate(
aria-label={t(
'auto.components.linear-issue-attribute-filter-dropdowns.filters',
'Filters'
)}
>
<ListFilter className="size-3.5" />
{translate(
'auto.components.linear-issue-attribute-filter-dropdowns.filters',
'Filters'
)}
{t('auto.components.linear-issue-attribute-filter-dropdowns.filters', 'Filters')}
{activeCount > 0 ? (
<span className="rounded-full bg-muted px-1.5 text-[10px] font-medium text-muted-foreground">
{activeCount}
@@ -331,13 +333,13 @@ export default function LinearIssueAttributeFilterDropdowns({
{!scopedWorkspaceId ? (
<div className="space-y-2 p-3 text-xs">
<p className="font-medium text-foreground">
{translate(
{t(
'auto.components.linear-issue-attribute-filter-dropdowns.allWorkspacesTitle',
'Select one workspace'
)}
</p>
<p className="text-muted-foreground">
{translate(
{t(
'auto.components.linear-issue-attribute-filter-dropdowns.allWorkspacesBody',
'Status, assignee, and label filters use ids from a single Linear workspace. Choose one workspace to filter by those attributes.'
)}
@@ -381,7 +383,7 @@ export default function LinearIssueAttributeFilterDropdowns({
className="w-full rounded-md px-2 py-1.5 text-left text-xs text-muted-foreground transition hover:bg-muted/50 hover:text-foreground"
onClick={() => onChange(emptyLinearIssueAttributeFilter())}
>
{translate(
{t(
'auto.components.linear-issue-attribute-filter-dropdowns.clearAll',
'Clear all filters'
)}
@@ -1,5 +1,6 @@
// Keep coverage visible on pills after the picker’s detailed notice closes.
import { translate } from '@/i18n/i18n'
import type { Translate } from '@/i18n/use-translate'
import {
canonicalizeLinearIssueAttributeFilter,
type LinearIssueAttributeFilter
@@ -50,23 +51,26 @@ export type LinearIssueFilterPill = {
partial: boolean
}
export function linearIssueAttributeFilterPillLabels(options: {
value: LinearIssueAttributeFilter
stateNamesById: Map<string, string>
memberNamesById: Map<string, string>
labelNamesById: Map<string, string>
statusOptions: readonly LinearIssueFilterGroupedOption[]
labelOptions: readonly LinearIssueFilterGroupedOption[]
/** Recorded where the cap ran, not inferred from the ids it left behind (STA-5996). */
statusTruncated: boolean
labelsTruncated: boolean
}): LinearIssueFilterPill[] {
export function linearIssueAttributeFilterPillLabels(
options: {
value: LinearIssueAttributeFilter
stateNamesById: Map<string, string>
memberNamesById: Map<string, string>
labelNamesById: Map<string, string>
statusOptions: readonly LinearIssueFilterGroupedOption[]
labelOptions: readonly LinearIssueFilterGroupedOption[]
/** Recorded where the cap ran, not inferred from the ids it left behind (STA-5996). */
statusTruncated: boolean
labelsTruncated: boolean
},
t: Translate = translate
): LinearIssueFilterPill[] {
const canonical = canonicalizeLinearIssueAttributeFilter(options.value)
const pills: LinearIssueFilterPill[] = []
if (canonical.stateIds.length > 0) {
pills.push({
key: 'status',
label: translate('auto.components.linear-issue-attribute-filter-sections.status', 'Status'),
label: t('auto.components.linear-issue-attribute-filter-sections.status', 'Status'),
value: distinctFacetNames(canonical.stateIds, options.stateNamesById).join(', '),
partial: isLinearMetadataGroupSelectionPartial(
options.statusOptions,
@@ -78,10 +82,7 @@ export function linearIssueAttributeFilterPillLabels(options: {
if (canonical.priorities.length > 0) {
pills.push({
key: 'priority',
label: translate(
'auto.components.linear-issue-attribute-filter-sections.priority',
'Priority'
),
label: t('auto.components.linear-issue-attribute-filter-sections.priority', 'Priority'),
value: canonical.priorities.map((p) => getLinearPriorityLabel(p)).join(', '),
partial: false
})
@@ -89,23 +90,14 @@ export function linearIssueAttributeFilterPillLabels(options: {
if (canonical.assignee?.kind === 'unassigned') {
pills.push({
key: 'assignee',
label: translate(
'auto.components.linear-issue-attribute-filter-sections.assignee',
'Assignee'
),
value: translate(
'auto.components.linear-issue-attribute-filter-sections.unassigned',
'Unassigned'
),
label: t('auto.components.linear-issue-attribute-filter-sections.assignee', 'Assignee'),
value: t('auto.components.linear-issue-attribute-filter-sections.unassigned', 'Unassigned'),
partial: false
})
} else if (canonical.assignee?.kind === 'user') {
pills.push({
key: 'assignee',
label: translate(
'auto.components.linear-issue-attribute-filter-sections.assignee',
'Assignee'
),
label: t('auto.components.linear-issue-attribute-filter-sections.assignee', 'Assignee'),
value: options.memberNamesById.get(canonical.assignee.id) ?? canonical.assignee.id,
partial: false
})
@@ -113,7 +105,7 @@ export function linearIssueAttributeFilterPillLabels(options: {
if (canonical.labelIds.length > 0) {
pills.push({
key: 'labels',
label: translate('auto.components.linear-issue-attribute-filter-sections.labels', 'Labels'),
label: t('auto.components.linear-issue-attribute-filter-sections.labels', 'Labels'),
value: distinctFacetNames(canonical.labelIds, options.labelNamesById).join(', '),
partial: isLinearMetadataGroupSelectionPartial(
options.labelOptions,
@@ -7,6 +7,7 @@ import {
} from '@/components/github/PRFilterPickers'
import { cn } from '@/lib/utils'
import { translate } from '@/i18n/i18n'
import { useTranslate, type Translate } from '@/i18n/use-translate'
import {
LINEAR_ISSUE_ATTRIBUTE_FILTER_MAX_LABEL_IDS,
LINEAR_ISSUE_ATTRIBUTE_FILTER_MAX_STATE_IDS,
@@ -38,14 +39,15 @@ type LinearIssueFilterSectionSummary = { text: string; partial: boolean }
function facetSummary(
options: readonly LinearIssueFilterGroupedOption[],
selectedIds: readonly string[],
truncated: boolean
truncated: boolean,
t: Translate = translate
): LinearIssueFilterSectionSummary {
const count = selectedLinearMetadataGroupKeys(options, selectedIds).length
if (count === 0) {
return { text: '', partial: false }
}
return {
text: translate(
text: t(
'auto.components.linear-issue-attribute-filter-sections.countSelected',
'{{count}} selected',
{ count }
@@ -73,6 +75,7 @@ export function LinearIssueFilterSectionMenu({
labelsTruncated: boolean
onOpenSection: (section: LinearIssueFilterSectionKey) => void
}): React.JSX.Element {
const t = useTranslate()
const sections: {
key: LinearIssueFilterSectionKey
label: string
@@ -80,18 +83,15 @@ export function LinearIssueFilterSectionMenu({
}[] = [
{
key: 'status',
label: translate('auto.components.linear-issue-attribute-filter-sections.status', 'Status'),
summary: facetSummary(statusOptions, value.stateIds, statusTruncated)
label: t('auto.components.linear-issue-attribute-filter-sections.status', 'Status'),
summary: facetSummary(statusOptions, value.stateIds, statusTruncated, t)
},
{
key: 'priority',
label: translate(
'auto.components.linear-issue-attribute-filter-sections.priority',
'Priority'
),
label: t('auto.components.linear-issue-attribute-filter-sections.priority', 'Priority'),
summary: plainSummary(
value.priorities.length > 0
? translate(
? t(
'auto.components.linear-issue-attribute-filter-sections.countSelected',
'{{count}} selected',
{ count: value.priorities.length }
@@ -101,28 +101,19 @@ export function LinearIssueFilterSectionMenu({
},
{
key: 'assignee',
label: translate(
'auto.components.linear-issue-attribute-filter-sections.assignee',
'Assignee'
),
label: t('auto.components.linear-issue-attribute-filter-sections.assignee', 'Assignee'),
summary: plainSummary(
value.assignee
? value.assignee.kind === 'unassigned'
? translate(
'auto.components.linear-issue-attribute-filter-sections.unassigned',
'Unassigned'
)
: translate(
'auto.components.linear-issue-attribute-filter-sections.selected',
'selected'
)
? t('auto.components.linear-issue-attribute-filter-sections.unassigned', 'Unassigned')
: t('auto.components.linear-issue-attribute-filter-sections.selected', 'selected')
: ''
)
},
{
key: 'labels',
label: translate('auto.components.linear-issue-attribute-filter-sections.labels', 'Labels'),
summary: facetSummary(labelOptions, value.labelIds, labelsTruncated)
label: t('auto.components.linear-issue-attribute-filter-sections.labels', 'Labels'),
summary: facetSummary(labelOptions, value.labelIds, labelsTruncated, t)
}
]
@@ -143,7 +134,7 @@ export function LinearIssueFilterSectionMenu({
{/* Why: the marker sits outside the truncating span so a long count never clips it. */}
{section.summary.partial ? (
<span className="shrink-0">
{translate(
{t(
'auto.components.linear-issue-attribute-filter-sections.partialCoverageMarker',
'· partial'
)}
@@ -192,6 +183,7 @@ export function LinearIssueFilterSectionDetail({
teamRequiredMessage: string | null
onBack: () => void
}): React.JSX.Element {
const t = useTranslate()
if (section === 'priority') {
return (
<div>
@@ -201,7 +193,7 @@ export function LinearIssueFilterSectionDetail({
selected={value.priorities.map(String)}
loading={false}
error={null}
searchPlaceholder={translate(
searchPlaceholder={t(
'auto.components.linear-issue-attribute-filter-sections.searchPriority',
'Filter priority…'
)}
@@ -240,10 +232,7 @@ export function LinearIssueFilterSectionDetail({
})
}
>
{translate(
'auto.components.linear-issue-attribute-filter-sections.unassigned',
'Unassigned'
)}
{t('auto.components.linear-issue-attribute-filter-sections.unassigned', 'Unassigned')}
</button>
</div>
) : null}
@@ -266,11 +255,11 @@ export function LinearIssueFilterSectionDetail({
error={isStatus ? statusError : labelError}
searchPlaceholder={
isStatus
? translate(
? t(
'auto.components.linear-issue-attribute-filter-sections.searchStatus',
'Filter status…'
)
: translate(
: t(
'auto.components.linear-issue-attribute-filter-sections.searchLabels',
'Filter labels…'
)
@@ -309,7 +298,7 @@ export function LinearIssueFilterSectionDetail({
options={[
{
key: '__unassigned__',
primary: translate(
primary: t(
'auto.components.linear-issue-attribute-filter-sections.unassigned',
'Unassigned'
)
@@ -319,7 +308,7 @@ export function LinearIssueFilterSectionDetail({
activeValue={activeAssignee}
loading={assigneeLoading}
error={assigneeError}
searchPlaceholder={translate(
searchPlaceholder={t(
'auto.components.linear-issue-attribute-filter-sections.searchAssignee',
'Filter assignee…'
)}
@@ -340,13 +329,14 @@ export function LinearIssueFilterSectionDetail({
}
function SectionBack({ onBack }: { onBack: () => void }): React.JSX.Element {
const t = useTranslate()
return (
<button
type="button"
onClick={onBack}
className="flex w-full items-center gap-1 border-b border-border/50 px-3 py-1.5 text-left text-xs text-muted-foreground transition hover:bg-muted/40 hover:text-foreground"
>
{translate('auto.components.linear-issue-attribute-filter-sections.back', 'Back')}
{t('auto.components.linear-issue-attribute-filter-sections.back', 'Back')}
</button>
)
}
@@ -8,6 +8,7 @@ import { toast } from 'sonner'
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'
import { useMountedRef } from '@/hooks/useMountedRef'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { getLinearProjectSearchRequestQuery } from '@/components/linear-project-search-query'
import { linearUpdateIssue } from '@/runtime/linear/runtime-linear-issue-client'
import { linearListProjects } from '@/runtime/linear/runtime-linear-project-client'
@@ -24,6 +25,7 @@ export function LinearIssueProjectSelector({
issue: LinearIssue
sourceContext?: TaskSourceContext | null
}): React.JSX.Element {
const t = useTranslate()
const settings = useAppStore((state) => state.settings)
const providerSettings = sourceContext ?? defaultScopeSource(settings)
const patchLinearIssue = useAppStore((state) => state.patchLinearIssue)
@@ -121,7 +123,7 @@ export function LinearIssueProjectSelector({
return (
<section className="rounded-xl border border-border/60 bg-card text-card-foreground shadow-xs">
<div className="flex h-10 items-center gap-1 border-b border-border/50 px-4 text-sm font-medium text-muted-foreground">
<span>{translate('auto.components.LinearIssueWorkspace.b51276c8d6', 'Project')}</span>
<span>{t('auto.components.LinearIssueWorkspace.b51276c8d6', 'Project')}</span>
<ChevronDown className="size-3.5" />
</div>
<Popover open={open} onOpenChange={setOpen}>
@@ -133,7 +135,7 @@ export function LinearIssueProjectSelector({
<FolderKanban className="size-4 shrink-0" />
<span className="min-w-0 flex-1 truncate">
{issue.project?.name ??
translate('auto.components.LinearIssueWorkspace.519c3587f3', 'Add to project')}
t('auto.components.LinearIssueWorkspace.519c3587f3', 'Add to project')}
</span>
<ChevronDown className="size-3.5 shrink-0" />
</button>
@@ -143,17 +145,14 @@ export function LinearIssueProjectSelector({
<input
value={query}
onChange={(event) => setQuery(event.target.value)}
placeholder={translate(
'auto.components.LinearIssueWorkspace.db3f269d98',
'Search projects'
)}
placeholder={t('auto.components.LinearIssueWorkspace.db3f269d98', 'Search projects')}
className="h-8 w-full rounded-md border border-input bg-background px-2 text-sm outline-none focus-visible:ring-1 focus-visible:ring-ring"
/>
<div className="max-h-64 overflow-y-auto scrollbar-sleek">
{displayedLoading ? (
<div className="flex items-center gap-2 px-2 py-3 text-sm text-muted-foreground">
<LoaderCircle className="size-3.5 animate-spin" />
{translate('auto.components.LinearIssueWorkspace.937ba6ad9a', 'Loading projects')}
{t('auto.components.LinearIssueWorkspace.937ba6ad9a', 'Loading projects')}
</div>
) : displayedProjects.length > 0 ? (
displayedProjects.map((project) => (
@@ -179,11 +178,8 @@ export function LinearIssueProjectSelector({
) : (
<div className="px-2 py-3 text-sm text-muted-foreground">
{query.trim()
? translate(
'auto.components.LinearIssueWorkspace.c11b4e3cc2',
'No projects found.'
)
: translate(
? t('auto.components.LinearIssueWorkspace.c11b4e3cc2', 'No projects found.')
: t(
'auto.components.LinearIssueWorkspace.76ffd3c937',
'Search for a project to add.'
)}
@@ -9,6 +9,7 @@ import { Button } from '@/components/ui/button'
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'
import { useMountedRef } from '@/hooks/useMountedRef'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { linearCreateSubIssue } from '@/runtime/linear/runtime-linear-issue-client'
import { useAppStore } from '@/store'
import type { LinearIssue, LinearIssueChildSummary } from '../../../shared/linear/issue-types'
@@ -36,6 +37,7 @@ export function LinearIssueSubIssues({
onOpenIssue: (issue: LinearIssue) => void
sourceContext?: TaskSourceContext | null
}): React.JSX.Element {
const t = useTranslate()
const settings = useAppStore((state) => state.settings)
const providerSettings = sourceContext ?? defaultScopeSource(settings)
const fetchLinearIssue = useAppStore((state) => state.fetchLinearIssue)
@@ -204,9 +206,7 @@ export function LinearIssueSubIssues({
className="flex h-9 items-center gap-2 rounded-md px-1 text-sm font-medium text-muted-foreground transition hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
>
<Plus className="size-4" />
<span>
{translate('auto.components.LinearIssueWorkspace.8c55d6696a', 'Add sub-issues')}
</span>
<span>{t('auto.components.LinearIssueWorkspace.8c55d6696a', 'Add sub-issues')}</span>
</button>
</PopoverTrigger>
<PopoverContent className="w-80 p-3" align="start">
@@ -220,10 +220,7 @@ export function LinearIssueSubIssues({
void handleCreate()
}
}}
placeholder={translate(
'auto.components.LinearIssueWorkspace.c182e02de5',
'Sub-issue title'
)}
placeholder={t('auto.components.LinearIssueWorkspace.c182e02de5', 'Sub-issue title')}
className="h-9 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus-visible:ring-1 focus-visible:ring-ring"
/>
<div className="flex justify-end">
@@ -233,7 +230,7 @@ export function LinearIssueSubIssues({
disabled={!title.trim() || submitting}
>
{submitting ? <LoaderCircle className="size-3.5 animate-spin" /> : null}
{translate('auto.components.LinearIssueWorkspace.42589845bc', 'Create')}
{t('auto.components.LinearIssueWorkspace.42589845bc', 'Create')}
</Button>
</div>
</div>
@@ -22,7 +22,7 @@ import {
DropdownMenuTrigger
} from '@/components/ui/dropdown-menu'
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import type { LinearIssue } from '../../../shared/linear/issue-types'
import { copyLinearIssueText } from './linear-issue-clipboard'
import { openAppHttpLink } from '@/lib/browser/navigation/app-http-link-open'
@@ -46,6 +46,7 @@ export function LinearIssueWorkspaceHeader({
onOpenOrUseIssue: () => void
onUseIssue: () => void
}): React.JSX.Element {
const t = useTranslate()
return (
<header className="flex h-[61px] flex-none items-center justify-between gap-4 border-b border-border/60 px-5">
<div className="flex min-w-0 items-center gap-2 text-sm text-muted-foreground">
@@ -64,12 +65,11 @@ export function LinearIssueWorkspaceHeader({
) : null}
<LinearIcon className="size-4 shrink-0 text-muted-foreground" />
<span className="truncate font-medium text-foreground">
{issue.workspaceName ??
translate('auto.components.LinearIssueWorkspace.65239a714b', 'Linear')}
{issue.workspaceName ?? t('auto.components.LinearIssueWorkspace.65239a714b', 'Linear')}
</span>
<ChevronRight className="size-3.5 shrink-0" />
<span className="shrink-0">
{translate('auto.components.LinearIssueWorkspace.f63ef94ea8', 'Issues')}
{t('auto.components.LinearIssueWorkspace.f63ef94ea8', 'Issues')}
</span>
<ChevronRight className="size-3.5 shrink-0" />
<span className="shrink-0 font-mono">{issue.identifier}</span>
@@ -85,16 +85,13 @@ export function LinearIssueWorkspaceHeader({
variant="ghost"
size="icon-sm"
onClick={() => void copyLinearIssueText(issue.url, 'url')}
aria-label={translate(
'auto.components.LinearIssueWorkspace.97c19a84f1',
'Copy Linear URL'
)}
aria-label={t('auto.components.LinearIssueWorkspace.97c19a84f1', 'Copy Linear URL')}
>
<Copy className="size-4" />
</Button>
</TooltipTrigger>
<TooltipContent side="bottom" sideOffset={6}>
{translate('auto.components.LinearIssueWorkspace.9a9a884236', 'Copy URL')}
{t('auto.components.LinearIssueWorkspace.9a9a884236', 'Copy URL')}
</TooltipContent>
</Tooltip>
<Tooltip>
@@ -104,16 +101,13 @@ export function LinearIssueWorkspaceHeader({
variant="ghost"
size="icon-sm"
onClick={(event) => openAppHttpLink(issue.url, { event })}
aria-label={translate(
'auto.components.LinearIssueWorkspace.openOnLinear',
'Open on Linear'
)}
aria-label={t('auto.components.LinearIssueWorkspace.openOnLinear', 'Open on Linear')}
>
<ExternalLink className="size-4" />
</Button>
</TooltipTrigger>
<TooltipContent side="bottom" sideOffset={6}>
{translate('auto.components.LinearIssueWorkspace.openOnLinear', 'Open on Linear')}
{t('auto.components.LinearIssueWorkspace.openOnLinear', 'Open on Linear')}
</TooltipContent>
</Tooltip>
{attachedWorkspace ? (
@@ -124,19 +118,19 @@ export function LinearIssueWorkspaceHeader({
size="sm"
onClick={onOpenOrUseIssue}
className="gap-1.5 whitespace-nowrap"
aria-label={translate(
aria-label={t(
'auto.components.LinearIssueWorkspace.openAttachedWorkspace',
'Open workspace attached to issue'
)}
>
<FolderOpen className="size-3.5" />
{translate('auto.components.LinearIssueWorkspace.openWorkspace', 'Open workspace')}
{t('auto.components.LinearIssueWorkspace.openWorkspace', 'Open workspace')}
</Button>
<DropdownMenuTrigger asChild>
<Button
type="button"
size="icon-sm"
aria-label={translate(
aria-label={t(
'auto.components.LinearIssueWorkspace.moreWorkspaceActions',
'More issue workspace actions'
)}
@@ -148,10 +142,7 @@ export function LinearIssueWorkspaceHeader({
<DropdownMenuContent align="end">
<DropdownMenuItem onSelect={onUseIssue}>
<Plus className="size-4" />
{translate(
'auto.components.LinearIssueWorkspace.startNewWorkspace',
'Start new workspace'
)}
{t('auto.components.LinearIssueWorkspace.startNewWorkspace', 'Start new workspace')}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
@@ -161,12 +152,12 @@ export function LinearIssueWorkspaceHeader({
size="sm"
onClick={onOpenOrUseIssue}
className="gap-1.5 whitespace-nowrap"
aria-label={translate(
aria-label={t(
'auto.components.LinearIssueWorkspace.30a7f56c0a',
'Start workspace from issue'
)}
>
{translate('auto.components.LinearIssueWorkspace.e1e0a9bca9', 'Start workspace')}
{t('auto.components.LinearIssueWorkspace.e1e0a9bca9', 'Start workspace')}
<ArrowRight className="size-3.5" />
</Button>
)}
@@ -177,7 +168,7 @@ export function LinearIssueWorkspaceHeader({
variant="ghost"
size="icon-sm"
onClick={onClose}
aria-label={translate(
aria-label={t(
'auto.components.LinearIssueWorkspace.7a4997d8bb',
'Close Linear issue preview'
)}
@@ -186,7 +177,7 @@ export function LinearIssueWorkspaceHeader({
</Button>
</TooltipTrigger>
<TooltipContent side="bottom" sideOffset={6}>
{translate('auto.components.LinearIssueWorkspace.df4c86ed12', 'Close')}
{t('auto.components.LinearIssueWorkspace.df4c86ed12', 'Close')}
</TooltipContent>
</Tooltip>
) : null}
@@ -5,7 +5,7 @@ import { LinearIssueEditSection, type LinearEditState } from '@/components/Linea
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { buildLinearIssueContextSnapshot } from '@/lib/work-items/linear/linear-issue-context-snapshot'
import { buildContainedLinkedContextBlock } from '@/lib/linked-work-item-context'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { buildLinearIssueBranchName } from '@/components/linear-issue-workspace-text'
import type { LinearComment, LinearIssue } from '../../../shared/linear/issue-types'
import type { TaskSourceContext } from '../../../shared/task-source-context'
@@ -19,19 +19,18 @@ function LinearIssueWorkspaceAttachmentCard({
label: string | null
onOpen: () => void
}): React.JSX.Element {
const t = useTranslate()
return (
<section className="rounded-xl border border-border/60 bg-card text-card-foreground shadow-xs">
<div className="flex h-10 items-center gap-1 border-b border-border/50 px-4 text-sm font-medium text-muted-foreground">
<span>
{translate('auto.components.LinearIssueWorkspace.workspaceSection', 'Workspace')}
</span>
<span>{t('auto.components.LinearIssueWorkspace.workspaceSection', 'Workspace')}</span>
</div>
<div className="p-3">
{label ? (
<button
type="button"
onClick={onOpen}
aria-label={translate(
aria-label={t(
'auto.components.LinearIssueWorkspace.openAttachedWorkspace',
'Open workspace attached to issue'
)}
@@ -42,7 +41,7 @@ function LinearIssueWorkspaceAttachmentCard({
</button>
) : (
<div className="px-2 py-1.5 text-sm text-muted-foreground">
{translate('auto.components.LinearIssueWorkspace.noWorkspaceYet', 'None yet')}
{t('auto.components.LinearIssueWorkspace.noWorkspaceYet', 'None yet')}
</div>
)}
</div>
@@ -57,27 +56,25 @@ function LinearIssueActionsCard({
issue: LinearIssue
comments: LinearComment[]
}): React.JSX.Element {
const t = useTranslate()
const actionItems = [
{
label: translate('auto.components.LinearIssueWorkspace.9a9a884236', 'Copy URL'),
label: t('auto.components.LinearIssueWorkspace.9a9a884236', 'Copy URL'),
icon: Clipboard,
action: () => void copyLinearIssueText(issue.url, 'url')
},
{
label: translate('auto.components.LinearIssueWorkspace.30c1242f3a', 'Copy identifier'),
label: t('auto.components.LinearIssueWorkspace.30c1242f3a', 'Copy identifier'),
icon: Clipboard,
action: () => void copyLinearIssueText(issue.identifier, 'identifier')
},
{
label: translate(
'auto.components.LinearIssueWorkspace.5d670ec8dc',
'Copy suggested branch name'
),
label: t('auto.components.LinearIssueWorkspace.5d670ec8dc', 'Copy suggested branch name'),
icon: GitBranch,
action: () => void copyLinearIssueText(buildLinearIssueBranchName(issue), 'branchName')
},
{
label: translate('auto.components.LinearIssueWorkspace.f6c6381593', 'Copy prompt'),
label: t('auto.components.LinearIssueWorkspace.f6c6381593', 'Copy prompt'),
icon: Clipboard,
action: () => {
const renderedText = buildLinearIssueContextSnapshot(issue, comments)
@@ -94,7 +91,7 @@ function LinearIssueActionsCard({
return (
<section className="rounded-xl border border-border/60 bg-card text-card-foreground shadow-xs">
<div className="flex h-10 items-center gap-1 border-b border-border/50 px-4 text-sm font-medium text-muted-foreground">
<span>{translate('auto.components.LinearIssueWorkspace.c23e79e5c0', 'Actions')}</span>
<span>{t('auto.components.LinearIssueWorkspace.c23e79e5c0', 'Actions')}</span>
<ChevronDown className="size-3.5" />
</div>
<div className="space-y-1 p-3">
@@ -3,8 +3,8 @@ import type { LinearIssue } from '../../../shared/linear/issue-types'
import { getUsableLinearBranchName } from '../../../shared/new-workspace/workspace-source'
import { formatUiRelativeTimeFromDate } from '@/i18n/relative-time-format'
export function formatLinearIssueRelativeTime(input: string): string {
return formatUiRelativeTimeFromDate(input)
export function formatLinearIssueRelativeTime(input: string, intlLocale?: string): string {
return formatUiRelativeTimeFromDate(input, undefined, intlLocale)
}
export function buildLinearIssueBranchName(issue: LinearIssue): string {
@@ -14,6 +14,7 @@ import { createNonSecureContextUuid as createBrowserUuid } from '../../../shared
import { useAppStore } from '@/store'
import { linearAddIssueComment } from '@/runtime/linear/runtime-linear-issue-client'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import type { TaskSourceContext } from '../../../shared/task-source-context'
import type { LinearLocalComment } from '@/components/linear-item-drawer-types'
import { defaultScopeSource } from '@/lib/default-creation-host'
@@ -31,6 +32,7 @@ export function LinearIssueCommentFooter({
variant?: 'compact' | 'linear-page'
sourceContext?: TaskSourceContext | null
}): React.JSX.Element {
const t = useTranslate()
const settings = useAppStore((s) => s.settings)
const providerSettings = sourceContext ?? defaultScopeSource(settings)
const submitShortcutLabel = getScreenSubmitShortcutLabel()
@@ -133,17 +135,14 @@ export function LinearIssueCommentFooter({
autoGrow()
}}
onKeyDown={handleKeyDown}
placeholder={translate(
'auto.components.LinearItemDrawer.2820f0f0f0',
'Leave a comment...'
)}
placeholder={t('auto.components.LinearItemDrawer.2820f0f0f0', 'Leave a comment...')}
rows={3}
className="scrollbar-sleek min-h-24 max-h-40 w-full resize-none overflow-y-auto rounded-t-xl bg-transparent px-5 py-4 text-sm placeholder:text-muted-foreground focus-visible:outline-none"
/>
<div className="flex items-center justify-between px-4 pb-3">
<span className="text-[11px] text-muted-foreground">
{submitShortcutLabel !== 'Unassigned'
? translate('auto.components.LinearItemDrawer.fda549766e', '{{value0}} to comment', {
? t('auto.components.LinearItemDrawer.fda549766e', '{{value0}} to comment', {
value0: submitShortcutLabel
})
: ''}
@@ -152,7 +151,7 @@ export function LinearIssueCommentFooter({
size="icon-sm"
onClick={handleSubmit}
disabled={!canSubmitComment || submitting}
aria-label={translate('auto.components.LinearItemDrawer.d369841269', 'Send comment')}
aria-label={t('auto.components.LinearItemDrawer.d369841269', 'Send comment')}
>
{submitting ? (
<LoaderCircle className="size-3.5 animate-spin" />
@@ -178,7 +177,7 @@ export function LinearIssueCommentFooter({
autoGrow()
}}
onKeyDown={handleKeyDown}
placeholder={translate('auto.components.LinearItemDrawer.2fcff829a8', 'Add a comment…')}
placeholder={t('auto.components.LinearItemDrawer.2fcff829a8', 'Add a comment…')}
rows={1}
className="scrollbar-sleek min-h-[32px] max-h-[96px] flex-1 resize-none overflow-y-auto rounded-md border border-input bg-transparent px-3 py-2 text-[13px] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
/>
@@ -187,7 +186,7 @@ export function LinearIssueCommentFooter({
onClick={handleSubmit}
disabled={!canSubmitComment || submitting}
className="size-8 shrink-0"
aria-label={translate('auto.components.LinearItemDrawer.d369841269', 'Send comment')}
aria-label={t('auto.components.LinearItemDrawer.d369841269', 'Send comment')}
>
{submitting ? (
<LoaderCircle className="size-3.5 animate-spin" />
@@ -12,6 +12,7 @@ import {
import { LinearPriorityIcon } from '@/components/linear-priority-icon'
import { getLinearPriorityLabel } from '@/components/task-page/task-page-localized-options'
import { translate } from '@/i18n/i18n'
import type { Translate } from '@/i18n/use-translate'
import {
LINEAR_EDIT_CHIP_CLASS,
LINEAR_EDIT_MENU_ITEM_CLASS,
@@ -23,7 +24,8 @@ import {
import type { LinearIssueEditController } from '@/components/linear-item-drawer-edit-controller'
export function renderLinearIssueChipsLayout(
controller: LinearIssueEditController
controller: LinearIssueEditController,
t: Translate = translate
): React.JSX.Element {
const {
statePending,
@@ -82,7 +84,7 @@ export function renderLinearIssueChipsLayout(
) : states.loading ? (
<div className="flex items-center gap-2 px-2 py-3 text-[12px] text-muted-foreground">
<LoaderCircle className="size-3 animate-spin" />
{translate('auto.components.LinearItemDrawer.59b6cd3706', 'Loading states')}
{t('auto.components.LinearItemDrawer.59b6cd3706', 'Loading states')}
</div>
) : states.data.length > 0 ? (
<div>
@@ -106,7 +108,7 @@ export function renderLinearIssueChipsLayout(
</div>
) : (
<div className="px-2 py-3 text-center text-[12px] text-muted-foreground">
{translate('auto.components.LinearItemDrawer.780ea6ed89', 'No states found')}
{t('auto.components.LinearItemDrawer.780ea6ed89', 'No states found')}
</div>
)}
</PopoverContent>
@@ -151,7 +153,7 @@ export function renderLinearIssueChipsLayout(
className={LINEAR_EDIT_CHIP_CLASS}
aria-busy={estimatePending}
>
<span className="truncate">{formatLinearEstimateLabel(localEstimate)}</span>
<span className="truncate">{formatLinearEstimateLabel(localEstimate, t)}</span>
<LinearEditChipAdornment pending={estimatePending} />
</button>
</PopoverTrigger>
@@ -182,10 +184,7 @@ export function renderLinearIssueChipsLayout(
}
}}
inputMode="numeric"
placeholder={translate(
'auto.components.LinearItemDrawer.fbb90300e2',
'Custom estimate'
)}
placeholder={t('auto.components.LinearItemDrawer.fbb90300e2', 'Custom estimate')}
className="h-8 text-sm"
/>
<div className="flex items-center justify-between gap-2">
@@ -195,7 +194,7 @@ export function renderLinearIssueChipsLayout(
size="sm"
onClick={() => handleEstimateChange(null)}
>
{translate('auto.components.LinearItemDrawer.ceeb8c6153', 'Clear')}
{t('auto.components.LinearItemDrawer.ceeb8c6153', 'Clear')}
</Button>
<Button
type="button"
@@ -204,7 +203,7 @@ export function renderLinearIssueChipsLayout(
disabled={estimatePending}
>
{estimatePending ? <LoaderCircle className="size-3.5 animate-spin" /> : null}
{translate('auto.components.LinearItemDrawer.b5675b0694', 'Save')}
{t('auto.components.LinearItemDrawer.b5675b0694', 'Save')}
</Button>
</div>
</div>
@@ -222,7 +221,7 @@ export function renderLinearIssueChipsLayout(
<span className="truncate">
{localAssignee
? localAssignee.displayName
: translate('auto.components.LinearItemDrawer.d71cd3003e', '+ Assignee')}
: t('auto.components.LinearItemDrawer.d71cd3003e', '+ Assignee')}
</span>
<LinearEditChipAdornment loading={members.loading} pending={assigneePending} />
</button>
@@ -234,7 +233,7 @@ export function renderLinearIssueChipsLayout(
onClick={() => handleAssigneeChange('__unassign__')}
className={cn(LINEAR_EDIT_MENU_ITEM_CLASS, !localAssignee && 'bg-accent/50')}
>
{translate('auto.components.LinearItemDrawer.866316f22c', 'Unassigned')}
{t('auto.components.LinearItemDrawer.866316f22c', 'Unassigned')}
</button>
{members.error ? (
<div className="px-2 py-3 text-center text-[12px] text-destructive">
@@ -243,7 +242,7 @@ export function renderLinearIssueChipsLayout(
) : members.loading ? (
<div className="flex items-center gap-2 px-2 py-3 text-[12px] text-muted-foreground">
<LoaderCircle className="size-3 animate-spin" />
{translate('auto.components.LinearItemDrawer.b2376d0179', 'Loading members')}
{t('auto.components.LinearItemDrawer.b2376d0179', 'Loading members')}
</div>
) : (
members.data.map((m) => (
@@ -272,10 +271,10 @@ export function renderLinearIssueChipsLayout(
className={LINEAR_EDIT_CHIP_CLASS}
aria-label={
localLabels.length
? translate('auto.components.LinearItemDrawer.7f7b89b631', 'Labels: {{value0}}', {
? t('auto.components.LinearItemDrawer.7f7b89b631', 'Labels: {{value0}}', {
value0: localLabels.join(', ')
})
: translate('auto.components.LinearItemDrawer.23886c7eec', 'Add label')
: t('auto.components.LinearItemDrawer.23886c7eec', 'Add label')
}
aria-busy={labelsPending || labels.loading}
>
@@ -289,7 +288,7 @@ export function renderLinearIssueChipsLayout(
) : labels.loading ? (
<div className="flex items-center gap-2 px-2 py-3 text-[12px] text-muted-foreground">
<LoaderCircle className="size-3 animate-spin" />
{translate('auto.components.LinearItemDrawer.cddd9b04a7', 'Loading labels')}
{t('auto.components.LinearItemDrawer.cddd9b04a7', 'Loading labels')}
</div>
) : labels.data.length > 0 ? (
<div>
@@ -320,7 +319,7 @@ export function renderLinearIssueChipsLayout(
</div>
) : (
<div className="px-2 py-3 text-center text-[12px] text-muted-foreground">
{translate('auto.components.LinearItemDrawer.367f828482', 'No labels found')}
{t('auto.components.LinearItemDrawer.367f828482', 'No labels found')}
</div>
)}
</PopoverContent>
@@ -1,6 +1,7 @@
import React from 'react'
import { ChevronDown, LoaderCircle } from 'lucide-react'
import { translate } from '@/i18n/i18n'
import type { Translate } from '@/i18n/use-translate'
export const LINEAR_EDIT_CHIP_CLASS =
'inline-flex h-6 min-w-0 max-w-[14rem] cursor-pointer items-center gap-1.5 rounded-full border border-border/70 bg-background/70 px-2.5 text-[11px] font-medium leading-none text-muted-foreground shadow-xs transition-[background-color,border-color,color,box-shadow] hover:border-border hover:bg-accent hover:text-accent-foreground hover:[--linear-state-pill-current-background:var(--linear-state-pill-hover-background)] hover:[--linear-state-pill-current-border:var(--linear-state-pill-hover-border)] hover:[--linear-state-pill-current-foreground:var(--linear-state-pill-hover-foreground)] focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-80'
@@ -13,10 +14,13 @@ export const LINEAR_EDIT_MENU_ITEM_WITH_ICON_CLASS =
export const LINEAR_ESTIMATE_PRESETS = [1, 2, 3, 5, 8] as const
export function formatLinearEstimateLabel(estimate: number | null | undefined): string {
export function formatLinearEstimateLabel(
estimate: number | null | undefined,
t: Translate = translate
): string {
return estimate === null || estimate === undefined
? translate('auto.components.LinearItemDrawer.setEstimate', 'Set estimate')
: translate('auto.components.LinearItemDrawer.estimateValue', 'Estimate {{estimate}}', {
? t('auto.components.LinearItemDrawer.setEstimate', 'Set estimate')
: t('auto.components.LinearItemDrawer.estimateValue', 'Estimate {{estimate}}', {
estimate
})
}
@@ -9,6 +9,7 @@ import { getLinearStateMarkerStyle } from '@/components/linear-state-pill-style'
import { LinearPriorityIcon } from '@/components/linear-priority-icon'
import { getLinearPriorityLabel } from '@/components/task-page/task-page-localized-options'
import { translate } from '@/i18n/i18n'
import type { Translate } from '@/i18n/use-translate'
import {
LINEAR_EDIT_MENU_ITEM_CLASS,
LINEAR_EDIT_MENU_ITEM_WITH_ICON_CLASS,
@@ -19,7 +20,8 @@ import {
import type { LinearIssueEditController } from '@/components/linear-item-drawer-edit-controller'
export function renderLinearIssuePropertiesLayout(
controller: LinearIssueEditController
controller: LinearIssueEditController,
t: Translate = translate
): React.JSX.Element {
const {
statePending,
@@ -61,7 +63,7 @@ export function renderLinearIssuePropertiesLayout(
<div className="space-y-3">
<section className="rounded-xl border border-border/60 bg-card text-card-foreground shadow-xs">
<div className="flex h-10 items-center gap-1 border-b border-border/50 px-4 text-sm font-medium text-muted-foreground">
<span>{translate('auto.components.LinearItemDrawer.dd304de85a', 'Properties')}</span>
<span>{t('auto.components.LinearItemDrawer.dd304de85a', 'Properties')}</span>
<ChevronDown className="size-3.5" />
</div>
<div className="space-y-1 p-3">
@@ -92,7 +94,7 @@ export function renderLinearIssuePropertiesLayout(
) : states.loading ? (
<div className="flex items-center gap-2 px-2 py-3 text-[12px] text-muted-foreground">
<LoaderCircle className="size-3 animate-spin" />
{translate('auto.components.LinearItemDrawer.59b6cd3706', 'Loading states')}
{t('auto.components.LinearItemDrawer.59b6cd3706', 'Loading states')}
</div>
) : states.data.length > 0 ? (
<div>
@@ -116,7 +118,7 @@ export function renderLinearIssuePropertiesLayout(
</div>
) : (
<div className="px-2 py-3 text-center text-[12px] text-muted-foreground">
{translate('auto.components.LinearItemDrawer.780ea6ed89', 'No states found')}
{t('auto.components.LinearItemDrawer.780ea6ed89', 'No states found')}
</div>
)}
</PopoverContent>
@@ -175,7 +177,7 @@ export function renderLinearIssuePropertiesLayout(
<span className="min-w-0 flex-1 truncate">
{localAssignee
? localAssignee.displayName
: translate('auto.components.LinearItemDrawer.866316f22c', 'Unassigned')}
: t('auto.components.LinearItemDrawer.866316f22c', 'Unassigned')}
</span>
<LinearEditChipAdornment loading={members.loading} pending={assigneePending} />
</button>
@@ -190,7 +192,7 @@ export function renderLinearIssuePropertiesLayout(
onClick={() => handleAssigneeChange('__unassign__')}
className={cn(LINEAR_EDIT_MENU_ITEM_CLASS, !localAssignee && 'bg-accent/50')}
>
{translate('auto.components.LinearItemDrawer.866316f22c', 'Unassigned')}
{t('auto.components.LinearItemDrawer.866316f22c', 'Unassigned')}
</button>
{members.error ? (
<div className="px-2 py-3 text-center text-[12px] text-destructive">
@@ -199,7 +201,7 @@ export function renderLinearIssuePropertiesLayout(
) : members.loading ? (
<div className="flex items-center gap-2 px-2 py-3 text-[12px] text-muted-foreground">
<LoaderCircle className="size-3 animate-spin" />
{translate('auto.components.LinearItemDrawer.b2376d0179', 'Loading members')}
{t('auto.components.LinearItemDrawer.b2376d0179', 'Loading members')}
</div>
) : (
members.data.map((m) => (
@@ -230,7 +232,7 @@ export function renderLinearIssuePropertiesLayout(
>
<Gauge className={propertyIconClass} />
<span className="min-w-0 flex-1 truncate">
{formatLinearEstimateLabel(localEstimate)}
{formatLinearEstimateLabel(localEstimate, t)}
</span>
<LinearEditChipAdornment pending={estimatePending} />
</button>
@@ -262,10 +264,7 @@ export function renderLinearIssuePropertiesLayout(
}
}}
inputMode="numeric"
placeholder={translate(
'auto.components.LinearItemDrawer.fbb90300e2',
'Custom estimate'
)}
placeholder={t('auto.components.LinearItemDrawer.fbb90300e2', 'Custom estimate')}
className="h-8 text-sm"
/>
<div className="flex items-center justify-between gap-2">
@@ -275,7 +274,7 @@ export function renderLinearIssuePropertiesLayout(
size="sm"
onClick={() => handleEstimateChange(null)}
>
{translate('auto.components.LinearItemDrawer.ceeb8c6153', 'Clear')}
{t('auto.components.LinearItemDrawer.ceeb8c6153', 'Clear')}
</Button>
<Button
type="button"
@@ -284,7 +283,7 @@ export function renderLinearIssuePropertiesLayout(
disabled={estimatePending}
>
{estimatePending ? <LoaderCircle className="size-3.5 animate-spin" /> : null}
{translate('auto.components.LinearItemDrawer.b5675b0694', 'Save')}
{t('auto.components.LinearItemDrawer.b5675b0694', 'Save')}
</Button>
</div>
</div>
@@ -295,7 +294,7 @@ export function renderLinearIssuePropertiesLayout(
<section className="rounded-xl border border-border/60 bg-card text-card-foreground shadow-xs">
<div className="flex h-10 items-center gap-1 border-b border-border/50 px-4 text-sm font-medium text-muted-foreground">
<span>{translate('auto.components.LinearItemDrawer.64bfffc4dd', 'Labels')}</span>
<span>{t('auto.components.LinearItemDrawer.64bfffc4dd', 'Labels')}</span>
<ChevronDown className="size-3.5" />
</div>
<div className="p-3">
@@ -307,12 +306,10 @@ export function renderLinearIssuePropertiesLayout(
className={propertyRowClass}
aria-label={
localLabels.length
? translate(
'auto.components.LinearItemDrawer.7f7b89b631',
'Labels: {{value0}}',
{ value0: localLabels.join(', ') }
)
: translate('auto.components.LinearItemDrawer.23886c7eec', 'Add label')
? t('auto.components.LinearItemDrawer.7f7b89b631', 'Labels: {{value0}}', {
value0: localLabels.join(', ')
})
: t('auto.components.LinearItemDrawer.23886c7eec', 'Add label')
}
aria-busy={labelsPending || labels.loading}
>
@@ -320,7 +317,7 @@ export function renderLinearIssuePropertiesLayout(
<span className="min-w-0 flex-1 truncate">
{localLabels.length
? labelSummary
: translate('auto.components.LinearItemDrawer.23886c7eec', 'Add label')}
: t('auto.components.LinearItemDrawer.23886c7eec', 'Add label')}
</span>
<LinearEditChipAdornment loading={labels.loading} pending={labelsPending} />
</button>
@@ -336,7 +333,7 @@ export function renderLinearIssuePropertiesLayout(
) : labels.loading ? (
<div className="flex items-center gap-2 px-2 py-3 text-[12px] text-muted-foreground">
<LoaderCircle className="size-3 animate-spin" />
{translate('auto.components.LinearItemDrawer.cddd9b04a7', 'Loading labels')}
{t('auto.components.LinearItemDrawer.cddd9b04a7', 'Loading labels')}
</div>
) : labels.data.length > 0 ? (
<div>
@@ -367,7 +364,7 @@ export function renderLinearIssuePropertiesLayout(
</div>
) : (
<div className="px-2 py-3 text-center text-[12px] text-muted-foreground">
{translate('auto.components.LinearItemDrawer.367f828482', 'No labels found')}
{t('auto.components.LinearItemDrawer.367f828482', 'No labels found')}
</div>
)}
</PopoverContent>
@@ -4,10 +4,12 @@ import { useLinearIssueEditController } from '@/components/linear-item-drawer-ed
import { renderLinearIssueChipsLayout } from '@/components/linear-item-drawer-edit-chips-layout'
import { renderLinearIssuePropertiesLayout } from '@/components/linear-item-drawer-edit-properties-layout'
import type { LinearIssueEditSectionProps } from '@/components/linear-item-drawer-types'
import { useTranslate } from '@/i18n/use-translate'
export function LinearIssueEditSection(props: LinearIssueEditSectionProps): React.JSX.Element {
const t = useTranslate()
const controller = useLinearIssueEditController(props)
return controller.layout === 'properties'
? renderLinearIssuePropertiesLayout(controller)
: renderLinearIssueChipsLayout(controller)
? renderLinearIssuePropertiesLayout(controller, t)
: renderLinearIssueChipsLayout(controller, t)
}
@@ -25,6 +25,7 @@ import CommentMarkdown from '@/components/sidebar/CommentMarkdown'
import { LinearIssueEditSection } from '@/components/linear-item-drawer-edit-section'
import { LinearIssueCommentFooter } from '@/components/linear-item-drawer-comment-footer'
import { translate } from '@/i18n/i18n'
import type { Translate } from '@/i18n/use-translate'
import { formatUiRelativeTimeFromDate } from '@/i18n/relative-time-format'
import type { LinearComment, LinearIssue } from '../../../shared/linear/issue-types'
import type { TaskSourceContext } from '../../../shared/task-source-context'
@@ -40,8 +41,8 @@ function LinearIcon({ className }: { className?: string }): React.JSX.Element {
)
}
function formatRelativeTime(input: string): string {
return formatUiRelativeTimeFromDate(input)
function formatRelativeTime(input: string, intlLocale?: string): string {
return formatUiRelativeTimeFromDate(input, undefined, intlLocale)
}
type LinearItemDrawerSheetProps = {
@@ -59,20 +60,24 @@ type LinearItemDrawerSheetProps = {
onUse: (issue: LinearIssue) => void
}
export function renderLinearItemDrawerSheet({
issue,
onClose,
displayed,
sourceContext,
editState,
commentsLoading,
comments,
handleCommentAdded,
attachedWorkspaceLabel,
attachedWorkspace,
handleOpenOrUseIssue,
onUse
}: LinearItemDrawerSheetProps): React.JSX.Element {
export function renderLinearItemDrawerSheet(
{
issue,
onClose,
displayed,
sourceContext,
editState,
commentsLoading,
comments,
handleCommentAdded,
attachedWorkspaceLabel,
attachedWorkspace,
handleOpenOrUseIssue,
onUse
}: LinearItemDrawerSheetProps,
t: Translate = translate,
intlLocale?: string
): React.JSX.Element {
return (
<Sheet open={issue !== null} onOpenChange={(open) => !open && onClose()}>
<SheetContent
@@ -85,13 +90,12 @@ export function renderLinearItemDrawerSheet({
>
<VisuallyHidden.Root asChild>
<SheetTitle>
{displayed?.title ??
translate('auto.components.LinearItemDrawer.39883467f4', 'Linear issue')}
{displayed?.title ?? t('auto.components.LinearItemDrawer.39883467f4', 'Linear issue')}
</SheetTitle>
</VisuallyHidden.Root>
<VisuallyHidden.Root asChild>
<SheetDescription>
{translate(
{t(
'auto.components.LinearItemDrawer.04a442f796',
'Preview and edit the selected Linear issue.'
)}
@@ -118,7 +122,7 @@ export function renderLinearItemDrawerSheet({
<div className="mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-muted-foreground">
{displayed.workspaceName && <span>{displayed.workspaceName}</span>}
{displayed.team?.name && <span>{displayed.team.name}</span>}
<span>· {formatRelativeTime(displayed.updatedAt)}</span>
<span>· {formatRelativeTime(displayed.updatedAt, intlLocale)}</span>
</div>
</div>
<div className="flex shrink-0 items-center gap-1">
@@ -129,7 +133,7 @@ export function renderLinearItemDrawerSheet({
size="icon"
className="size-7"
onClick={(event) => openAppHttpLink(displayed.url, { event })}
aria-label={translate(
aria-label={t(
'auto.components.LinearItemDrawer.0190b760c1',
'Open on Linear'
)}
@@ -138,7 +142,7 @@ export function renderLinearItemDrawerSheet({
</Button>
</TooltipTrigger>
<TooltipContent side="bottom" sideOffset={6}>
{translate('auto.components.LinearItemDrawer.0190b760c1', 'Open on Linear')}
{t('auto.components.LinearItemDrawer.0190b760c1', 'Open on Linear')}
</TooltipContent>
</Tooltip>
<Tooltip>
@@ -148,7 +152,7 @@ export function renderLinearItemDrawerSheet({
size="icon"
className="size-7"
onClick={onClose}
aria-label={translate(
aria-label={t(
'auto.components.LinearItemDrawer.858d0630da',
'Close preview'
)}
@@ -157,7 +161,7 @@ export function renderLinearItemDrawerSheet({
</Button>
</TooltipTrigger>
<TooltipContent side="bottom" sideOffset={6}>
{translate('auto.components.LinearItemDrawer.9dc54172db', 'Close · Esc')}
{t('auto.components.LinearItemDrawer.9dc54172db', 'Close · Esc')}
</TooltipContent>
</Tooltip>
</div>
@@ -185,7 +189,7 @@ export function renderLinearItemDrawerSheet({
<div className="border-t border-border/40 px-4 py-4">
<div className="flex items-center gap-2 pb-3">
<span className="text-[13px] font-medium text-foreground">
{translate('auto.components.LinearItemDrawer.fde849b2b6', 'Comments')}
{t('auto.components.LinearItemDrawer.fde849b2b6', 'Comments')}
</span>
{comments.length > 0 && (
<span className="text-[12px] text-muted-foreground">{comments.length}</span>
@@ -197,7 +201,7 @@ export function renderLinearItemDrawerSheet({
</div>
) : comments.length === 0 ? (
<p className="text-[13px] text-muted-foreground">
{translate('auto.components.LinearItemDrawer.a4fcc57522', 'No comments yet.')}
{t('auto.components.LinearItemDrawer.a4fcc57522', 'No comments yet.')}
</p>
) : (
<div className="flex flex-col gap-3">
@@ -216,10 +220,10 @@ export function renderLinearItemDrawerSheet({
)}
<span className="text-[13px] font-semibold text-foreground">
{comment.user?.displayName ??
translate('auto.components.LinearItemDrawer.48e17e8cbd', 'Unknown')}
t('auto.components.LinearItemDrawer.48e17e8cbd', 'Unknown')}
</span>
<span className="text-[12px] text-muted-foreground">
· {formatRelativeTime(comment.createdAt)}
· {formatRelativeTime(comment.createdAt, intlLocale)}
</span>
</div>
<div className="px-3 py-2">
@@ -254,21 +258,18 @@ export function renderLinearItemDrawerSheet({
<Button
onClick={handleOpenOrUseIssue}
className="flex-1 justify-center gap-2"
aria-label={translate(
aria-label={t(
'auto.components.LinearItemDrawer.openAttachedWorkspace',
'Open workspace attached to issue'
)}
>
<FolderOpen className="size-4" />
{translate(
'auto.components.LinearItemDrawer.openWorkspace',
'Open workspace'
)}
{t('auto.components.LinearItemDrawer.openWorkspace', 'Open workspace')}
</Button>
<DropdownMenuTrigger asChild>
<Button
size="icon"
aria-label={translate(
aria-label={t(
'auto.components.LinearItemDrawer.moreWorkspaceActions',
'More issue workspace actions'
)}
@@ -280,7 +281,7 @@ export function renderLinearItemDrawerSheet({
<DropdownMenuContent align="end">
<DropdownMenuItem onSelect={() => onUse(displayed)}>
<Plus className="size-4" />
{translate(
{t(
'auto.components.LinearItemDrawer.startNewWorkspace',
'Start new workspace'
)}
@@ -291,15 +292,12 @@ export function renderLinearItemDrawerSheet({
<Button
onClick={handleOpenOrUseIssue}
className="w-full justify-center gap-2"
aria-label={translate(
aria-label={t(
'auto.components.LinearItemDrawer.04008e6c46',
'Start workspace from issue'
)}
>
{translate(
'auto.components.LinearItemDrawer.04008e6c46',
'Start workspace from issue'
)}
{t('auto.components.LinearItemDrawer.04008e6c46', 'Start workspace from issue')}
<ArrowRight className="size-4" />
</Button>
)}
@@ -1,7 +1,7 @@
import React from 'react'
import { cn } from '@/lib/utils'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
import { getLinearPriorityLabel } from '@/components/task-page/task-page-localized-options'
// Use Linear’s brand priority fills instead of generic Orca state colors.
@@ -34,6 +34,7 @@ export function LinearPriorityIcon({
className?: string
label?: string
}): React.JSX.Element {
const t = useTranslate()
if (priority === 1) {
return (
<span
@@ -46,7 +47,7 @@ export function LinearPriorityIcon({
>
<span aria-hidden="true">!</span>
<span className="sr-only">
{translate('auto.components.linear.priority.icon.priorityValue', 'Priority: {{label}}', {
{t('auto.components.linear.priority.icon.priorityValue', 'Priority: {{label}}', {
label
})}
</span>
@@ -65,7 +66,7 @@ export function LinearPriorityIcon({
className="size-3 rounded-full border border-muted-foreground/55"
/>
<span className="sr-only">
{translate('auto.components.linear.priority.icon.priorityValue', 'Priority: {{label}}', {
{t('auto.components.linear.priority.icon.priorityValue', 'Priority: {{label}}', {
label
})}
</span>
@@ -104,7 +105,7 @@ export function LinearPriorityIcon({
})}
</svg>
<span className="sr-only">
{translate('auto.components.linear.priority.icon.priorityValue', 'Priority: {{label}}', {
{t('auto.components.linear.priority.icon.priorityValue', 'Priority: {{label}}', {
label
})}
</span>
@@ -2,7 +2,7 @@ import React from 'react'
import { CalendarDays, FileText, FolderKanban, RefreshCw, UserRound } from 'lucide-react'
import { Progress } from '@/components/ui/progress'
import { translate } from '@/i18n/i18n'
import { useIntlLocale, useTranslate } from '@/i18n/use-translate'
import type {
LinearProjectDetail,
LinearProjectSummary
@@ -34,6 +34,8 @@ export function LinearProjectOverviewContent({
loading,
error
}: LinearProjectOverviewContentProps): React.JSX.Element {
const t = useTranslate()
const intlLocale = useIntlLocale()
const presentation = project as LinearProjectPresentation | null
const progress = presentation ? linearProjectProgressPercent(presentation) : null
const teams = linearProjectMetadataLabels(presentation?.teams, 4)
@@ -75,7 +77,7 @@ export function LinearProjectOverviewContent({
</p>
) : (
<p className="mt-3 text-sm text-muted-foreground">
{translate(
{t(
'auto.components.linear.project.view.surfaces.bb5664d456',
'No project description.'
)}
@@ -87,17 +89,14 @@ export function LinearProjectOverviewContent({
<section className="rounded-md border border-border/50 bg-muted/20 p-4">
<div className="mb-2 flex items-center justify-between text-sm">
<span className="font-medium text-foreground">
{translate(
'auto.components.linear.project.view.surfaces.563501f191',
'Progress'
)}
{t('auto.components.linear.project.view.surfaces.563501f191', 'Progress')}
</span>
<span className="text-muted-foreground">{progress}%</span>
</div>
<Progress value={Math.max(0, Math.min(100, progress))} />
{typeof presentation.scope === 'number' ? (
<div className="mt-2 text-xs text-muted-foreground">
{translate(
{t(
'auto.components.linear.project.view.surfaces.scopedIssueCount',
'{{count}} scoped issues',
{ count: presentation.scope, defaultValue_one: '{{count}} scoped issue' }
@@ -110,12 +109,12 @@ export function LinearProjectOverviewContent({
{milestones.length > 0 || resources.length > 0 || latestUpdate ? (
<section className="rounded-md border border-border/50 bg-muted/20 p-4">
<h3 className="text-sm font-medium text-foreground">
{translate('auto.components.linear.project.view.surfaces.5d99315fb8', 'Planning')}
{t('auto.components.linear.project.view.surfaces.5d99315fb8', 'Planning')}
</h3>
<div className="mt-3 grid gap-3 md:grid-cols-3">
<LinearProjectMetadataList
icon={<FolderKanban className="size-3.5" />}
label={translate(
label={t(
'auto.components.linear.project.view.surfaces.bb1405eff8',
'Milestones'
)}
@@ -123,7 +122,7 @@ export function LinearProjectOverviewContent({
/>
<LinearProjectMetadataList
icon={<FileText className="size-3.5" />}
label={translate(
label={t(
'auto.components.linear.project.view.surfaces.c8db98b73b',
'Resources'
)}
@@ -131,7 +130,7 @@ export function LinearProjectOverviewContent({
/>
<LinearProjectMetadataList
icon={<RefreshCw className="size-3.5" />}
label={translate(
label={t(
'auto.components.linear.project.view.surfaces.0a6a5a7dd6',
'Latest update'
)}
@@ -144,55 +143,53 @@ export function LinearProjectOverviewContent({
<aside className="min-w-0 space-y-3">
<LinearProjectPropertyRow
label={translate('auto.components.linear.project.view.surfaces.9ddb58edbd', 'Status')}
value={linearProjectUnknownText(presentation.status) ?? linearProjectBacklogLabel()}
label={t('auto.components.linear.project.view.surfaces.9ddb58edbd', 'Status')}
value={linearProjectUnknownText(presentation.status) ?? linearProjectBacklogLabel(t)}
/>
<LinearProjectPropertyRow
label={translate('auto.components.linear.project.view.surfaces.f5ef24cf46', 'Health')}
value={linearProjectUnknownText(presentation.health) ?? linearProjectNoneLabel()}
label={t('auto.components.linear.project.view.surfaces.f5ef24cf46', 'Health')}
value={linearProjectUnknownText(presentation.health) ?? linearProjectNoneLabel(t)}
/>
<LinearProjectPropertyRow
label={translate(
'auto.components.linear.project.view.surfaces.3be47aed6f',
'Priority'
label={t('auto.components.linear.project.view.surfaces.3be47aed6f', 'Priority')}
value={linearProjectPriorityLabel(
presentation.priority,
presentation.priorityLabel,
t
)}
value={linearProjectPriorityLabel(presentation.priority, presentation.priorityLabel)}
/>
<LinearProjectPropertyRow
label={translate('auto.components.linear.project.view.surfaces.111bef9aa8', 'Lead')}
label={t('auto.components.linear.project.view.surfaces.111bef9aa8', 'Lead')}
value={linearProjectUnknownText(presentation.lead) ?? 'Unassigned'}
icon={<UserRound className="size-3.5" />}
/>
<LinearProjectPropertyRow
label={translate('auto.components.linear.project.view.surfaces.3fb6473111', 'Start')}
value={linearProjectDateLabel(presentation.startDate)}
label={t('auto.components.linear.project.view.surfaces.3fb6473111', 'Start')}
value={linearProjectDateLabel(presentation.startDate, t, intlLocale)}
icon={<CalendarDays className="size-3.5" />}
/>
<LinearProjectPropertyRow
label={translate('auto.components.linear.project.view.surfaces.25a2196732', 'Target')}
value={linearProjectDateLabel(presentation.targetDate)}
label={t('auto.components.linear.project.view.surfaces.25a2196732', 'Target')}
value={linearProjectDateLabel(presentation.targetDate, t, intlLocale)}
icon={<CalendarDays className="size-3.5" />}
/>
<LinearProjectMetadataList
label={translate('auto.components.linear.project.view.surfaces.c5f79616c3', 'Teams')}
label={t('auto.components.linear.project.view.surfaces.c5f79616c3', 'Teams')}
items={teams}
/>
<LinearProjectMetadataList
label={translate(
'auto.components.linear.project.view.surfaces.65bda65159',
'Members'
)}
label={t('auto.components.linear.project.view.surfaces.65bda65159', 'Members')}
items={members}
/>
<LinearProjectMetadataList
label={translate('auto.components.linear.project.view.surfaces.1748d3b9af', 'Labels')}
label={t('auto.components.linear.project.view.surfaces.1748d3b9af', 'Labels')}
items={labels}
/>
</aside>
</div>
) : (
<div className="px-4 py-10 text-center text-sm text-muted-foreground">
{translate(
{t(
'auto.components.linear.project.view.surfaces.e1fa97d21d',
'Select a project to view its overview.'
)}
@@ -1,7 +1,7 @@
import React from 'react'
import { Badge } from '@/components/ui/badge'
import { translate } from '@/i18n/i18n'
import { useTranslate } from '@/i18n/use-translate'
export function LinearProjectPropertyRow({
label,
@@ -32,6 +32,7 @@ export function LinearProjectMetadataList({
label: string
items: string[]
}): React.JSX.Element {
const t = useTranslate()
return (
<div className="rounded-md border border-border/50 bg-muted/20 px-3 py-2">
<div className="flex items-center gap-1.5 text-[11px] uppercase tracking-[0.08em] text-muted-foreground">
@@ -48,7 +49,7 @@ export function LinearProjectMetadataList({
</div>
) : (
<div className="mt-1 text-sm text-muted-foreground">
{translate('auto.components.linear.project.view.surfaces.8bbecb2510', 'None')}
{t('auto.components.linear.project.view.surfaces.8bbecb2510', 'None')}
</div>
)}
</div>
@@ -1,4 +1,5 @@
import { getIntlLocale, translate } from '@/i18n/i18n'
import type { Translate } from '@/i18n/use-translate'
import type {
LinearProjectDetail,
LinearProjectSummary
@@ -34,31 +35,39 @@ export function linearProjectUnknownText(value: unknown): string | null {
return null
}
export function linearProjectDateLabel(value: string | null | undefined): string {
export function linearProjectDateLabel(
value: string | null | undefined,
t?: Translate,
intlLocale: string = getIntlLocale()
): string {
if (!value) {
return linearProjectNoneLabel()
return linearProjectNoneLabel(t)
}
const date = new Date(value)
return Number.isNaN(date.getTime()) ? value : date.toLocaleDateString(getIntlLocale())
return Number.isNaN(date.getTime()) ? value : date.toLocaleDateString(intlLocale)
}
export function linearProjectPriorityLabel(priority: unknown, fallback: unknown): string {
export function linearProjectPriorityLabel(
priority: unknown,
fallback: unknown,
t?: Translate
): string {
const fromFallback = linearProjectUnknownText(fallback)
if (fromFallback) {
return fromFallback
}
if (typeof priority === 'number') {
return priority === 0 ? linearProjectNoneLabel() : `P${priority}`
return priority === 0 ? linearProjectNoneLabel(t) : `P${priority}`
}
return linearProjectUnknownText(priority) ?? linearProjectNoneLabel()
return linearProjectUnknownText(priority) ?? linearProjectNoneLabel(t)
}
export function linearProjectNoneLabel(): string {
return translate('auto.components.linear.project.view.surfaces.8bbecb2510', 'None')
export function linearProjectNoneLabel(t: Translate = translate): string {
return t('auto.components.linear.project.view.surfaces.8bbecb2510', 'None')
}
export function linearProjectBacklogLabel(): string {
return translate('auto.components.linear.project.view.surfaces.backlog', 'Backlog')
export function linearProjectBacklogLabel(t: Translate = translate): string {
return t('auto.components.linear.project.view.surfaces.backlog', 'Backlog')
}
export function linearProjectProgressPercent(project: LinearProjectPresentation): number | null {
@@ -4,7 +4,7 @@ import { ArrowRight, ExternalLink } from 'lucide-react'
import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button'
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
import { translate } from '@/i18n/i18n'
import { useIntlLocale, useTranslate } from '@/i18n/use-translate'
import { cn } from '@/lib/utils'
import type { LinearProjectSummary } from '../../../shared/linear/project-types'
import {
@@ -48,7 +48,8 @@ function LinearProjectStatusBadge({
}: {
project: LinearProjectPresentation
}): React.JSX.Element {
const label = linearProjectUnknownText(project.status) ?? linearProjectBacklogLabel()
const t = useTranslate()
const label = linearProjectUnknownText(project.status) ?? linearProjectBacklogLabel(t)
return (
<Badge variant="outline" className="max-w-full truncate text-[11px] font-medium">
{label}
@@ -79,29 +80,27 @@ function LinearProjectTableSkeleton(): React.JSX.Element {
}
function LinearProjectTableEmpty({ hasError }: { hasError?: boolean }): React.JSX.Element {
const t = useTranslate()
return (
<div className="px-4 py-10 text-center">
<p className="text-sm font-medium text-foreground">
{hasError
? translate(
? t(
'auto.components.linear.project.view.surfaces.c9b6e9f90d',
'Unable to load Linear projects'
)
: translate(
: t(
'auto.components.linear.project.view.surfaces.a2f31c4cd6',
'No Linear projects found'
)}
</p>
<p className="mt-2 text-sm text-muted-foreground">
{hasError
? translate(
? t(
'auto.components.linear.project.view.surfaces.f4c79cff5f',
'Review the workspace error below, then refresh.'
)
: translate(
'auto.components.linear.project.view.surfaces.30402d2c6e',
'Try search or refresh.'
)}
: t('auto.components.linear.project.view.surfaces.30402d2c6e', 'Try search or refresh.')}
</p>
</div>
)
@@ -117,6 +116,8 @@ export function LinearProjectTableContent({
onOpenProject,
onUseProjectIssues
}: LinearProjectTableContentProps): React.JSX.Element {
const t = useTranslate()
const intlLocale = useIntlLocale()
if (loading && projects.length === 0) {
return <LinearProjectTableSkeleton />
}
@@ -175,17 +176,17 @@ export function LinearProjectTableContent({
</div>
<span className="truncate text-[12px] text-muted-foreground">
{linearProjectUnknownText(presentation.health) ??
translate('auto.components.linear.project.view.surfaces.8bbecb2510', 'None')}
t('auto.components.linear.project.view.surfaces.8bbecb2510', 'None')}
</span>
<span className="truncate text-[12px] text-muted-foreground">
{linearProjectPriorityLabel(presentation.priority, presentation.priorityLabel)}
{linearProjectPriorityLabel(presentation.priority, presentation.priorityLabel, t)}
</span>
<span className="truncate text-[12px] text-muted-foreground">
{linearProjectUnknownText(presentation.lead) ??
translate('auto.components.linear.project.view.surfaces.df4bd63c1d', 'Unassigned')}
t('auto.components.linear.project.view.surfaces.df4bd63c1d', 'Unassigned')}
</span>
<span className="truncate text-[12px] text-muted-foreground">
{linearProjectDateLabel(project.targetDate)}
{linearProjectDateLabel(project.targetDate, t, intlLocale)}
</span>
<span className="text-[12px] text-muted-foreground">
{typeof project.issueCount === 'number'
@@ -207,7 +208,7 @@ export function LinearProjectTableContent({
event.stopPropagation()
onUseProjectIssues(project)
}}
aria-label={translate(
aria-label={t(
'auto.components.linear.project.view.surfaces.7616c986c6',
'Open {{value0}} issues',
{ value0: project.name }
@@ -217,7 +218,7 @@ export function LinearProjectTableContent({
</Button>
</TooltipTrigger>
<TooltipContent side="bottom" sideOffset={6}>
{translate('auto.components.linear.project.view.surfaces.ee3d2caabd', 'Issues')}
{t('auto.components.linear.project.view.surfaces.ee3d2caabd', 'Issues')}
</TooltipContent>
</Tooltip>
) : null}
@@ -230,7 +231,7 @@ export function LinearProjectTableContent({
event.stopPropagation()
onOpenProject(project)
}}
aria-label={translate(
aria-label={t(
'auto.components.linear.project.view.surfaces.openInLinear',
'Open {{value0}} in Linear',
{ value0: project.name }
@@ -240,10 +241,7 @@ export function LinearProjectTableContent({
</Button>
</TooltipTrigger>
<TooltipContent side="bottom" sideOffset={6}>
{translate(
'auto.components.linear.project.view.surfaces.aac9a4afc6',
'Open in Linear'
)}
{t('auto.components.linear.project.view.surfaces.aac9a4afc6', 'Open in Linear')}
</TooltipContent>
</Tooltip>
</div>
@@ -6,6 +6,7 @@ import { ArrowLeft, ArrowRight, ExternalLink, Layers3, LoaderCircle, RefreshCw }
import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button'
import { translate } from '@/i18n/i18n'
import { useTranslate, type Translate } from '@/i18n/use-translate'
import { cn } from '@/lib/utils'
import type {
LinearProjectDetail,
@@ -35,10 +36,14 @@ type LinearProjectOverviewProps = {
type LinearCollectionKind = 'views' | 'projects' | 'projectIssues' | 'viewIssues' | 'issues'
function linearCollectionTruncatedText(kind: LinearCollectionKind, count: number): string {
function linearCollectionTruncatedText(
kind: LinearCollectionKind,
count: number,
t: Translate = translate
): string {
switch (kind) {
case 'views':
return translate(
return t(
'taskProviders.linear.truncated.views',
'Showing the first {{count}} views. Search or open Linear for the full set.',
{
@@ -48,7 +53,7 @@ function linearCollectionTruncatedText(kind: LinearCollectionKind, count: number
}
)
case 'projects':
return translate(
return t(
'taskProviders.linear.truncated.projects',
'Showing the first {{count}} projects. Search or open Linear for the full set.',
{
@@ -58,7 +63,7 @@ function linearCollectionTruncatedText(kind: LinearCollectionKind, count: number
}
)
case 'projectIssues':
return translate(
return t(
'taskProviders.linear.truncated.projectIssues',
'Showing the first {{count}} project issues. Search or open Linear for the full set.',
{
@@ -68,7 +73,7 @@ function linearCollectionTruncatedText(kind: LinearCollectionKind, count: number
}
)
case 'viewIssues':
return translate(
return t(
'taskProviders.linear.truncated.viewIssues',
'Showing the first {{count}} view issues. Search or open Linear for the full set.',
{
@@ -78,7 +83,7 @@ function linearCollectionTruncatedText(kind: LinearCollectionKind, count: number
}
)
case 'issues':
return translate(
return t(
'taskProviders.linear.truncated.issues',
'Showing the first {{count}} issues. Search or open Linear for the full set.',
{
@@ -109,6 +114,7 @@ export function LinearCollectionNotice({
loading = false,
loadMoreLabel = 'Load more'
}: LinearCollectionNoticeProps): React.JSX.Element | null {
const t = useTranslate()
if (!hasMore && (!errors || errors.length === 0)) {
return null
}
@@ -120,19 +126,21 @@ export function LinearCollectionNotice({
{errors.map((error) => (
<Badge key={`${error.workspaceId}-${error.type}`} variant="outline">
{error.workspaceName ?? error.workspaceId}:{' '}
{isIntegrationCredentialDecryptionError(taskProviderErrorText(error.message))
? translate(
{isIntegrationCredentialDecryptionError(
taskProviderErrorText(error.message, undefined, t)
)
? t(
'auto.components.linear.project.view.surfaces.linearLoginUnreadable',
'Unable to read saved Linear login. Reconnect it in Settings.'
)
: taskProviderErrorText(linearIssueReadError(error.message))}
: taskProviderErrorText(linearIssueReadError(error.message, t), undefined, t)}
</Badge>
))}
</div>
) : null}
{hasMore ? (
<div className="flex flex-wrap items-center justify-center gap-2 px-4 py-3">
{onLoadMore ? null : <span>{linearCollectionTruncatedText(kind, count)}</span>}
{onLoadMore ? null : <span>{linearCollectionTruncatedText(kind, count, t)}</span>}
{onLoadMore ? (
<Button
type="button"
@@ -145,7 +153,7 @@ export function LinearCollectionNotice({
{loading ? (
<>
<LoaderCircle className="size-3.5 animate-spin" />
{translate('auto.components.linear.project.view.surfaces.93e1f6bfca', 'Loading')}
{t('auto.components.linear.project.view.surfaces.93e1f6bfca', 'Loading')}
</>
) : (
<>
@@ -178,6 +186,7 @@ export function LinearProjectOverview({
onRefresh,
onOpenIssues
}: LinearProjectOverviewProps): React.JSX.Element {
const t = useTranslate()
return (
<div className="flex min-h-0 flex-1 flex-col">
<div className="flex h-10 flex-none items-center justify-between gap-3 border-b border-border/50 bg-muted/35 px-3">
@@ -186,7 +195,7 @@ export function LinearProjectOverview({
variant="ghost"
size="icon-xs"
onClick={onBack}
aria-label={translate(
aria-label={t(
'auto.components.linear.project.view.surfaces.5f79bc76b0',
'Back to projects'
)}
@@ -196,19 +205,16 @@ export function LinearProjectOverview({
<div className="min-w-0">
<div className="truncate text-[13px] font-medium text-foreground">
{project?.name ??
translate('auto.components.linear.project.view.surfaces.85607ff793', 'Project')}
t('auto.components.linear.project.view.surfaces.85607ff793', 'Project')}
</div>
<div className="truncate text-[11px] text-muted-foreground">
{project?.workspaceName
? translate(
? t(
'auto.components.linear.project.view.surfaces.906b5e4cb8',
'Linear / Projects / {{value0}}',
{ value0: project.workspaceName }
)
: translate(
'auto.components.linear.project.view.surfaces.f2cc1e0ff6',
'Linear / Projects'
)}
: t('auto.components.linear.project.view.surfaces.f2cc1e0ff6', 'Linear / Projects')}
</div>
</div>
</div>
@@ -221,7 +227,7 @@ export function LinearProjectOverview({
className="gap-1 border-border/50 bg-background/70"
>
<Layers3 className="size-3.5" />
{translate('auto.components.linear.project.view.surfaces.ee3d2caabd', 'Issues')}
{t('auto.components.linear.project.view.surfaces.ee3d2caabd', 'Issues')}
</Button>
) : null}
<Button
@@ -232,7 +238,7 @@ export function LinearProjectOverview({
className="gap-1 border-border/50 bg-background/70"
>
<RefreshCw className={cn('size-3.5', loading && 'animate-spin')} />
{translate('auto.components.linear.project.view.surfaces.a9785c7158', 'Refresh')}
{t('auto.components.linear.project.view.surfaces.a9785c7158', 'Refresh')}
</Button>
{project ? (
<Button
@@ -242,7 +248,7 @@ export function LinearProjectOverview({
className="gap-1 border-border/50 bg-background/70"
>
<ExternalLink className="size-3.5" />
{translate('auto.components.linear.project.view.surfaces.7b147907dc', 'Linear')}
{t('auto.components.linear.project.view.surfaces.7b147907dc', 'Linear')}
</Button>
) : null}
</div>
@@ -11,6 +11,7 @@ import { Button } from '@/components/ui/button'
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'
import { cn } from '@/lib/utils'
import { translate } from '@/i18n/i18n'
import { useTranslate, type Translate } from '@/i18n/use-translate'
type LinearScopeSelectorProps = {
workspaces: LinearWorkspace[]
@@ -102,7 +103,8 @@ export function normalizeLinearScopeTeamSelection({
function summarizeTeamKeys(
teams: LinearTeam[],
selectedTeamIds: ReadonlySet<string>,
options: { activeAllWorkspaces: boolean; multipleWorkspaces: boolean }
options: { activeAllWorkspaces: boolean; multipleWorkspaces: boolean },
t: Translate = translate
): string {
const selectedTeams = teams.filter((team) => selectedTeamIds.has(team.id))
@@ -111,7 +113,7 @@ function summarizeTeamKeys(
const keys = selectedTeams.map((team) => team.key)
const keyCount = new Set(keys).size
if (workspaceIds.size > 1 || keyCount < keys.length) {
return translate('auto.components.linear.scope.selector.teamCount', '{{count}} teams', {
return t('auto.components.linear.scope.selector.teamCount', '{{count}} teams', {
count: selectedTeams.length,
defaultValue_one: '{{count}} team'
})
@@ -123,13 +125,16 @@ function summarizeTeamKeys(
return `${labels.join(', ')}${rest.length > 0 ? ` +${rest.length}` : ''}`
}
export function getLinearScopeTriggerLabel({
workspaces,
selectedWorkspaceId,
teams,
selectedTeamIds,
teamSelectionIsStickyAll
}: LinearScopeLabelInput): string {
export function getLinearScopeTriggerLabel(
{
workspaces,
selectedWorkspaceId,
teams,
selectedTeamIds,
teamSelectionIsStickyAll
}: LinearScopeLabelInput,
t: Translate = translate
): string {
const multipleWorkspaces = workspaces.length > 1
const activeAllWorkspaces = selectedWorkspaceId === 'all'
const selectedWorkspace =
@@ -143,17 +148,14 @@ export function getLinearScopeTriggerLabel({
allVisibleTeamsSelected ||
!teams.some((team) => selectedTeamIds.has(team.id))
const teamLabel = allTeams
? translate('auto.components.linear.scope.selector.7783361266', 'All teams')
: summarizeTeamKeys(teams, selectedTeamIds, { activeAllWorkspaces, multipleWorkspaces })
? t('auto.components.linear.scope.selector.7783361266', 'All teams')
: summarizeTeamKeys(teams, selectedTeamIds, { activeAllWorkspaces, multipleWorkspaces }, t)
if (!multipleWorkspaces) {
return teamLabel
}
if (activeAllWorkspaces) {
const allWorkspaces = translate(
'auto.components.linear.scope.selector.a14ce4df2b',
'All workspaces'
)
const allWorkspaces = t('auto.components.linear.scope.selector.a14ce4df2b', 'All workspaces')
return allTeams ? allWorkspaces : `${allWorkspaces} / ${teamLabel}`
}
return `${selectedWorkspace?.organizationName ?? 'Linear'} / ${teamLabel}`
@@ -171,6 +173,7 @@ export function LinearScopeSelector({
onOpen,
className
}: LinearScopeSelectorProps): React.JSX.Element {
const t = useTranslate()
const [open, setOpen] = useState(false)
const [query, setQuery] = useState('')
const [commandValue, setCommandValue] = useState('')
@@ -178,13 +181,16 @@ export function LinearScopeSelector({
() => new Map(workspaces.map((workspace) => [workspace.id, workspace])),
[workspaces]
)
const triggerLabel = getLinearScopeTriggerLabel({
workspaces,
selectedWorkspaceId,
teams,
selectedTeamIds,
teamSelectionIsStickyAll
})
const triggerLabel = getLinearScopeTriggerLabel(
{
workspaces,
selectedWorkspaceId,
teams,
selectedTeamIds,
teamSelectionIsStickyAll
},
t
)
const showWorkspaceNames = selectedWorkspaceId === 'all' || workspaces.length > 1
const allTeamsSelected = teams.length > 0 && teams.every((team) => selectedTeamIds.has(team.id))
const filteredTeams = useMemo(
@@ -261,10 +267,7 @@ export function LinearScopeSelector({
<Command shouldFilter={false} value={commandValue} onValueChange={setCommandValue}>
<CommandInput
autoFocus
placeholder={translate(
'auto.components.linear.scope.selector.89f6580dbf',
'Search teams...'
)}
placeholder={t('auto.components.linear.scope.selector.89f6580dbf', 'Search teams...')}
value={query}
onValueChange={setQuery}
className="text-xs"
@@ -273,7 +276,7 @@ export function LinearScopeSelector({
{workspaces.length > 1 ? (
<div className="border-b border-border py-1">
<div className="px-3 pb-1 pt-1 text-[11px] font-medium uppercase text-muted-foreground">
{translate('auto.components.linear.scope.selector.05baa5ae90', 'Workspace')}
{t('auto.components.linear.scope.selector.05baa5ae90', 'Workspace')}
</div>
<CommandItem
value="workspace:all"
@@ -290,10 +293,7 @@ export function LinearScopeSelector({
)}
/>
<span>
{translate(
'auto.components.linear.scope.selector.a14ce4df2b',
'All workspaces'
)}
{t('auto.components.linear.scope.selector.a14ce4df2b', 'All workspaces')}
</span>
</CommandItem>
{workspaces.map((workspace) => (
@@ -319,7 +319,7 @@ export function LinearScopeSelector({
) : null}
<div className="border-b border-border py-1">
<div className="px-3 pb-1 pt-1 text-[11px] font-medium uppercase text-muted-foreground">
{translate('auto.components.linear.scope.selector.e1ae6bebb0', 'Teams')}
{t('auto.components.linear.scope.selector.e1ae6bebb0', 'Teams')}
</div>
<CommandItem
value="teams:all"
@@ -332,9 +332,7 @@ export function LinearScopeSelector({
allTeamsSelected || teamSelectionIsStickyAll ? 'opacity-70' : 'opacity-0'
)}
/>
<span>
{translate('auto.components.linear.scope.selector.7783361266', 'All teams')}
</span>
<span>{t('auto.components.linear.scope.selector.7783361266', 'All teams')}</span>
</CommandItem>
</div>
{filteredTeams.length > 0 ? (
@@ -375,11 +373,11 @@ export function LinearScopeSelector({
) : (
<div className="px-3 py-5 text-xs leading-relaxed text-muted-foreground">
{query.trim()
? translate(
? t(
'auto.components.linear.scope.selector.405b33c378',
'No fetched teams match your search.'
)
: translate(
: t(
'auto.components.linear.scope.selector.b3488fad3c',
'No teams were fetched. Access can depend on key scope, private-team membership, archived teams, permissions, or a fetch failure.'
)}
@@ -397,9 +395,7 @@ export function LinearScopeSelector({
className="flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs text-foreground transition hover:bg-accent hover:text-accent-foreground"
>
<KeyRound className="size-3.5 text-muted-foreground" />
<span>
{translate('auto.components.linear.scope.selector.91c8871dad', 'Add team access')}
</span>
<span>{t('auto.components.linear.scope.selector.91c8871dad', 'Add team access')}</span>
</button>
</div>
</PopoverContent>

Some files were not shown because too many files have changed in this diff Show More