Skip to content

an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions

feat(i18n): land the Arabic UI half of PR #213, gated on the chosen language

chaitanyagiri6f7ffb89886f
diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx
index e23f30ff..d2dbb7e0 100644
--- a/src/renderer/src/App.tsx
+++ b/src/renderer/src/App.tsx
@@ -7,6 +7,8 @@ import { OfficeFloor } from '@/scene/office/OfficeFloor';
import { useHive } from '@/hooks/useHive';
import { useResolvedGodName } from '@/hooks/useResolvedGodName';
import { useGodNameSync } from '@/i18n/useGodNameSync';
+import { useDirectionSync } from '@/i18n/useDirection';
+import { useArabicTerminalSync } from '@/terminal/useArabicTerminalSync';
import { MemoryPanel } from '@/components/MemoryPanel';
import { AgentDetailPanel } from '@/components/AgentDetailPanel';
import { AgentStrip } from '@/components/AgentStrip';
@@ -37,6 +39,10 @@ declare const __APP_VERSION__: string;
export function App() {
// Point every {{godName}} string at the orchestrator's real, renameable name.
useGodNameSync();
+ // Mirror the document only for a user who has picked an RTL app language.
+ useDirectionSync();
+ // Let terminals that are ALREADY open follow a language switch too.
+ useArabicTerminalSync();
const agent = useStore(selectedAgent);
const agents = useStore(s => s.agents);
const agentCount = agents.length;
diff --git a/src/renderer/src/components/AddAgentModal.tsx b/src/renderer/src/components/AddAgentModal.tsx
index 8bd5fc8d..7545c66e 100644
--- a/src/renderer/src/components/AddAgentModal.tsx
+++ b/src/renderer/src/components/AddAgentModal.tsx
@@ -29,6 +29,7 @@ import {
providerPreset,
isClaudeProvider
} from '@/store/config';
+import { useRtl } from '@/i18n/useDirection';
const ACCENTS: AccentColorName[] = ['coral', 'mint', 'sky', 'lemon', 'lilac', 'peach'];
@@ -143,6 +144,7 @@ export interface AddAgentModalProps {
export function AddAgentModal({ onClose, config, onConfigChange }: AddAgentModalProps) {
const { t: tr } = useTranslation();
+ const rtl = useRtl();
const addAgent = useStore(s => s.addAgent);
// Deep links and file batches share one FIFO. The head alone seeds the form;
// every item still requires an explicit spawn or skip.
@@ -1062,6 +1064,7 @@ export function AddAgentModal({ onClose, config, onConfigChange }: AddAgentModal
<Row label={tr('addAgent.goal')}>
<textarea
+ dir={rtl ? 'auto' : undefined}
value={goal}
onChange={(e) => setGoal(e.target.value)}
placeholder={tr('addAgent.goalPlaceholder')}
diff --git a/src/renderer/src/components/AgentStrip.tsx b/src/renderer/src/components/AgentStrip.tsx
index 7a7fcc48..2f84a6b1 100644
--- a/src/renderer/src/components/AgentStrip.tsx
+++ b/src/renderer/src/components/AgentStrip.tsx
@@ -6,6 +6,7 @@ import { Icon } from './Icon';
import { useStore, type Agent } from '@/store/store';
import { type HarnessConfig } from '@/store/config';
import { useRestoreTeam } from '@/hooks/useRestoreTeam';
+import { useRtl } from '@/i18n/useDirection';
export interface AgentStripProps {
/** Needed to rebuild a spawn command when a restorable agent predates the
@@ -15,6 +16,7 @@ export interface AgentStripProps {
export function AgentStrip({ config }: AgentStripProps) {
const { t } = useTranslation();
+ const rtl = useRtl();
const agents = useStore(s => s.agents);
const restorableAgents = useStore(s => s.restorableAgents);
const selectedId = useStore(s => s.selectedId);
@@ -203,6 +205,7 @@ export function AgentStrip({ config }: AgentStripProps) {
line per bullet) and the fullscreen roster renders every
line — an <input> would silently eat the newlines. */}
<textarea
+ dir={rtl ? 'auto' : undefined}
autoFocus
rows={3}
value={a.note ?? ''}
diff --git a/src/renderer/src/components/AskMeTab.tsx b/src/renderer/src/components/AskMeTab.tsx
index 4a6623c3..8660c57b 100644
--- a/src/renderer/src/components/AskMeTab.tsx
+++ b/src/renderer/src/components/AskMeTab.tsx
@@ -7,6 +7,7 @@ import { MarkdownPreview } from '@/markdown/MarkdownPreview';
import { type HiveTask, type HumanQA, openQuestion, waitsOnHuman } from './TasksKanban';
import { compareByNewestAsk } from './askMeOrder';
import { isComposingKey } from '@shared/imeGuard';
+import { useRtl } from '@/i18n/useDirection';
/**
* ASK ME — first-class human feedback through the task system.
@@ -45,6 +46,7 @@ function dependentsTree(id: string, all: HiveTask[], seen = new Set<string>()):
export function AskMeTab() {
const { t: translate } = useTranslation();
+ const rtl = useRtl();
const agents = useStore((s) => s.agents);
const restorable = useStore((s) => s.restorableAgents);
const [tasks, setTasks] = useState<HiveTask[]>([]);
@@ -224,12 +226,13 @@ export function AskMeTab() {
and backticks were on screen literally. The card variant keeps
this card's mono face and turns a single newline into a break, so
a question with no markdown in it looks exactly as it did. */}
- <div style={{ fontSize: 15, lineHeight: '19px', color: 'var(--cth-ink-900)' }}>
+ <div dir={rtl ? 'auto' : undefined} style={{ fontSize: 15, lineHeight: '19px', color: 'var(--cth-ink-900)' }}>
<MarkdownPreview source={open.q} variant="card" />
</div>
{/* answer box */}
<textarea
+ dir={rtl ? 'auto' : undefined}
value={drafts[t.id] ?? ''}
onChange={(e) => setAnswerDraft(t.id, e.target.value)}
onKeyDown={(e) => { if (isComposingKey(e)) return; if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) void sendAnswer(t); }}
diff --git a/src/renderer/src/components/CommandCenterPanel.tsx b/src/renderer/src/components/CommandCenterPanel.tsx
index 78eb3c3a..cce39d20 100644
--- a/src/renderer/src/components/CommandCenterPanel.tsx
+++ b/src/renderer/src/components/CommandCenterPanel.tsx
@@ -36,6 +36,7 @@ import {
} from '@/store/config';
import { canReceiveInbox } from '@shared/agentProvider';
import { isComposingKey } from '@shared/imeGuard';
+import { useRtl } from '@/i18n/useDirection';
/** Michael's control surface. Shown instead of the plain terminal/files panel
* when the god agent is selected: terminal + queue, the floor roster (with
@@ -344,6 +345,7 @@ export function CommandCenterPanel({ agent, fullscreen = false }: { agent: Agent
function FloorTab({ seed }: { seed: { text: string; seq: number } }) {
const { t } = useTranslation();
+ const rtl = useRtl();
const agents = useStore((s) => s.agents);
const godName = agents.find((a) => a.isGod)?.name ?? 'the orchestrator';
const select = useStore((s) => s.select);
@@ -649,6 +651,7 @@ function FloorTab({ seed }: { seed: { text: string; seq: number } }) {
</Select>
</div>
<textarea
+ dir={rtl ? 'auto' : undefined}
value={dispatchText}
onChange={(e) => setDispatchText(e.target.value)}
rows={2}
@@ -1312,13 +1315,14 @@ function Muted({ children }: { children: React.ReactNode }) {
}
function Pre({ children }: { children: React.ReactNode }) {
+ const rtl = useRtl();
return (
<pre style={{
margin: '6px 0 0', padding: 8, maxHeight: 200, overflow: 'auto',
background: 'var(--cth-paper-100)', boxShadow: 'inset 0 0 0 1px var(--cth-ink-300)',
fontFamily: 'var(--cth-font-mono)', fontSize: 12, lineHeight: '16px',
color: 'var(--cth-ink-900)', whiteSpace: 'pre-wrap', wordBreak: 'break-word'
- }}>{children}</pre>
+ }} dir={rtl ? 'auto' : undefined}>{children}</pre>
);
}
diff --git a/src/renderer/src/components/FullscreenTerminal.tsx b/src/renderer/src/components/FullscreenTerminal.tsx
index 6a6c5e3b..5c1c4fd2 100644
--- a/src/renderer/src/components/FullscreenTerminal.tsx
+++ b/src/renderer/src/components/FullscreenTerminal.tsx
@@ -21,6 +21,7 @@ import { useTerminalFontSize } from './terminalFontSize';
import { useHasTerminalDraft, disposeTerminal, reflowTerminal, notifyThemeChangeAll } from './terminalPool';
import { useAppTheme, toggleAppTheme } from '@/design/theme';
import type { HarnessConfig } from '@/store/config';
+import { useRtl } from '@/i18n/useDirection';
/** Roster rail width. A fixed 232px is right on a 14" laptop but reads as a
* sliver on a 27" display, where names truncate for no reason — so it tracks
@@ -665,6 +666,7 @@ function SidebarRow({
scale: ReturnType<typeof rosterScale>;
}) {
const { t } = useTranslation();
+ const rtl = useRtl();
const buttonRef = useRef<HTMLButtonElement>(null);
const noteRef = useRef<HTMLDivElement>(null);
const [notePosition, setNotePosition] = useState<{ left: number; top: number } | null>(null);
@@ -876,6 +878,7 @@ function SidebarRow({
to make a new line rather than doing nothing. autoFocus is safe
now that opening is an explicit click, not a pointer fly-by. */}
<textarea
+ dir={rtl ? 'auto' : undefined}
autoFocus
value={agent.note ?? ''}
onChange={(e) => onNoteChange(e.target.value)}
diff --git a/src/renderer/src/components/MemoryPanel.tsx b/src/renderer/src/components/MemoryPanel.tsx
index 1a572e82..11598acc 100644
--- a/src/renderer/src/components/MemoryPanel.tsx
+++ b/src/renderer/src/components/MemoryPanel.tsx
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';
import { PixelPanel } from './PixelPanel';
import { PixelButton } from './PixelButton';
import { isComposingKey } from '@shared/imeGuard';
+import { useRtl } from '@/i18n/useDirection';
interface MemoryStatus {
available: boolean;
@@ -30,6 +31,7 @@ const MODELS: { id: ModelId; titleKey: string; detailKey: string }[] = [
*/
export function MemoryPanel() {
const { t } = useTranslation();
+ const rtl = useRtl();
const [open, setOpen] = useState(false);
const [status, setStatus] = useState<MemoryStatus | null>(null);
const [query, setQuery] = useState('');
@@ -222,7 +224,7 @@ export function MemoryPanel() {
boxShadow: 'inset 0 0 0 1px var(--cth-ink-100)',
padding: 8, fontFamily: 'var(--cth-font-mono)', fontSize: 12,
whiteSpace: 'pre-wrap', color: 'var(--cth-ink-900)'
- }}>{result}</pre>
+ }} dir={rtl ? 'auto' : undefined}>{result}</pre>
)}
</div>
)}
diff --git a/src/renderer/src/components/MessageQueueComposer.tsx b/src/renderer/src/components/MessageQueueComposer.tsx
index fd5dfff8..613ae3b7 100644
--- a/src/renderer/src/components/MessageQueueComposer.tsx
+++ b/src/renderer/src/components/MessageQueueComposer.tsx
@@ -9,6 +9,7 @@ import type { TerminalAutomationBlock } from './terminalAutomation';
import { freeflowRecorder, useFreeflow } from '@/freeflow/recorder';
import { useTerminalFontSize } from './terminalFontSize';
import { isComposingKey } from '@shared/imeGuard';
+import { useRtl } from '@/i18n/useDirection';
const EMPTY_QUEUE: QueuedMessage[] = [];
@@ -31,6 +32,7 @@ export interface MessageQueueComposerProps {
*/
export function MessageQueueComposer({ agent }: MessageQueueComposerProps) {
const { t } = useTranslation();
+ const rtl = useRtl();
const queue = useStore((s) => s.messageQueues[agent.id]) ?? EMPTY_QUEUE;
const enqueueMessage = useStore((s) => s.enqueueMessage);
const removeQueuedMessage = useStore((s) => s.removeQueuedMessage);
@@ -335,6 +337,7 @@ export function MessageQueueComposer({ agent }: MessageQueueComposerProps) {
with file/image attachment chips + paste-to-attach (rich-composer). */}
<div style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
<textarea
+ dir={rtl ? 'auto' : undefined}
className="cth-input"
value={text}
onChange={(e) => setText(e.target.value)}
@@ -438,6 +441,7 @@ function QueuedMessageRow(
}
) {
const { t } = useTranslation();
+ const rtl = useRtl();
const [expanded, setExpanded] = useState(false);
const [clipped, setClipped] = useState(false);
const bodyRef = useRef<HTMLDivElement>(null);
@@ -472,6 +476,7 @@ function QueuedMessageRow(
<div style={{ flex: 1, minWidth: 0, display: 'flex', flexDirection: 'column', gap: 2 }}>
<div
ref={bodyRef}
+ dir={rtl ? 'auto' : undefined}
title={expanded ? undefined : message.text}
style={{
fontSize: 12, lineHeight: '18px',
diff --git a/src/renderer/src/components/SettingsModal.tsx b/src/renderer/src/components/SettingsModal.tsx
index 792ba474..b49dbab0 100644
--- a/src/renderer/src/components/SettingsModal.tsx
+++ b/src/renderer/src/components/SettingsModal.tsx
@@ -24,7 +24,12 @@ import { AiEnginesSettings } from './AiEnginesSettings';
import { REALTIME_MODEL } from '@shared/realtimePricing';
import { RealtimeDevicePicker } from '@/realtime/DevicePicker';
import { CostHud } from '@/realtime/CostHud';
-import { isArabicTerminalEnabled, setArabicTerminalEnabled } from '@/terminal/arabicSetting';
+import {
+ isArabicTerminalEnabled,
+ isArabicTerminalFollowingLanguage,
+ setArabicTerminalEnabled
+} from '@/terminal/arabicSetting';
+import { notifyArabicTerminalChangeAll } from '@/components/terminalPool';
import { isComposingKey } from '@shared/imeGuard';
import { LANGUAGES, setLanguage } from '@/i18n';
@@ -261,6 +266,15 @@ export function SettingsModal({ config, onClose, initialSection }: SettingsModal
// Renderer-local, not part of HarnessConfig — it only changes how this window
// paints pty output. Read once; the setter keeps localStorage in step.
const [arabicTerminal, setArabicTerminal] = useState(isArabicTerminalEnabled);
+ // Whether that value is the language's default or a choice the user made.
+ // Shown as a note rather than a second control: the toggle already IS the
+ // override, so the only thing missing is telling them which one they are
+ // looking at. Re-read on every language change, because the default moves.
+ const [arabicFollowsLanguage, setArabicFollowsLanguage] = useState(isArabicTerminalFollowingLanguage);
+ useEffect(() => {
+ setArabicTerminal(isArabicTerminalEnabled());
+ setArabicFollowsLanguage(isArabicTerminalFollowingLanguage());
+ }, [i18n.language]);
const toggleSimpleMode = async () => {
const next = !simpleMode;
setSimpleMode(next);
@@ -1026,11 +1040,24 @@ export function SettingsModal({ config, onClose, initialSection }: SettingsModal
<span style={{ fontSize: 12, lineHeight: '16px', color: 'var(--cth-ink-500)' }}>
{t('settings.general.arabicTerminalDesc')}
</span>
+ {arabicFollowsLanguage && (
+ <span style={{ fontSize: 12, lineHeight: '16px', color: 'var(--cth-ink-500)' }}>
+ {t('settings.general.arabicTerminalFollowsLanguage')}
+ </span>
+ )}
</div>
<PixelButton
variant={arabicTerminal ? 'primary' : 'secondary'}
size="sm"
- onClick={() => { const next = !arabicTerminal; setArabicTerminalEnabled(next); setArabicTerminal(next); }}
+ onClick={() => {
+ const next = !arabicTerminal;
+ setArabicTerminalEnabled(next);
+ setArabicTerminal(next);
+ setArabicFollowsLanguage(false);
+ // Reach the terminals that are already open, the
+ // same way a language switch does.
+ notifyArabicTerminalChangeAll();
+ }}
>
{arabicTerminal ? t('common.on') : t('common.off')}
</PixelButton>
diff --git a/src/renderer/src/components/TasksKanban.tsx b/src/renderer/src/components/TasksKanban.tsx
index eeafa030..ee964a95 100644
--- a/src/renderer/src/components/TasksKanban.tsx
+++ b/src/renderer/src/components/TasksKanban.tsx
@@ -6,6 +6,7 @@ import { PixelBadge } from './PixelBadge';
import { Icon } from './Icon';
import { useStore } from '@/store/store';
import { MarkdownPreview } from '@/markdown/MarkdownPreview';
+import { useRtl } from '@/i18n/useDirection';
/** A card on the task kanban. Mirrors HiveTask in the main/preload process —
* re-declared locally so the renderer doesn't reach into the preload package
@@ -303,6 +304,7 @@ export function TaskDetail({ task, all, assigneeName, onMove, onAssign, onClose
onClose: () => void;
}) {
const { t } = useTranslation();
+ const rtl = useRtl();
const col = COLUMNS.find((c) => c.key === task.status) ?? COLUMNS[0];
// Belt + suspenders: parseTasks normalizes these, but the ledger is a
// hand-written file — never trust a card's shape at the point of use.
@@ -350,7 +352,7 @@ export function TaskDetail({ task, all, assigneeName, onMove, onAssign, onClose
boxShadow: 'inset 0 0 0 1px var(--cth-ink-300)',
fontFamily: 'var(--cth-font-mono)', fontSize: 12, lineHeight: '18px',
color: 'var(--cth-ink-900)', whiteSpace: 'pre-wrap', wordBreak: 'break-word'
- }}>
+ }} dir={rtl ? 'auto' : undefined}>
{task.description?.trim() || <span style={{ color: 'var(--cth-ink-300)' }}>{t('kanban.noDescription')}</span>}
</div>
diff --git a/src/renderer/src/components/ThreadsPanel.tsx b/src/renderer/src/components/ThreadsPanel.tsx
index d16cb9aa..78bf0db4 100644
--- a/src/renderer/src/components/ThreadsPanel.tsx
+++ b/src/renderer/src/components/ThreadsPanel.tsx
@@ -2,6 +2,7 @@ import { useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { PixelPanel } from './PixelPanel';
import { PixelButton } from './PixelButton';
+import { useRtl } from '@/i18n/useDirection';
// Derive the message shape from the preload-exposed API so the renderer never
// reaches across project boundaries for a type (window.cth is globally typed).
@@ -48,6 +49,7 @@ function groupThreads(msgs: HiveMessage[], noSubject: string): Thread[] {
export function ThreadsPanel({ agentId }: ThreadsPanelProps) {
const { t } = useTranslation();
+ const rtl = useRtl();
const [messages, setMessages] = useState<HiveMessage[]>([]);
const [openThreads, setOpenThreads] = useState<Record<string, boolean>>({});
const [expanded, setExpanded] = useState<Record<string, boolean>>({});
@@ -130,7 +132,7 @@ export function ThreadsPanel({ agentId }: ThreadsPanelProps) {
{new Date(m.created_at).toLocaleString()}
</span>
</div>
- <div style={{ fontFamily: 'var(--cth-font-ui)', fontSize: 13, lineHeight: '18px', color: 'var(--cth-ink-700)', marginTop: 2, whiteSpace: 'pre-wrap', wordBreak: 'break-word' }}>
+ <div dir={rtl ? 'auto' : undefined} style={{ fontFamily: 'var(--cth-font-ui)', fontSize: 13, lineHeight: '18px', color: 'var(--cth-ink-700)', marginTop: 2, whiteSpace: 'pre-wrap', wordBreak: 'break-word' }}>
{shown}
{long && (
<button
@@ -145,6 +147,7 @@ export function ThreadsPanel({ agentId }: ThreadsPanelProps) {
<div style={{ display: 'flex', flexDirection: 'column', gap: 6, marginTop: 4 }}>
<textarea
+ dir={rtl ? 'auto' : undefined}
value={drafts[thread.conversation] ?? ''}
onChange={e => setDrafts(d => ({ ...d, [thread.conversation]: e.target.value }))}
placeholder={t('threads.replyPlaceholder', { name: last.from })}
diff --git a/src/renderer/src/components/terminalPool.ts b/src/renderer/src/components/terminalPool.ts
index 28ec7727..c5f3e073 100644
--- a/src/renderer/src/components/terminalPool.ts
+++ b/src/renderer/src/components/terminalPool.ts
@@ -83,6 +83,9 @@ export interface TerminalEntry {
* be recognised and dropped instead of corrupting the replacement. */
generation: number;
webgl?: WebglAddon;
+ /** Live Arabic/RTL rendering handles, present only while it is ON. Held so
+ * the mode can be switched off again without disposing the terminal. */
+ arabic?: { joiner: number; detachSpacing: () => void };
}
const pool = new Map<string, TerminalEntry>();
@@ -637,6 +640,89 @@ function releaseWebglRenderer(entry: TerminalEntry): void {
entry.needsRendererRepaint = true;
}
+/** Turn Arabic/RTL rendering ON for one open terminal.
+ *
+ * The full recipe is documented in terminal/arabicJoiner.ts: join every Arabic
+ * phrase into one render range, and strip xterm's per-span letter-spacing from
+ * Arabic spans. MUST run after `open()` — registering a joiner on an unopened
+ * terminal throws.
+ *
+ * The `cth-bidi` class is what scopes the bidi CSS in design/global.css to this
+ * terminal. PR #213 applied those rules to every .xterm on the page; they are
+ * `!important` and change span layout, so an English user who fell back to the
+ * DOM renderer (a lost WebGL lease) would have had their TUI box-drawing
+ * shifted by a feature they never enabled. */
+function enableArabicRendering(entry: TerminalEntry): void {
+ if (entry.arabic) return;
+ entry.host.classList.add('cth-bidi');
+ const joiner = entry.term.registerCharacterJoiner(arabicJoinRanges);
+ const detachSpacing = attachArabicSpacingFix(entry.host);
+ entry.arabic = { joiner, detachSpacing };
+ // Terminals open at boot, often BEFORE webfonts finish loading, so xterm
+ // measures Arabic glyphs against fallback metrics and keeps them. When the
+ // real fonts land, poke fontFamily (a self-assign) to force a re-measure and
+ // full repaint.
+ void document.fonts?.ready.then(() => {
+ if (entry.exited) return;
+ const fam = entry.term.options.fontFamily;
+ entry.term.options.fontFamily = fam;
+ });
+}
+
+/** Exactly undo the above. Every step is reversible, which is the reason the
+ * switch can be live at all — nothing here disposes the terminal. */
+function disableArabicRendering(entry: TerminalEntry): void {
+ const on = entry.arabic;
+ if (!on) return;
+ entry.arabic = undefined;
+ entry.host.classList.remove('cth-bidi');
+ try { entry.term.deregisterCharacterJoiner(on.joiner); } catch { /* already gone */ }
+ try { on.detachSpacing(); } catch { /* noop */ }
+}
+
+/** Bring every OPEN terminal in line with the current setting.
+ *
+ * Called when the app language changes and when the Settings toggle is used.
+ * Without it the setting would only reach terminals opened afterwards, and a
+ * user who switched to Arabic would see the terminals they already had still
+ * rendering unshaped, left-to-right — which reads as the feature not working
+ * rather than as a scoping rule.
+ *
+ * It UPGRADES IN PLACE rather than rebuilding. The office scene can be rebuilt
+ * on a language switch (a8292697) because it is derived from state we still
+ * hold; a terminal cannot, because its scrollback exists only in xterm's own
+ * buffer and the pty will not resend it — recreating one would silently eat
+ * the user's history. Dropping the WebGL lease is enough: `releaseWebglRenderer`
+ * hands painting to the DOM renderer with the buffer, the pty subscription and
+ * the scrollback all untouched, and that DOM renderer is precisely what Arabic
+ * mode needs. Going the other way re-leases WebGL on the next attach.
+ *
+ * A terminal that has never been opened is skipped: it has no host in the
+ * document and no joiner to register, and `attachTerminal` reads the setting
+ * fresh when it does open. */
+export function notifyArabicTerminalChangeAll(): void {
+ const want = isArabicTerminalEnabled();
+ const open = [...pool.values()].filter((e) => e.opened && !e.exited);
+ const changed = open.filter((e) => !!e.arabic !== want);
+ for (const entry of changed) {
+ if (want) {
+ // The GPU cell painter ignores CSS and cannot do bidi, so Arabic mode
+ // needs the DOM renderer. Releasing the lease keeps the buffer.
+ releaseWebglRenderer(entry);
+ enableArabicRendering(entry);
+ } else {
+ disableArabicRendering(entry);
+ // Deliberately NOT re-leasing WebGL here: the lease is taken on attach,
+ // and taking one now for an off-screen terminal is the exact GPU-context
+ // exhaustion releaseWebglRenderer exists to avoid.
+ entry.needsRendererRepaint = true;
+ }
+ repaintTerminalAfterRendererLoss(entry);
+ }
+ console.log(`[terminal] arabic -> ${want ? 'on' : 'off'}: `
+ + `${changed.length}/${open.length} open terminal(s) switched`);
+}
+
/** Re-parent a pty's terminal into `container`, opening xterm on first attach. */
export function attachTerminal(entry: TerminalEntry, container: HTMLElement): void {
container.appendChild(entry.host);
@@ -655,20 +741,7 @@ export function attachTerminal(entry: TerminalEntry, container: HTMLElement): vo
// they are `!important` and change span layout, so an English user who
// fell back to the DOM renderer (a lost WebGL lease) would have had their
// TUI box-drawing shifted by a feature they never enabled.
- if (isArabicTerminalEnabled()) {
- entry.host.classList.add('cth-bidi');
- entry.term.registerCharacterJoiner(arabicJoinRanges);
- entry.unsub.push(attachArabicSpacingFix(entry.host));
- // Terminals open at boot, often BEFORE webfonts finish loading, so xterm
- // measures Arabic glyphs against fallback metrics and keeps them. When
- // the real fonts land, poke fontFamily (a self-assign) to force a
- // re-measure and full repaint.
- void document.fonts?.ready.then(() => {
- if (entry.exited) return;
- const fam = entry.term.options.fontFamily;
- entry.term.options.fontFamily = fam;
- });
- }
+ if (isArabicTerminalEnabled()) enableArabicRendering(entry);
}
leaseWebglRenderer(entry);
// PTY startup output can arrive before this pooled terminal subscribes.
diff --git a/src/renderer/src/components/triggers/ContextSection.tsx b/src/renderer/src/components/triggers/ContextSection.tsx
index d0acd818..39b5ac62 100644
--- a/src/renderer/src/components/triggers/ContextSection.tsx
+++ b/src/renderer/src/components/triggers/ContextSection.tsx
@@ -6,6 +6,7 @@ import {
Callout, Field, Hint, IntervalPicker, Muted, PctField, SubCard, SubHeader, Toggle,
fmtInterval, textareaStyle
} from './ui';
+import { useRtl } from '@/i18n/useDirection';
/**
* CONTEXT — the trigger that fires on an agent's own terminal filling up rather
@@ -94,6 +95,7 @@ function RuleCard({ title, blurb, rule, messageLabel, messageHint, messagePlaceh
onPatch: (fields: Partial<ContextRule>) => void;
}) {
const { t } = useTranslation();
+ const rtl = useRtl();
const [open, setOpen] = useState(false);
return (
<SubCard>
@@ -141,6 +143,7 @@ function RuleCard({ title, blurb, rule, messageLabel, messageHint, messagePlaceh
</Field>
<Field label={messageLabel}>
<textarea
+ dir={rtl ? 'auto' : undefined}
value={rule.message}
onChange={(e) => onPatch({ message: e.target.value })}
rows={3}
diff --git a/src/renderer/src/components/triggers/SchedulesSection.tsx b/src/renderer/src/components/triggers/SchedulesSection.tsx
index 60905ac7..366193c4 100644
--- a/src/renderer/src/components/triggers/SchedulesSection.tsx
+++ b/src/renderer/src/components/triggers/SchedulesSection.tsx
@@ -9,6 +9,7 @@ import {
type WeeklyDraft
} from './ui';
import { formatWeekly, nextWeeklyFireMs } from '@shared/weeklySchedule';
+import { useRtl } from '@/i18n/useDirection';
/**
* SCHEDULES — recurring auto-dispatched missions. The oldest trigger type, and
@@ -52,6 +53,7 @@ function relTime(ms: number, t: TFunction): string {
export function SchedulesSection({ onSummary }: { onSummary?: (s: string) => void }) {
const { t } = useTranslation();
+ const rtl = useRtl();
const agents = useStore((s) => s.agents);
const [missions, setMissions] = useState<ScheduledMission[]>([]);
const [adding, setAdding] = useState(false);
@@ -156,6 +158,7 @@ export function SchedulesSection({ onSummary }: { onSummary?: (s: string) => voi
</Field>
<Field label={t('schedulesSection.prompt')}>
<textarea
+ dir={rtl ? 'auto' : undefined}
value={mBody}
onChange={(e) => setMBody(e.target.value)}
rows={3}
@@ -189,6 +192,7 @@ function MissionRow({ mission, targetName, agents, onPatch, onDelete }: {
onDelete: () => void;
}) {
const { t } = useTranslation();
+ const rtl = useRtl();
const [open, setOpen] = useState(false);
const [label, setLabel] = useState(mission.label);
const [to, setTo] = useState(mission.to);
@@ -299,6 +303,7 @@ function MissionRow({ mission, targetName, agents, onPatch, onDelete }: {
</Field>
<Field label={t('schedulesSection.prompt')}>
<textarea
+ dir={rtl ? 'auto' : undefined}
value={body}
onChange={(e) => setBody(e.target.value)}
rows={4}
diff --git a/src/renderer/src/components/triggers/TriggerHistoryTab.tsx b/src/renderer/src/components/triggers/TriggerHistoryTab.tsx
index ec970efb..43a6e705 100644
--- a/src/renderer/src/components/triggers/TriggerHistoryTab.tsx
+++ b/src/renderer/src/components/triggers/TriggerHistoryTab.tsx
@@ -4,6 +4,7 @@ import type { TFunction } from 'i18next';
import { PixelButton } from '../PixelButton';
import { useStore } from '@/store/store';
import type { TriggerHistoryEntry } from '@shared/triggers';
+import { useRtl } from '@/i18n/useDirection';
/**
* TRIGGER HISTORY — the ledger of everything an outside party said to this hive
@@ -211,6 +212,7 @@ function MessageBlock({
onToggle: () => void;
}) {
const { t } = useTranslation();
+ const rtl = useRtl();
const body = msg.body ?? '';
const { text, clipped } = useMemo(() => clampBody(body), [body]);
return (
@@ -219,7 +221,7 @@ function MessageBlock({
<span style={tinyCaps}>{label}</span>
<span style={{ ...tinyCaps, flexShrink: 0 }}>{relTime(Date.now() - msg.at, t)}</span>
</div>
- <div style={bodyBox}>{body.trim() ? (expanded ? body : text) : t('triggerHistory.emptyMessage')}</div>
+ <div style={bodyBox} dir={rtl ? 'auto' : undefined}>{body.trim() ? (expanded ? body : text) : t('triggerHistory.emptyMessage')}</div>
{clipped && (
<button type="button" onClick={onToggle} style={linkButton}>
{expanded ? t('triggerHistory.showLess') : t('triggerHistory.showAll', { count: body.length })}
diff --git a/src/renderer/src/design/global.css b/src/renderer/src/design/global.css
index 536514b3..91d2785d 100644
--- a/src/renderer/src/design/global.css
+++ b/src/renderer/src/design/global.css
@@ -219,6 +219,49 @@ canvas, img, svg { image-rendering: pixelated; image-rendering: crisp-edges; }
.cth-bidi .xterm .xterm-rows > div > span,
.cth-bidi.xterm .xterm-rows > div > span { display: inline !important; unicode-bidi: normal !important; }
+/* ─── RTL app language ───────────────────────────────────────────────────────
+ Everything below is under `[dir="rtl"]`, which i18n/useDirection puts on
+ <html> ONLY for a user who picked a right-to-left app language. For everyone
+ else <html> is `dir="ltr"` and not one of these selectors matches, so this
+ whole section is inert — no specificity change, no inherited property, no
+ repaint. That is the gate the Arabic UI ships under.
+
+ THE TERMINAL GRID IS NOT PROSE, so it does not mirror with the rest of the
+ app. `direction` inherits, and xterm's viewport would pick up `rtl` from
+ <html> and right-align the entire cell grid — reversing box-drawing frames,
+ putting the cursor column on the wrong side, and mirroring every TUI the
+ agents run. The grid is a fixed left-to-right coordinate space that the pty
+ also believes in (it addresses cells by column from the left), so the two
+ have to agree. Per-ROW direction is a separate question and already has an
+ answer: `.cth-bidi` above, which gives each row its own base direction from
+ its own text. That is the right layer for it — this rule pins the container,
+ that one frees the rows. */
+[dir="rtl"] .xterm,
+[dir="rtl"] .xterm-viewport,
+[dir="rtl"] .xterm-screen,
+[dir="rtl"] .xterm-rows,
+[dir="rtl"] .xterm-width-cache-measure-container { direction: ltr; }
+
+/* Tooltip bubbles anchor to an EDGE, and the edge they mean is "the side of the
+ control the text runs away from" — which swaps under RTL. These were written
+ as physical `right: 0` / `left: 0` (the `.cth-tip-left` variant), so in a
+ mirrored UI every tip would hang off the wrong side and the variant meant to
+ pull one back toward the middle would push it further out instead. */
+[dir="rtl"] .cth-tip::after { right: auto; left: 0; }
+[dir="rtl"] .cth-tip-left::after { left: auto; right: 0; }
+
+/* A code span or block keeps its own direction wherever it appears, RTL page or
+ not: reordering a shell command changes what it says. The markdown preview
+ already isolates its own (see `.cth-md-preview code`); this covers the same
+ content rendered outside that wrapper. */
+[dir="rtl"] code,
+[dir="rtl"] pre { direction: ltr; unicode-bidi: isolate; text-align: start; }
+
+/* Scrollbars, sliders and progress fills read from the inline start, so under
+ RTL they should fill from the right. `direction` alone does not reach a
+ native range input's track. */
+[dir="rtl"] input[type="range"] { direction: rtl; }
+
/* ─── Markdown preview (v0.3.4) ──────────────────────────────────────────────
Shared by the IDE split/preview view and the fullscreen file overlay. All
colors ride the tokens, so light + dark themes come for free. */
@@ -256,7 +299,7 @@ canvas, img, svg { image-rendering: pixelated; image-rendering: crisp-edges; }
command or a path. `isolate` keeps it from disturbing the surrounding run.
For LTR prose this is what already happened, so nothing moves. */
.cth-md-preview code, .cth-md-preview pre {
- direction: ltr; unicode-bidi: isolate; text-align: left;
+ direction: ltr; unicode-bidi: isolate; text-align: start;
}
.cth-md-preview blockquote {
margin: 0.8em 0; padding-block: 2px; padding-inline-start: 14px;
@@ -316,10 +359,13 @@ canvas, img, svg { image-rendering: pixelated; image-rendering: crisp-edges; }
.cth-md-card code { font-size: 0.9em; padding: 0 3px; }
.cth-md-card pre { margin: 0.5em 0; padding: 6px 8px; }
/* 22px, not less: the list marker is painted OUTSIDE the padding box, and a
- tighter indent clips "1." against the card's own 9px edge. */
-.cth-md-card ul, .cth-md-card ol { padding-left: 22px; margin: 0.4em 0; }
+ tighter indent clips "1." against the card's own 9px edge.
+ Logical, to match `.cth-md-preview` above — a card's list indent has to end
+ up on whichever side the list actually starts on, and an ASK ME question or a
+ task Q&A entry is exactly the agent-written text most likely to be Arabic. */
+.cth-md-card ul, .cth-md-card ol { padding-inline-start: 22px; margin: 0.4em 0; }
.cth-md-card li { margin: 1px 0; }
-.cth-md-card blockquote { margin: 0.5em 0; padding-left: 10px; }
+.cth-md-card blockquote { margin: 0.5em 0; padding-inline-start: 10px; }
.cth-md-card hr { margin: 0.8em 0; }
.cth-md-card table { margin: 0.5em 0; }
.cth-md-card th, .cth-md-card td { padding: 3px 7px; font-size: 0.9em; }
diff --git a/src/renderer/src/i18n/index.ts b/src/renderer/src/i18n/index.ts
index 6c90c1f1..3068eb7a 100644
--- a/src/renderer/src/i18n/index.ts
+++ b/src/renderer/src/i18n/index.ts
@@ -12,22 +12,57 @@
* Adding a language: drop a `locales/<code>.json` with the exact same key
* tree as `en.json`, register it in `resources` and `supportedLngs`, and add
* an entry to `LANGUAGES` (Settings → General exposes the picker from that
- * list). No other code needs to change.
+ * list). Give it `dir: 'rtl'` if it is a right-to-left script. No other code
+ * needs to change.
*/
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import { DEFAULT_GOD_NAME } from '@shared/godIdentity';
import en from './locales/en.json';
import zhCN from './locales/zh-CN.json';
+import ar from './locales/ar.json';
-/** The languages the Settings picker offers, in display order. */
+/**
+ * The languages the Settings picker offers, in display order.
+ *
+ * `dir` is the language's WRITING DIRECTION, and it is the ONLY thing the app
+ * keys right-to-left layout off. Not the OS locale, not the content of a
+ * document, not a system font — the language the user picked here, and nothing
+ * else. That is what makes RTL inert for everybody who has not picked an RTL
+ * language: `dir` is 'ltr' for every one of them, so every `isRtl` branch in
+ * the renderer takes the same path it took before Arabic existed.
+ */
export const LANGUAGES = [
- { code: 'en', label: 'English' },
- { code: 'zh-CN', label: '简体中文' }
+ { code: 'en', label: 'English', dir: 'ltr' },
+ { code: 'zh-CN', label: '简体中文', dir: 'ltr' },
+ { code: 'ar', label: 'العربية', dir: 'rtl' }
] as const;
export type LanguageCode = (typeof LANGUAGES)[number]['code'];
+/** Language codes that read right-to-left, derived from LANGUAGES itself so a
+ * new locale cannot be registered with a direction and then forgotten here. */
+const RTL_CODES: ReadonlySet<string> = new Set(
+ LANGUAGES.filter((l) => l.dir === 'rtl').map((l) => l.code)
+);
+
+/**
+ * Does this language code read right-to-left?
+ *
+ * Deliberately EXACT-MATCH on a registered code rather than a prefix or a
+ * script guess. An unknown code is left-to-right, which is the direction every
+ * user had before this shipped — an unrecognised value must never be able to
+ * mirror somebody's UI.
+ */
+export function isRtlLanguage(lng: string | undefined | null): boolean {
+ return !!lng && RTL_CODES.has(lng);
+}
+
+/** `'rtl'` or `'ltr'` for a language code, for a `dir` attribute. */
+export function directionFor(lng: string | undefined | null): 'rtl' | 'ltr' {
+ return isRtlLanguage(lng) ? 'rtl' : 'ltr';
+}
+
const STORAGE_KEY = 'cth.language';
const SUPPORTED: readonly string[] = LANGUAGES.map((l) => l.code);
@@ -74,11 +109,12 @@ void i18n
.init({
resources: {
en: { translation: en },
- 'zh-CN': { translation: zhCN }
+ 'zh-CN': { translation: zhCN },
+ ar: { translation: ar }
},
lng: detectLanguage(),
fallbackLng: 'en',
- supportedLngs: ['en', 'zh-CN'],
+ supportedLngs: ['en', 'zh-CN', 'ar'],
// Resources are bundled inline, so nothing ever suspends — the string is
// there at init time. Keeping this false lets every component call
// useTranslation() without wrapping the tree in <Suspense>.
diff --git a/src/renderer/src/i18n/locales/ar.json b/src/renderer/src/i18n/locales/ar.json
new file mode 100644
index 00000000..bf96cca6
--- /dev/null
+++ b/src/renderer/src/i18n/locales/ar.json
@@ -0,0 +1,1404 @@
+{
+ "common": {
+ "on": "تشغيل",
+ "off": "إيقاف",
+ "cancel": "إلغاء",
+ "save": "حفظ",
+ "close": "إغلاق",
+ "back": "رجوع",
+ "next": "التالي",
+ "finish": "إنهاء",
+ "saving": "جارٍ الحفظ...",
+ "copy": "نسخ",
+ "delete": "حذف",
+ "hide": "إخفاء",
+ "show": "إظهار",
+ "search": "بحث",
+ "tokens": "رموز",
+ "restarting": "جارٍ إعادة التشغيل…",
+ "add": "إضافة"
+ },
+ "commandBar": {
+ "free": "حر",
+ "skill": "/مهارة",
+ "quick": "سريع",
+ "placeholder": "اكتب أمرًا",
+ "placeholderBusy": "Ada تعمل الآن...",
+ "placeholderBlocked": "Ada بحاجة إليك...",
+ "send": "إرسال",
+ "busyNote": "Ada في منتصف أداة. أضِف إلى الطابور أو اضغط إيقاف مؤقت.",
+ "blockedNote": "مطلوب موافقة."
+ },
+ "blockedBanner": {
+ "needsYou": "بحاجة إليك"
+ },
+ "costHud": {
+ "spendCap": "سقف الإنفاق",
+ "none": "بلا",
+ "usd": "دولار",
+ "off": "(معطّل)",
+ "thisSession": "{{usd}} في هذه الجلسة",
+ "thisSessionWithCap": "{{usd}} في هذه الجلسة / {{cap}}",
+ "audioTokens": "{{input}} داخل · {{output}} خارج من رموز الصوت",
+ "overCap": "تجاوزتَ سقف الإنفاق — حان وقت الختام.",
+ "nearCap": "تقترب من سقف الإنفاق.",
+ "lastSession": "آخر جلسة: {{usd}}",
+ "noSession": "لا جلسة صوتية نشطة.",
+ "compactTitle": "{{count}} رمز صوتي في هذه الجلسة",
+ "tok": "رمز"
+ },
+ "badge": {
+ "idle": "خامل",
+ "thinking": "يعمل",
+ "working": "يعمل",
+ "waiting": "ينتظر",
+ "blocked": "بحاجة إليك",
+ "success": "تم",
+ "ghost": "غادر",
+ "compacting": "يضغط السياق",
+ "looping": "يدور في حلقة",
+ "typing": "مسودّتك"
+ },
+ "agentControl": {
+ "deliveryPaused": "الرسائل المصفوفة محتجزة (الأرضية كلها)",
+ "halting": "سيتوقّف بعد هذه الخطوة…",
+ "steersQueued": "{{count}} ملاحظة في الانتظار",
+ "steerPlaceholder": "أرسل ملاحظة إلى هذا الوكيل… (تصله كسياق في دوره التالي، ولا يُكتب شيء في طرفيته)",
+ "steer": "وجِّه",
+ "flashResumed": "سُمح بالأدوات مجددًا",
+ "flashPaused": "حُظرت الأدوات من الاستدعاء التالي فصاعدًا",
+ "flashHalt": "سيتوقّف بعد الخطوة الحالية",
+ "flashSteer": "أُضيفت الملاحظة إلى الطابور، وتصل في دوره التالي",
+ "allowTools": "السماح بالأدوات",
+ "allowToolsTip": "أعِد إليه أدواته. يحتفظ الوكيل بجلسته ويكمل من حيث توقّف.",
+ "allowToolsAria": "السماح بالأدوات مجددًا",
+ "blockTools": "حظر الأدوات",
+ "blockToolsTip": "يواصل الوكيل التفكير والحديث معك، لكنه لا يستطيع القراءة أو الكتابة أو التشغيل حتى تسمح له مجددًا. فوري وقابل للتراجع.",
+ "blockToolsAria": "امنع هذا الوكيل من استخدام الأدوات",
+ "stopAfterStep": "توقّف بعد هذه الخطوة",
+ "stopAfterStepTip": "دعه يُنهي الخطوة التي يعمل عليها ثم يتوقّف. تبقى العملية وجلستها، فيمكن لإعادة التشغيل والمتابعة استئنافها. ولإنهاء العملية تمامًا استخدم علامة X.",
+ "stopAfterStepAria": "أوقف هذا الوكيل بعد الخطوة الحالية",
+ "steerTip": "يسلّم الوكيل ملاحظة عند حدود دوره التالي. لا يقاطع ما يفعله الآن، ولا يُكتب شيء في طرفيته.",
+ "steerAria": "أرسل ملاحظة إلى هذا الوكيل"
+ },
+ "agentCard": {
+ "boss": "المدير",
+ "contextTitle": "السياق: {{used}} / {{limit}} رمز ({{pct}}%)",
+ "contextGaugeTitle": "مقياس السياق — يمتلئ بمجرد أن يبلّغ الوكيل عن نشاط",
+ "doingTasks": "يعمل فعليًا على {{count}} مهمة — انقر للفتح",
+ "doingTasksPlural": "يعمل فعليًا على {{count}} مهام — انقر للفتح",
+ "editNote": "تحرير ملاحظة خاصة",
+ "addNote": "إضافة ملاحظة خاصة",
+ "editNoteAria": "تحرير ملاحظة {{name}}",
+ "noteAria": "ملاحظة {{name}}"
+ },
+ "askMe": {
+ "emptyTitle": "لا شيء يحتاجك الآن. 🌿",
+ "emptySub": "عندما يوقف الفريق مهمة بانتظار ردّك — سؤال تجيب عنه أو أمر لا يقدر عليه سواك — يظهر هنا (وعلى لوحة \"اسألني\" في الأرضية).",
+ "openDetail": "افتح تفاصيل المهمة كاملة",
+ "dismissTitle": "تجاهل — أزِل هذا من لوحة \"اسألني\" دون إجابة (يبقى في السجل)",
+ "dismissAria": "تجاهل هذا الطلب",
+ "answerPlaceholder": "إجابتك — أو \"تم\"، مع النتيجة… (Ctrl+Enter للإرسال)",
+ "sending": "جارٍ الإرسال…",
+ "respond": "أجب وارفع الحظر",
+ "viewAnswers": "عرض {{count}} إجابة سابقة",
+ "viewAnswersPlural": "عرض {{count}} إجابات سابقة",
+ "viewAnswersHistory": "افتح تفاصيل المهمة مع سجلّ الأسئلة والأجوبة كاملًا",
+ "blockingDownstream": "يعطّل {{count}} مهمة لاحقة",
+ "blockingDownstreamPlural": "يعطّل {{count}} مهام لاحقة",
+ "more": "… +{{count}} أخرى"
+ },
+ "agentStrip": {
+ "privateNote": "ملاحظة خاصة · {{name}}",
+ "done": "تم",
+ "closeNoteEditor": "أغلق محرّر الملاحظات",
+ "notePlaceholder": "سطر واحد لكل نقطة…",
+ "oneLineOneBullet": "سطر واحد = نقطة واحدة · esc للإغلاق",
+ "addAgent": "إضافة وكيل",
+ "restoringTitle": "يُعاد إنشاء وكلاء جلستك السابقة بمعرّفاتهم الأصلية، لتعود الذاكرة وصناديق الوارد إليهم.",
+ "restoreTitle": "الجلسة السابقة: {{names}}",
+ "restoringTeam": "جارٍ استعادة فريقك…",
+ "restoreTeam": "استعادة الفريق ({{count}}) ▴",
+ "previousSession": "الجلسة السابقة",
+ "restorable": "{{name}} — قابل للاستعادة من الجلسة الماضية",
+ "dismiss": "تجاهل {{name}} — أزِله نهائيًا من قائمة الاستعادة",
+ "dismissAria": "تجاهل {{name}}",
+ "restoreAll": "استعادة الكل ({{count}})"
+ },
+ "sidebar": {
+ "terminal": "الطرفية",
+ "git": "git",
+ "messages": "الرسائل",
+ "traces": "التتبّع"
+ },
+ "toolWaterfall": {
+ "fresh": "جديد {{tokens}}ر",
+ "cache": "مخبّأ {{tokens}}ر ({{pct}}%)",
+ "total": "{{tokens}}ر إجمالًا",
+ "noTelemetry": "لا قياسات حيّة بعد — أنشئ الوكيل أو أعِد إنشاءه لتزويده بالقياس",
+ "empty": "لم تُلتقط أي استدعاءات أدوات بعد. تظهر هنا كل أداة يشغّلها الوكيل مع مدّتها الحقيقية.",
+ "barOk": "{{tool}} · {{ms}} م.ث · ناجح",
+ "barFailed": "{{tool}} · {{ms}} م.ث · فاشل"
+ },
+ "agentDetail": {
+ "open": "فتح",
+ "opening": "...",
+ "ok": "تم",
+ "err": "خطأ",
+ "inFullscreen": "في وضع التركيز",
+ "fullscreenDesc": "هذه الطرفية مفتوحة في وضع التركيز. اضغط Esc أو اخرج من وضع التركيز لإعادتها إلى هنا.",
+ "noPty": "لا PTY",
+ "noPtyDesc": "لا توجد طرفية حيّة لهذا الوكيل. أنشئ وكيلًا عبر \"إضافة وكيل\" لاستخدام تبويب الطرفية.",
+ "killConfirm": "إغلاق {{name}}؟ ستنتهي عملية PTY ويُؤرشَف الوكيل (يبقى في السجل، خارج الأرضية).",
+ "ideTip": "افتح بيئة التطوير: تصفّح وحرّر الملفات في {{project}}، واعرض التغييرات غير المودعة كفروقات.",
+ "terminalTip": "افتح تطبيق الطرفية في نظامك عند {{cwd}} — صدفة عادية داخل مجلد هذا الوكيل، منفصلة عن طرفيته الخاصة.",
+ "openIde": "افتح بيئة التطوير",
+ "ide": "بيئة التطوير",
+ "openTerminalAria": "افتح طرفية نظام في مجلد هذا الوكيل"
+ },
+ "settingsHero": {
+ "sponsoredBy": "برعاية",
+ "visit": "زيارة",
+ "whatsNew": "ما الجديد",
+ "whatsNewTitle": "اعرض ملاحظات إصدار التحديث الذي أُخبرت عنه آخر مرة",
+ "starOnGitHub": "ضع نجمة على GitHub",
+ "reportProblem": "أبلغ عن مشكلة",
+ "fullChangelog": "سجل التغييرات الكامل ←",
+ "announcement": "إعلان",
+ "proLaunch": "الإصدار v0.5.0 يُطلَق مع Munder Difflin Pro.",
+ "proCommunityFree": "تبقى نسخة المجتمع مجانية ومفتوحة وتستمر في تلقّي التحديثات.",
+ "proParagraph": "تأتي Pro بميزات وتكاملات جديدة، ويُضاف المزيد على مدار السنة، وتبقى متقدّمة على نسخة المجتمع، لمن يريد أقصى ما تقدّمه وكلاء البرمجة ومنصّاتها. وتشمل خارطة طريق Pro تطبيقًا للهاتف أيضًا.",
+ "foundersWallTitle": "على حائط المؤسِّسين؟",
+ "foundersWallBody": "شهر مجاني من Munder Difflin Pro، ثم خصم 50% على الخطة السنوية. لأول 100 شخص على الحائط.",
+ "seeTheWall": "شاهد الحائط",
+ "joinDiscord": "انضم إلى Discord"
+ },
+ "officeTheme": {
+ "title": "سِمة المكتب",
+ "tvShow": "سِمات مكاتب من المسلسلات",
+ "experimental": "تجريبي",
+ "desc": "أعِد كساء المكتب البكسلي على هيئة مسلسل. التبديل يبدأ طاقمًا جديدًا.",
+ "current": "الحالي",
+ "soon": "قريبًا",
+ "notBuiltYet": "{{label}} لم يُبنَ بعد — يُعرَض المكتب في الوقت الحالي.",
+ "switchAborted": "أُلغي التبديل — تعذّر إغلاق إحدى الطرفيات: {{error}}",
+ "confirmTitle": "تبديل المكتب إلى \"{{label}}\"؟",
+ "startsFreshCast": "يبدأ طاقمًا جديدًا",
+ "deleteCount": "سيُحذف وكيلك الحالي البالغ {{count}} — تُغلق طرفيته ويتوقّف أي عمل جارٍ.",
+ "deleteCountPlural": "سيُحذف وكلاؤك الحاليون البالغ عددهم {{count}} — تُغلق طرفياتهم ويتوقّف أي عمل جارٍ.",
+ "onlyCarries": "لا ينتقل سوى {{god}}.",
+ "stillWorking": "⚠ ما زال {{count}} وكيل يعمل.",
+ "stillWorkingPlural": "⚠ ما زال {{count}} وكلاء يعملون.",
+ "cantUndo": "لا يمكن التراجع عن هذا.",
+ "switching": "جارٍ التبديل…",
+ "deleteSwitch": "احذف {{count}} وبدِّل"
+ },
+ "settings": {
+ "title": "الإعدادات",
+ "changeHomeTitle": "تغيير مجلد المنزل",
+ "resetTitle": "إعادة تعيين كل شيء؟",
+ "close": "إغلاق",
+ "change": "تغيير...",
+ "apply": "جارٍ التطبيق...",
+ "moveAndRestart": "انقل وأعِد التشغيل",
+ "switchAndRestart": "بدّل وأعِد التشغيل",
+ "resetting": "جارٍ إعادة التعيين...",
+ "eraseEverything": "امحُ كل شيء وأعِد التشغيل",
+ "nav": {
+ "general": "عام",
+ "prerequisites": "المتطلّبات",
+ "agentsModels": "الوكلاء والنماذج",
+ "autonomyBudgets": "الاستقلالية والميزانيات",
+ "connections": "الاتصالات",
+ "voice": "الصوت",
+ "memoryKnowledge": "الذاكرة والمعرفة"
+ },
+ "changeHome": {
+ "newHome": "مجلد المنزل الجديد",
+ "moveTitle": "نقل البيانات الحالية (موصى به)",
+ "moveDesc": "انسخ خلية هذه المنصّة (كل وكيل وذاكرة ومهمة) وقصر الذاكرة الدلالية إلى المجلد الجديد. يبقى المجلد القديم كما هو كنسخة احتياطية يمكنك حذفها لاحقًا.",
+ "freshTitle": "ابدأ من جديد",
+ "freshDesc": "وجّه المنصّة إلى المجلد الجديد (الفارغ). تبقى بياناتك الحالية في المجلد القديم، لكن دون استخدام."
+ },
+ "resetConfirm": {
+ "body": "هذا يمحو نهائيًا كل ذكريات {{godName}} والخلية بأكملها، ولا يمكن التراجع عنه. ستُنهى أي جلسات عاملة وسيُعاد تشغيل التطبيق إلى الإعداد الأولي. هل أنت متأكّد؟"
+ },
+ "general": {
+ "homeFolder": "مجلد المنزل",
+ "environment": "البيئة",
+ "keepAwake": "أبقِ جهاز Mac مستيقظًا أثناء عمل الوكلاء",
+ "keepAwakeDesc": "يمنع سكون الشاشة لتستمر الجداول والطرفيات في العمل في وقتها. يستهلك البطارية — الأفضل عند التوصيل بالكهرباء.",
+ "simpleMode": "اشرح الأمور ببساطة",
+ "simpleModeDesc": "يوجز لك الوكلاء بلغة واضحة بدل المصطلحات الهندسية المختصرة.",
+ "notifications": "الإشعارات",
+ "desktopNotifications": "إشعارات سطح المكتب",
+ "desktopNotificationsDesc": "إشعارات أصلية عندما ينتهي وكيل أو يحتاج إلى ردّك.",
+ "maintenance": "الصيانة",
+ "autoCompact": "ضغط تلقائي مجدوَل",
+ "autoCompactDesc": "يضيف ‎/compact إلى طابور كل وكيل وفق جدول (كل ساعة افتراضيًا؛ الفاصل في تبويب المشغّلات). معطّل افتراضيًا — قد تفيض ذاكرة الوكلاء طويلة العمل من دونه.",
+ "autoUpdate": "التحديث التلقائي",
+ "autoUpdateDesc": "يتحقّق من إصدارات GitHub وينزّل التحديثات في الخلفية؛ وأنت تختار متى تُعيد التشغيل. لا يُعيد التشغيل من تلقاء نفسه أبدًا.",
+ "telemetry": "إحصاءات استخدام مجهولة",
+ "telemetryDesc": "حفنة من الأحداث المجهولة (فتح التطبيق، إنشاء وكيل، استخدام ميزة) — لا موجّهات ولا شيفرة ولا مسارات ولا مخرجات وكلاء أبدًا. القائمة الكاملة في TELEMETRY.md.",
+ "language": "اللغة",
+ "languageDesc": "اختر لغة واجهة التطبيق. الإنجليزية هي الافتراضية.",
+ "dangerZone": "منطقة الخطر",
+ "dangerDesc": "إعادة التعيين تمحو ذكريات {{godName}}، والخلية بأكملها (كل وكيل ورسالة ومهمة واللوحة)، وقصر الذاكرة الدلالية، وكل الإعدادات - ثم تعيدك إلى الإعداد الأولي.",
+ "resetStartOver": "أعِد التعيين وابدأ من جديد",
+ "arabicTerminal": "النص العربي / من اليمين إلى اليسار في الطرفيات",
+ "arabicTerminalDesc": "يعرض الطرفيات بمحرّك النصوص في المتصفّح ليتّصل النص العربي ويُقرأ من اليمين إلى اليسار (لا يملك xterm دعم اتجاهين خاصًا به). الإيقاف يعني العارض الرسومي: أسرع، لكنه أعمى عن الاتجاه من اليمين إلى اليسار. يسري على الطرفيات المفتوحة والجديدة على حدّ سواء.",
+ "arabicTerminalFollowsLanguage": "يتبع حاليًا لغة التطبيق. بدّله من هنا لتجاوز ذلك في أي من الاتجاهين — ويبقى اختيارك حتى لو غيّرت اللغة مجددًا."
+ },
+ "agentsModels": {
+ "defaultModel": "النموذج الافتراضي للوكلاء",
+ "defaultModelDesc": "يبدأ كل وكيل Claude يُنشَأ حديثًا ({{godName}} ضمنًا) على هذا النموذج ما لم يُختَر نموذج لكل وكيل. يُعلَّم بـ\"· افتراضي\" في منتقيات النماذج.",
+ "savedNote": "حُفِظ — يسري على الوكلاء المنشَئين حديثًا",
+ "saveFailed": "فشل الحفظ",
+ "advanced": "متقدّم",
+ "maxTurns": "أقصى عدد أدوار لكل تشغيل",
+ "unlimited": "بلا حدّ",
+ "blankUnlimited": "فارغ = بلا حدّ"
+ },
+ "autonomy": {
+ "autonomy": "الاستقلالية",
+ "autoOn": "مستقلّ — يتصرّف الوكلاء دون سؤال",
+ "autoOff": "يسأل أولًا — يتوقّف الوكلاء لطلب الموافقة على الأدوات",
+ "autoDesc": "يسري على الوكلاء المنشَئين حديثًا (ويظل بإمكان أمر كل وكيل تجاوزه).",
+ "autonomous": "مستقلّ",
+ "askFirst": "يسأل أولًا",
+ "breaker": "قاطع الدائرة",
+ "breakerDesc": "حماية من الوكلاء الشاردين ومن الإنفاق. يوجّه القاطع أولًا، ثم يقيّد، ثم يوقف الوكيل الذي يتجاوز هذه الحدود.",
+ "floorBudget": "ميزانية رموز الأرضية",
+ "budgetPlaceholder": "مثال: 1000000",
+ "budgetEquals": "= {{value}} رمز",
+ "budgetTotal": "إجمالي الرموز عبر الأرضية",
+ "velocity": "سرعة الرموز (رمز/دقيقة)",
+ "velocityPlaceholder": "مثال: 200000",
+ "repeatedLimit": "حدّ تكرار الأداة",
+ "errorStormLimit": "حدّ عاصفة الأخطاء",
+ "defaultPlaceholder": "افتراضي",
+ "hardStop": "إيقاف قاطع",
+ "hardStopDesc": "عند التجاوز، أنهِ الوكيل بدل تقييده فقط. الإيقاف = التوجيه أولًا (موصى به).",
+ "killOnTrip": "أنهِه عند التجاوز",
+ "steerFirst": "وجِّه أولًا",
+ "saved": "حُفِظ"
+ },
+ "memory": {
+ "semanticMemory": "الذاكرة الدلالية",
+ "crossSession": "استرجاع عبر الجلسات",
+ "crossSessionDesc": "تُفهرَس ذاكرة الوكلاء المكتوبة بصيغة markdown للبحث الفوري. يعيش نموذج التضمين في لوحة الذاكرة.",
+ "kg": "رسم المعرفة",
+ "kgTitle": "قاعدة معرفة المؤسسة",
+ "kgDesc": "أضف مستنداتك وصورك وملفات PDF؛ ويستعلم عنها الوكلاء عند الحاجة عبر أداة kg.",
+ "adding": "جارٍ الإضافة…",
+ "addFiles": "أضف ملفات…",
+ "docCount": "{{count}} مستند مفهرَس",
+ "docCountPlural": "{{count}} مستندات مفهرَسة"
+ },
+ "connections": {
+ "slack": "Slack",
+ "slackIntegration": "تكامل Slack",
+ "showSlackHelp": "اعرض خطوات ربط Slack",
+ "slackDesc": "مرِّر رسائل قناة Slack مباشرةً إلى طابور {{godName}}.",
+ "connected": "● متصل",
+ "notConnected": "○ غير متصل",
+ "signingSecret": "سرّ التوقيع",
+ "signingSecretPlaceholder": "تطبيق Slack ← Basic Information ← Signing Secret",
+ "botToken": "رمز البوت",
+ "channelId": "معرّف القناة (اختياري)",
+ "channelPlaceholder": "C0123... أو اتركه فارغًا لأي قناة",
+ "port": "المنفذ",
+ "proactivePosting": "النشر الاستباقي (بمبادرة التطبيق) — معطّل افتراضيًا",
+ "start": "ابدأ",
+ "connectedBtn": "متصل",
+ "stop": "إيقاف",
+ "listening": "يستمع",
+ "stopped": "متوقّف",
+ "requestUrl": "عنوان الطلب - الصقه في Slack Event Subscriptions",
+ "lastRequestUrl": "آخر عنوان طلب - يعيد Slack استخدامه حتى تضغط إيقاف",
+ "slackHint": "في تطبيق Slack لديك: فعّل Event Subscriptions، وأضف حدث البوت message.channels / message.groups، واضبط عنوان الطلب أعلاه، ثم أعِد التثبيت في مساحة عملك. يتغيّر عنوان النفق عند كل إعادة تشغيل، فأعِد لصقه بعد الضغط على ابدأ مجددًا.",
+ "webhooks": "مشغّلات خطّافات الويب",
+ "showWebhookHelp": "اعرض صيغة واجهة خطّافات الويب",
+ "webhooksDesc": "نقطة نهاية واحدة لكل متصل، لكلٍّ سرّها ووضعها. وكلها تتشارك خادمًا واحدًا، فإضافة خطّاف آخر لا تكلّف شيئًا.",
+ "listeningOn": "● يستمع",
+ "notListening": "○ لا يستمع",
+ "addWebhook": "أضف خطّاف ويب",
+ "webhookWarning": "كل خطّاف ويب تفعّله هو نقطة نهاية عامة يستطيع أي شخص يملك سرّها أن يرسل إليها. تصل الجديدة معطّلة.",
+ "noWebhooks": "لا خطّافات ويب بعد. أضف واحدًا لتعطي أداةً عنوانًا تسلّم إليه العمل.",
+ "namePlaceholder": "ما الذي يستدعي هذا؟",
+ "sure": "متأكّد؟",
+ "url": "العنوان",
+ "endpointPlaceholder": "يبدأ بمجرد أن يستمع خادم خطّافات الويب",
+ "secret": "السرّ",
+ "rotate": "دوّره",
+ "mode": "الوضع",
+ "webhooksHint": "يرسل المتصلون طلب POST إلى عنوان الخطّاف مع سرّه في ترويسة x-md-webhook-secret. ويتحقّق كل خطّاف من الأجسام مقابل مخطّط JSON الخاص به — حرّره في تبويب المشغّلات داخل مركز قيادة {{godName}}، حيث يوجد أيضًا سجلّ كل ما وصل.",
+ "organisation": "المؤسسة",
+ "orgKey": "مفتاح المؤسسة",
+ "orgKeyDesc": "كيف تُخاطِب نسخةُ زميلك نسختَك.",
+ "apiKey": "مفتاح API",
+ "orgKeyPlaceholder": "الصق مفتاح مؤسستك",
+ "orgConfigOnly": "إعداد فقط في الوقت الحالي. خدمة مراسلة المؤسسة غير موجودة بعد، لذا لا يبدأ المفتاح هنا أي نقل — بل يُحفَظ ويُعرَض في تبويب المشغّلات وينتظر."
+ },
+ "voice": {
+ "freeFlow": "التدفّق الحر",
+ "freeFlowTitle": "التدفّق الحر (الإملاء الصوتي)",
+ "freeFlowDesc": "إملاء بالضغط للتحدّث: تكلّم، ويُسقِط Groq Whisper النص في محرّر الطابور.",
+ "groqKey": "مفتاح Groq API",
+ "groqPlaceholder": "gsk_... (احصل على مفتاح مجاني من console.groq.com)",
+ "model": "النموذج",
+ "fast": "whisper-large-v3-turbo (سريع)",
+ "accurate": "whisper-large-v3 (دقيق)",
+ "freeFlowHint": "طريقتان للإملاء: انقر زرّ الميكروفون فوق \"إرسال\" في محرّر الطابور (انقر للتسجيل، وانقر ثانيةً للتفريغ النصي)، أو — أثناء عرض طرفية أي وكيل — اضغط مع الاستمرار على Option (⌥) للتحدّث وأفلِت للتفريغ النصي. في الحالتين يصل النص إلى مسودّة المحرّر لتراجعه قبل الإرسال. سيطلب macOS إذن الميكروفون في أول تسجيل.",
+ "realtime": "{{godName}} الفوري",
+ "voiceChat": "محادثة صوتية مع {{godName}}",
+ "voiceChatDesc": "تحدّث إلى المنسّق في الوقت الفعلي. فعّلها من تبويب {{godName}}؛ واختر هنا الميكروفون والسمّاعة اللذين تستخدمهما الحلقة الصوتية.",
+ "openaiKey": "مفتاح OpenAI API · للصوت",
+ "openaiKeyDesc1": "يعمل التحدّث إلى {{godName}} على واجهة OpenAI الفورية — صوت داخل، وصوت خارج، عبر اتصال حيّ بـ{{model}}. وهي خدمة مختلفة عن اشتراك Claude الذي يعمل عليه وكلاؤك، لذا تحتاج مفتاح OpenAI API خاصًّا بها.",
+ "openaiKeyDesc2": "الصقه مرة واحدة أدناه. يُشفَّر على هذا الجهاز ولا يُعرَض ثانيةً أبدًا — إذ تُصدِر كل جلسة صوتية رمزًا قصير العمر منه، ولا يغادر المفتاح نفسه حاسوبك. وهو نفس مفتاح OpenAI المدرَج تحت \"الوكلاء والنماذج\"؛ ويكفي ضبطه في أي من الموضعين.",
+ "keyPlaceholderSaved": "المفتاح محفوظ — الصق واحدًا جديدًا لاستبداله",
+ "save": "حفظ",
+ "keySaved": "حُفِظ المفتاح — التحدّث جاهز. ابدأه من بطاقة {{godName}}.",
+ "noKey": "لا مفتاح بعد — يبقى التحدّث معطّلًا حتى يُحفَظ واحد.",
+ "keySavedNote": "حُفِظ المفتاح — التحدّث جاهز.",
+ "couldNotSave": "تعذّر حفظ المفتاح.",
+ "idleDisconnect": "قطع الاتصال تلقائيًا عند الخمول",
+ "30s": "30 ثانية",
+ "1m": "دقيقة واحدة",
+ "2m": "دقيقتان",
+ "3m": "3 دقائق",
+ "5m": "5 دقائق",
+ "10m": "10 دقائق",
+ "never": "معطّل (أبدًا)",
+ "idleDisconnectDesc": "كم تبقى الجلسة الصوتية مفتوحة بلا كلام قبل أن تُغلَق تلقائيًا. ويظل سقف الإنفاق يوقف الجلسة الشاردة حتى لو كان هذا معطّلًا."
+ },
+ "saved": "حُفِظ",
+ "saving": "جارٍ الحفظ…",
+ "unsavedChanges": "تغييرات غير محفوظة",
+ "unsavedWarning": "لديك إعدادات غير محفوظة. أأغلق على أي حال وأفقدها؟"
+ },
+ "commandCenter": {
+ "title": "مركز القيادة",
+ "runsTheFloor": "{{name}} يُدير الأرضية",
+ "deliveryPaused": "موقوف",
+ "deliveryAuto": "تلقائي",
+ "deliveryPausedTitle": "الرسائل المصفوفة محتجزة لكل وكيل على الأرضية. لا يضيع شيء؛ وتُسلَّم بمجرد إعادة تشغيل هذا.",
+ "deliveryOnTitle": "تُسلَّم الرسائل المصفوفة إلى كل وكيل تلقائيًا. انقر لاحتجاز الأرضية كلها.",
+ "ideTitle": "افتح بيئة التطوير: تصفّح وحرّر الملفات في مساحة عمل الوكيل المحدَّد، واعرض التغييرات غير المودعة كفروقات.",
+ "ide": "بيئة التطوير",
+ "tabs": {
+ "terminal": "الطرفية",
+ "floor": "المراقبة",
+ "tasks": "المهام",
+ "human": "اسألني",
+ "triggers": "المشغّلات",
+ "history": "السجل",
+ "memory": "الذاكرة",
+ "graph": "الرسم",
+ "activity": "النشاط",
+ "skills": "المهارات",
+ "workers": "العمّال"
+ },
+ "terminalFullscreen": "الطرفية مفتوحة بملء الشاشة. اضغط Esc لإعادتها.",
+ "noTerminal": "{{name}} ليس لديه طرفية حيّة.",
+ "dispatchViaMichael": "إرسال — عبر {{godName}}",
+ "suggestedOwner": "المالك المقترَح",
+ "michaelDecides": "{{godName}} يقرّر",
+ "dispatchPlaceholder": "صِف المهمة… ({{godName}} يفكّكها ويكتب البطاقة ويُسنِدها)",
+ "dispatch": "أرسل",
+ "sentToMichael": "أُرسلت إلى {{godName}}",
+ "sentToWithSuggestion": "أُرسلت إلى {{godName}} (باقتراح {{name}})",
+ "dispatchFailed": "فشل: {{error}}",
+ "dispatchSuggestion": "(يقترح المستخدم {{name}} ({{id}}) لهذه المهمة — والقرار لك كمنسّق.)",
+ "taskFromHuman": "مهمة من المستخدم",
+ "agents": "الوكلاء",
+ "godTag": " (الإله)",
+ "toolCalls": "{{count}} استدعاء أداة",
+ "rate": "المعدّل",
+ "budget": "الميزانية",
+ "meterTitle": "الاستخدام التراكمي للجلسة: {{used}} من {{limit}} رمز{{note}} — وليس نافذة السياق",
+ "agentLimit": " (حدّ الوكيل)",
+ "floorBudget": " (ميزانية الأرضية)",
+ "ctx": "سياق",
+ "contextTitle": "نافذة السياق: {{used}} من {{limit}} رمز ({{pct}}%)",
+ "noStatusTick": "لا نبضة حالة بعد",
+ "modelRestarts": "نموذج {{provider}} (يُعيد تشغيل الوكيل)",
+ "restartContinue": "أعِد التشغيل وتابع",
+ "restartContinueTitle": "أنهِ {{name}} وأعِد إنشاءه مع استئناف محادثته الحالية — يُصلح طرفية تالفة أو مشوّشة دون فقدان السياق",
+ "engine": "المحرّك:",
+ "apply": "طبّق",
+ "confirmRestartEngine": "هذا يُعيد تشغيل {{name}}؛ ولا يمكن استئناف محادثة على محرّك مختلف.",
+ "restartFailed": "فشلت إعادة التشغيل.",
+ "archived": "مؤرشَف ({{count}})",
+ "showClosed": "أظهر الوكلاء المغلقين",
+ "hideClosed": "أخفِ الوكلاء المغلقين",
+ "directories": "المجلدات",
+ "noRepos": "لا مستودعات مسجَّلة.",
+ "openInTerminal": "افتح في Terminal.app",
+ "issues": "المشكلات",
+ "fetching": "جارٍ الجلب…",
+ "fetchIssues": "اجلب المشكلات",
+ "noRepoSelected": "لم يُحدَّد مستودع.",
+ "fetchFailed": "فشل جلب المشكلات.",
+ "noIssues": "لم تُجلَب أي مشكلات بعد.",
+ "assign": "أسنِد",
+ "textSearch": "بحث نصّي (اللوحة، المهام، الذاكرة)",
+ "textSearchPlaceholder": "ابحث عن نص حرفي عبر ملفات الخلية…",
+ "nothingMatched": "لا نتائج مطابقة.",
+ "searchNoMatch": "لا نتائج مطابقة بعد.",
+ "semanticSearch": "بحث دلالي (MemPalace)",
+ "semanticPlaceholder": "ماذا تعرف الخلية عن…",
+ "memoryFile": "ملف الذاكرة",
+ "noMemory": "لم تُسجَّل أي ذاكرة بعد.",
+ "activity": "النشاط",
+ "nothingYet": "لا شيء بعد.",
+ "board": "اللوحة",
+ "boardEmpty": "اللوحة فارغة.",
+ "logSpawn": "أُنشئ {{name}}",
+ "logMessage": "{{from}} ← {{to}}: {{subject}}",
+ "logDrain": "سحب {{agent}} عدد {{count}} رسالة",
+ "logEscalate": "صُعِّد إلى المستخدم: {{subject}}",
+ "logApprovalGranted": "مُنحت الموافقة",
+ "logApprovalDenied": "رُفضت الموافقة",
+ "tokenLimitTitle": "اضبط الحدّ الكلي لرموز هذا الوكيل",
+ "tokenLimit": "الحدّ {{value}}",
+ "setLimit": "اضبط الحدّ",
+ "saveLimit": "احفظ الحدّ",
+ "fleetTokens": "Σ {{value}} رمز",
+ "fleetInputs": "المدخلات {{value}} (مخبّأ {{pct}}%)",
+ "fleetRate": "{{value}} رمز/دقيقة",
+ "telemetryNote": "حيّ من قياسات OpenTelemetry لكل وكيل · تُظهر الأشرطة الرموز المستخدَمة مقابل حدّ كل وكيل، وإلا فميزانية الأرضية البالغة {{cap}}",
+ "defaultBudgetNote": " (افتراضي — اضبط ميزانية رموز للأرضية في الإعدادات)",
+ "openIssue": "مشكلة GitHub رقم {{num}}: {{title}}",
+ "deliveryResumeAria": "استأنف التسليم التلقائي للأرضية كلها",
+ "deliveryHoldAria": "احتجز التسليم التلقائي للأرضية كلها",
+ "openIdeAria": "افتح بيئة التطوير"
+ },
+ "addAgent": {
+ "title": "إضافة وكيل",
+ "hireImported": "استُورد التعيين:",
+ "byAuthor": " · بواسطة {{author}}",
+ "reviewFields": "راجع كل حقل — وخاصة الأمر — قبل الإنشاء.",
+ "hireFlags": "⚠️ الرايات التي يضيفها هذا التعيين إلى الأمر:",
+ "hireSkills": "المهارات التي يفعّلها هذا التعيين:",
+ "mcpSafe": "خوادم MCP (آمنة، مفعّلة مسبقًا):",
+ "mcpConsent": "⚠️ MCP (تحتاج موافقتك — غير مفعّلة تلقائيًا):",
+ "mcpEnableInSettings": "— فعّلها في الإعدادات ← MCP بعد المراجعة",
+ "sections": {
+ "identity": {
+ "label": "الهوية",
+ "hint": "الاسم · الشخصية · اللون"
+ },
+ "workspace": {
+ "label": "مساحة العمل",
+ "hint": "المجلد · العزل · الاستئناف"
+ },
+ "engine": {
+ "label": "المحرّك",
+ "hint": "المزوّد · النموذج · الأمر"
+ },
+ "briefing": {
+ "label": "الإحاطة",
+ "hint": "الوصف · الهدف"
+ }
+ },
+ "name": "الاسم",
+ "namePlaceholder": "Ada",
+ "character": "الشخصية",
+ "color": "اللون",
+ "project": "المشروع",
+ "pickProject": "اختر مشروعًا، أو أضف واحدًا جديدًا:",
+ "noProjects": "لا مشاريع بعد — أضف واحدًا للبدء:",
+ "addProject": "أضف مشروعًا",
+ "addProjectTitle": "اختر مجلدًا وسجّله كمشروع",
+ "projectPlaceholder": "/path/to/your/project",
+ "pick": "اختر",
+ "saveAsProject": "احفظ كمشروع",
+ "saveAsProjectTitle": "احفظ هذا المجلد في مشاريعك ليصبح اختيارًا بنقرة واحدة في المرة القادمة",
+ "gitIsolation": "عزل git (شجرة عمل خاصة)",
+ "resumeSession": "معرّف جلسة للاستئناف (اختياري)",
+ "resumePlaceholder": "الصق معرّف جلسة Claude لمتابعة محادثتها",
+ "folderFromSession": "المجلد مضبوط من الجلسة: {{path}}",
+ "resumeNote": "سيستأنف هذه الجلسة في المجلد المختار (عزل git معطّل).",
+ "provider": "المزوّد",
+ "providerAntigravity": "أنشئ أداة Antigravity (agy) بنموذج Gemini",
+ "providerCodex": "أنشئ أداة Codex (codex) بلا رايات خاصة بـClaude",
+ "providerCustom": "شغّل أي أمر — بلا رايات خاصة بـClaude",
+ "model": "النموذج",
+ "cliDefaultModel": "النموذج الافتراضي للـCLI",
+ "fromHire": "{{model}} (من التعيين)",
+ "ossModels": "نماذج مفتوحة المصدر",
+ "ossLocal": "محلي · بلا مفتاح (Ollama / LM Studio)",
+ "ossByok": "عبر مزوّد مفتوح · بمفتاحك",
+ "ossLocalTitle": "{{slug}} · يحتاج ~{{ram}} من الذاكرة — اجلبه بـ: ollama pull {{tag}}",
+ "ossByokTitle": "{{slug}} · اضبط {{keyEnv}} في الإعدادات ← محرّكات الذكاء الاصطناعي",
+ "byokNote": "مفاتيحك ونقاط النهاية المحلية لهذا المحرّك موجودة في الإعدادات ← محرّكات الذكاء الاصطناعي. جديد على النماذج المحلية؟ اقرأ \"شغّل على نماذج مفتوحة\" أو \"أعِدّه على جهاز Mac Mini\". التحقّق الحيّ الكامل ينتظر استدعاءات نماذج حقيقية (تحقّق على جهازك).",
+ "runOnOpenModels": "شغّل على نماذج مفتوحة",
+ "setUpMacMini": "أعِدّه على جهاز Mac Mini",
+ "command": "الأمر",
+ "commandAuto": "الأمر (الوضع التلقائي مفعّل)",
+ "templates": "القوالب",
+ "templatesHint": {
+ "repoJanitor": {
+ "label": "مُنظِّف المستودع"
+ },
+ "docsWriter": {
+ "label": "كاتب التوثيق"
+ },
+ "bugTriager": {
+ "label": "فارز العلل"
+ },
+ "researchAssistant": {
+ "label": "مساعد البحث"
+ },
+ "releaseManager": {
+ "label": "مدير الإصدارات"
+ }
+ },
+ "description": "الوصف",
+ "descriptionPlaceholder": "الوظيفة — الغرض من هذا الوكيل، لا حالته الحيّة",
+ "goal": "الهدف (اختياري)",
+ "goalPlaceholder": "توجيه طويل الأمد يُحقَن في كل موجّه",
+ "importHire": "استورد تعيينًا",
+ "importHireDesc": "يحمّل استيراد التعيين وكيلًا جاهزًا من ملف .json — ويملأ كل حقل أدناه لتراجعه. لا يُنشأ شيء حتى تضغط \"إنشاء\".",
+ "generateWithAI": "ولّد واحدًا بالذكاء الاصطناعي…",
+ "hideAIPrompt": "أخفِ موجّه الذكاء الاصطناعي",
+ "aiPromptHint": "انسخ هذا إلى Claude/ChatGPT/Gemini، واملأ التفاصيل في الأسفل، ثم احفظ ردّه بصيغة JSON في ملف ‎.json واستورده هنا.",
+ "copied": "نُسخ ✓",
+ "copyPrompt": "انسخ الموجّه",
+ "importHireBtn": "استورد تعيينًا…",
+ "importHireBtnTitle": "استورد بيان تعيين (‎.json)",
+ "spawn": "إنشاء",
+ "spawning": "جارٍ الإنشاء...",
+ "errName": "الاسم مطلوب",
+ "errFolder": "اختر مجلدًا أولًا",
+ "errCommand": "الأمر مطلوب",
+ "hireProgress": "التعيين {{current}} من {{total}}",
+ "skipHire": "تخطَّ التعيين"
+ },
+ "onboarding": {
+ "titles": {
+ "persona": "أهلًا بك في MUNDER DIFFLIN",
+ "welcome": "تعرَّف على مكتبك",
+ "home": "الخطوة 1 من 4 · منزل المنصّة",
+ "homePlain": "الخطوة 1 من 4 · منزل للتطبيق",
+ "orchestrator": "الخطوة 2 من 4 · محرّك نسختك",
+ "orchestratorPlain": "الخطوة 2 من 4 · نسختك",
+ "repos": "الخطوة 3 من 4 · مستودعاتك",
+ "reposPlain": "الخطوة 3 من 4 · مشاريعك",
+ "permissions": "الخطوة 4 من 4 · الأذونات والموثوقية",
+ "done": "كل شيء جاهز"
+ },
+ "persona": {
+ "headline": "نسخة منك، تعمل على مدار الساعة",
+ "body": "يحوّل Munder Difflin وكيل الـCLI الذي تستخدمه أصلًا إلى نسخة منك — نسخة تُدير مكتبًا من الوكلاء طويلي العمل وتواصل العمل وأنت غائب. وهو يتولّى كل ما حولهم: السياق والذاكرة والمهام والمشغّلات والبيئة والملفات والتكاملات.",
+ "bodyLocal": " كل شيء يعمل على هذا الجهاز.",
+ "ask": "أولًا — من أنت؟ (سنُفصّل الإعداد على مقاسك)",
+ "technicalTitle": "أنا تقني",
+ "technicalDesc": "أكتب الشيفرة أو أعمل في الطرفية. اعرض لي أوامر الـCLI والرايات ومعرّفات النماذج.",
+ "nonTechnicalTitle": "أنا غير تقني",
+ "nonTechnicalDesc": "أعمل في التسويق أو المبيعات أو العمليات، أو أنا في بداية الطريق. اشرح لي الأمور بلغة واضحة."
+ },
+ "welcome": {
+ "headline": "نسختك والأرضية التي تُديرها",
+ "descPlain": "تُدير نسختك مكتبًا صغيرًا من العاملين بالذكاء الاصطناعي، وأنت تراقب كل ذلك من شاشة واحدة. إليك ما بالداخل:",
+ "desc": "تنسّق نسختك خليةً من وكلاء البرمجة بالذكاء الاصطناعي — دائمين، وقابلين للمراقبة، وكلهم محليون. إليك ما بالداخل:",
+ "features": {
+ "engines": {
+ "label": "أحد عشر محرّكًا، مكتب واحد",
+ "desc": "Claude Code وCodex وGrok وKimi وAntigravity وQwen وOpenCode وCrush وpi وCopilot وCursor — وكلاء أحياء على أرضية واحدة.",
+ "descPlain": "أحد عشر مساعدًا ذكيًا — Claude وCodex وCursor وGemini وGrok وغيرهم — يعملون جنبًا إلى جنب في مكتب واحد مشترك."
+ },
+ "clone": {
+ "label": "{{godName}} هو نسختك",
+ "desc": "تُدير نسختك الأرضية — تفرز الطلبات، وتوجّه المهام، ولا تُصعِّد إليك إلا ما يحتاجك فعلًا.",
+ "descPlain": "نسختك، {{godName}}، تتلقّى طلباتك وتسلّم العمل إلى الوكيل المناسب، ولا تقاطعك إلا عندما يستحقّ الأمر."
+ },
+ "memory": {
+ "label": "ذاكرة طويلة الأمد",
+ "desc": "يحتفظ كل وكيل بملاحظاته، وتُستخرَج في MemPalace مشترك وقابل للبحث.",
+ "descPlain": "يتذكّر الوكلاء ما فعلوه، فلا يبدأون من الصفر في كل مرة."
+ },
+ "commandCenter": {
+ "label": "مركز القيادة",
+ "desc": "الطرفية · الأرضية · الذاكرة · النشاط · المهام · المشغّلات في سطح تحكّم واحد.",
+ "descPlain": "لوحة واحدة لمراقبة العمل وذاكرة الوكلاء والمهام والمشغّلات."
+ },
+ "guardrails": {
+ "label": "حواجز الأمان",
+ "desc": "ميزانيات رموز لكل وكيل، وقاطع دائرة يوجّه ثم يقيّد ثم يوقف، وموافقات بشرية.",
+ "descPlain": "حدود إنفاق ومكابح أمان تُبقي الوكلاء منضبطين — ويستطيعون سؤالك قبل الإجراءات الكبيرة."
+ },
+ "hires": {
+ "label": "تعيينات جاهزة",
+ "desc": "خذ وكيلًا مُعدًّا مسبقًا من معرض الوكلاء وأنشئه بنقرة واحدة.",
+ "descPlain": "عيّن وكيلًا جاهزًا من المعرض بنقرة واحدة — بلا أي إعداد."
+ }
+ }
+ },
+ "providerBlurb": {
+ "claude": "Claude Code — Anthropic",
+ "codex": "Codex — OpenAI",
+ "antigravity": "Antigravity — Google Gemini",
+ "qwen": "Qwen — يشغّل نموذج Qwen محليًا على جهازك",
+ "gemini": "Gemini CLI - Google Gemini",
+ "cursor": "Cursor Agent CLI — يستخدم أرصدة Cursor لديك (Luna، Composer، …)"
+ },
+ "home": {
+ "descPlain": "أنشئ مجلدًا جديدًا فارغًا ليتّخذه التطبيق منزلًا. كل ما يتذكّره التطبيق — إعداداته الخاصة وذاكرة وكلائك — يُخزَّن هنا. شيء مثل ~/HarnessAgents يفي بالغرض. وسننشئه لك إن لم يكن موجودًا.",
+ "desc": "اختر مجلدًا تحفظ فيه المنصّة ملفاتها — بيانات الوكلاء والسجلات وأي مستودعات جديدة تنشئها من هنا. شيء مثل ~/HarnessAgents خيار افتراضي جيد. وسننشئه إن لم يكن موجودًا.",
+ "placeholder": "/path/to/HarnessAgents",
+ "createPick": "أنشئ / اختر",
+ "pick": "اختر",
+ "notePlain": "لن تحتاج إلى فتح هذا المجلد يوميًا — فهو ببساطة حيث يحفظ التطبيق ملاحظاته كي لا يضيع شيء عند إعادة التشغيل.",
+ "note": "اعتبره \"مبنى البلدية\". تثبّت المنصّة حالة الوكلاء هناك ليمكن استئناف الجلسات بعد إعادة التشغيل."
+ },
+ "orchestrator": {
+ "descPlain": "{{godName}} هو نسختك — يقرأ طلباتك، ويفكّكها إلى مهام، ويسلّمها إلى الوكيل المناسب. هو مدير الأرضية؛ وأنت ما زلت مديره. اختر محرّك الذكاء الاصطناعي الذي يشغّله.",
+ "desc": "{{godName}} هو نسختك — مدير الأرضية الذي قابلته للتوّ. يفرز طلباتك، ويُسنِد المهام، ويُدير الفريق، ويُصعِّد كل ما يحتاجك فعلًا. اختر المحرّك والنموذج اللذين يشغّلانه؛ وأعطِه نموذجًا بسياق أطول وقدرة أعلى.",
+ "cliAgentPlain": "<strong>وكيل الـCLI</strong> مساعد برمجة ذكي يعمل على حاسوبك — وأشهرها Claude Code (من Anthropic) وCodex (من OpenAI) وAntigravity (من Google Gemini). و<strong>نسختك</strong> هي الوكيل الدائم الذي يُدير مكتبك كله. ننصح بـClaude Code على Opus 4.8 (1M). ويمكنك إضافة الباقي أو التبديل إليها لاحقًا.",
+ "cliAgent": "كل خيار هو <strong>محرّك CLI</strong> (Claude Code أو Codex أو Antigravity/Gemini أو وسيط محلي مثل Qwen). المحرّكات المعلَّمة بـINSTALLED موجودة على هذا الجهاز؛ وINSTALLS ON FIRST RUN يعني أن التطبيق يُعِدّها عند أول تشغيل لـ{{godName}}. و<strong>نسختك</strong> ({{godName}}) هي المحرّك الذي ينسّق الخلية كلها. الموصى به: Claude Code · Opus 4.8 · 1M. ويمكن ربط مزوّدين آخرين لكل وكيل لاحقًا.",
+ "recommended": "موصى به",
+ "model": "النموذج",
+ "modelNote": "هذا يضبط محرّك {{godName}} فقط. ويمكنك تشغيل مزوّدين آخرين لكل وكيل لاحقًا."
+ },
+ "repos": {
+ "descPlain": "أضف مشاريعك. المشروع ببساطة مجلد — قد يحتوي شيفرة أو مستندات أو ملاحظات أو أي ملفات تريد أن يعمل عليها وكلاؤك. يمكنك إنشاء مجلد جديد تمامًا أو اختيار مجلد موجود، وإضافة المزيد في أي وقت.",
+ "desc": "أضف المستودعات التي تريد أن يعمل فيها وكلاؤك. يصبح كل مجلد مشروعًا (غرفة على الأرضية) — ويمكن لعدة وكلاء أن يتشاركوا واحدًا. ويمكنك إضافة المزيد لاحقًا.",
+ "emptyPlain": "لا مشاريع مضافة بعد. اختياري — يمكنك إضافة واحد لاحقًا.",
+ "empty": "لا مستودعات مضافة بعد. اختياري، لكنه موصى به.",
+ "addProject": "أضف مشروعًا",
+ "addRepo": "أضف مستودعًا"
+ },
+ "permissions": {
+ "autonomyHead": "كم يستطيع الوكلاء أن يفعلوا وحدهم؟",
+ "autoLabelPlain": "دع الوكلاء يعملون وحدهم",
+ "autoLabel": "العمل باستقلالية (الوضع التلقائي)",
+ "autoOnPlain": "مفعّل. ينفّذ الوكلاء المهام دون التوقّف للسؤال — وهي أسلس تجربة.",
+ "autoOffPlain": "معطّل. يتوقّف الوكلاء ويسألونك قبل تغيير الملفات أو تشغيل الأوامر.",
+ "autoOn": "مفعّل. لا يتوقّف الوكلاء أبدًا — يعمل Claude بـbypassPermissions، ويتجاوز Codex الموافقات والصندوق الرملي، وهكذا.",
+ "autoOff": "معطّل. يسأل كل وكيل قبل التعديلات وأوامر الصدفة (افتراضي Claude، وcodex -a untrusted، …).",
+ "autoNotePlain": "الأفضل حين يعمل الوكلاء في مشاريعهم الخاصة. ويمكنك تغيير هذا لاحقًا، بما في ذلك لكل وكيل على حدة.",
+ "autoNote": "الخيار الافتراضي الصحيح لتجربة \"غرفة التحكّم\"؛ وفخّ على مستودعات الإنتاج. تجاوِزه لكل وكيل في نافذة إضافة وكيل.",
+ "reliabilityHead": "أبقِ كل شيء يعمل وأنت غائب",
+ "reliabilityDescPlain": "يواصل وكلاؤك العمل وفق جدول وفي طرفيات حيّة، حتى حين تبتعد. تُبقيك هذه الإعدادات على اطّلاع وتُبقي كل شيء يعمل.",
+ "reliabilityDesc": "يواصل وكلاؤك العمل وفق جدول وفي طرفيات حيّة. وإن نام جهاز Mac تمامًا توقّفت تلك المؤقّتات ثم لحقت بما فاتها لحظة عودتك — لا يضيع شيء، لكنه قد يتأخّر.",
+ "keepAwake": "واصِل العمل أثناء غيابك",
+ "keepAwakeDesc": "إبقاء قوي على الاستيقاظ: يمنع جهاز Mac من النوم ما دام وكيل نشطًا، لتعمل الجداول والطرفيات في وقتها حتى حين تبتعد. يستهلك بطارية أكثر — الأفضل عند التوصيل بالكهرباء. معطّل افتراضيًا.",
+ "notifications": "إشعارات سطح المكتب",
+ "notificationsDesc": "تصلك تنبيهات حين يحتاجك وكيل أو تحتاج طرفية إلى إنعاش — حتى وأنت بعيد. يطلب macOS الإذن عند أول إشعار.",
+ "openAtLogin": "الفتح عند تسجيل الدخول",
+ "openAtLoginDesc": "أعِد تشغيل المنصّة بعد إقلاع الجهاز لتستأنف المهام المجدولة وحدها. بلا سؤال — يسري فورًا.",
+ "shareStats": "شارك إحصاءات استخدام مجهولة",
+ "shareStatsDesc": "حفنة من الأحداث المجهولة (فتح التطبيق، إنشاء وكيل، استخدام ميزة) تساعد على تحسين Munder Difflin — لا موجّهات ولا شيفرة ولا مسارات ملفات ولا مخرجات وكلاء أبدًا. القائمة الكاملة في TELEMETRY.md؛ ويمكن تغييرها في أي وقت من الإعدادات.",
+ "stayAwake": "ابقَ مستيقظًا عند التوصيل بالكهرباء (يدويًا)",
+ "stayAwakeDesc": "لا يسمح لك macOS بضبط هذا إلا بنفسك. من البطارية ← خيارات، فعّل \"منع النوم التلقائي عند إطفاء الشاشة\" (عند التوصيل بمحوّل الطاقة) لتستمر المؤقّتات في العمل والشاشة نائمة. وبدون إعداد يمنع النوم يظل جهاز Mac ينام فعلًا — يبقى العمل سليمًا ويلحق بما فاته عند الاستيقاظ.",
+ "openBattery": "افتح إعدادات البطارية",
+ "setItUp": "أعِدّه",
+ "next": "التالي"
+ },
+ "errPickHome": "اختر مجلد منزل للمنصّة أولًا.",
+ "errCreateHome": "تعذّر إنشاء منزل المنصّة",
+ "errEngineNotInstalled": "{{label}} غير مثبَّت. ثبّته واضغط \"تحقّق مجددًا\"، أو اختر محرّكًا آخر."
+ },
+ "office": {
+ "gpuError": "فقدت أرضية المكتب سياق معالج الرسوميات.\n\nعدد كبير جدًا من الطرفيات يستخدم المعالج الرسومي في آنٍ واحد.\nأغلق بعض طرفيات الوكلاء، أو أعِد تشغيل التطبيق، لاستعادتها.",
+ "errand": {
+ "water": [
+ "أسقي النباتات 🌿",
+ "أعطي النباتات رشفة ماء",
+ "تكبر بسرعة!"
+ ],
+ "window": [
+ "أُدخل بعض الهواء 🍃",
+ "قليل من الهواء المنعش",
+ "نسمة لطيفة اليوم"
+ ],
+ "dispenser": [
+ "أجلب بعض الماء 💧",
+ "استراحة ارتواء",
+ "أبقى متيقّظًا"
+ ],
+ "fridge": [
+ "هل في الثلاجة شيء طيّب؟",
+ "من أخذ زبادي؟",
+ "أتفرّج فقط…"
+ ],
+ "shelf": [
+ "أتفقّد الرفّ 📚",
+ "أثمّة جديد هنا؟",
+ "كم من الأشياء الجميلة"
+ ],
+ "bin": [
+ "أتخلّص من الورق المهمَل 🗑️",
+ "يوم ترتيب المكتب",
+ "أرتّب قليلًا"
+ ],
+ "smoke": [
+ "الأرضية تُدير نفسها 🚬",
+ "استراحة المدير.",
+ "أفكّر أفكارًا كبيرة 🚬",
+ "أُعلن… استراحة"
+ ]
+ },
+ "suckUp": [
+ "أنجزتُ {{done}} مهمة بالفعل يا {{godName}}. زيادة؟ 🥺",
+ "{{done}} مهمة أُنجزت هذا الأسبوع يا مدير!",
+ "رؤية رائعة كعادتك يا مدير!",
+ "كنتُ على وشك فعل ذلك تمامًا!",
+ "أعجبتني ربطة عنقك اليوم يا {{godName}}",
+ "أعمل بجدّ يا مدير! 💪",
+ "أفضل مدير على الإطلاق. بصدق."
+ ],
+ "gossip": [
+ "هل كتب سطر شيفرة واحدًا في حياته؟",
+ "\"اجتماع سريع\" آخر استغرق ساعة…",
+ "\"أفضل مدير في العالم\" — هو من اشترى ذلك الكوب بنفسه",
+ "نسب مهمتي إلى نفسه على أنها فكرته",
+ "رائحة السيجار، بصراحة…",
+ "سقى النبتة. نبتة واحدة. نبتته هو.",
+ "أسمعتَه؟ \"أُعلن… استراحة\""
+ ],
+ "cheer": [
+ "تم! ✔",
+ "أتقنتُها",
+ "وانتهى الأمر",
+ "أطلقها 🚀",
+ "واحدة أخرى انتهت",
+ "سحقتُها",
+ "في السجلّ"
+ ],
+ "mugs": {
+ "empty": "لم يبقَ كوب نظيف…",
+ "brewing": "أُعِدّ كوبًا طازجًا ☕",
+ "washing": "أغسل الكوب"
+ },
+ "activity": {
+ "waiting": "ينتظر",
+ "needsYou": "بحاجة إليك",
+ "compacting": "يضغط السياق",
+ "looping": "يدور في حلقة — القاطع مسلَّح",
+ "runningFloor": "يُدير الأرضية",
+ "idle": "خامل"
+ }
+ },
+ "setupPanel": {
+ "title": "المتطلّبات",
+ "checking": "جارٍ التحقّق ممّا هو مثبَّت…",
+ "summary": "{{ready}} من {{total}} جاهز{{missing}}",
+ "summaryMissing": " · {{count}} أداة موصى بها ناقصة",
+ "recheck": "أعِد الفحص",
+ "checkingBtn": "جارٍ الفحص…",
+ "statusReady": "جاهز",
+ "statusMissing": "ناقص",
+ "statusNotSetUp": "غير مُعدّ",
+ "recommended": "موصى به",
+ "docs": "التوثيق ←",
+ "askDesc": "يستطيع {{godName}} تثبيت الأداة الموصى بها الناقصة البالغ عددها {{count}} نيابةً عنك. هذا يملأ صندوق الإرسال لديه — ولا يعمل شيء حتى تضغط \"أرسل\".",
+ "askDescPlural": "يستطيع {{godName}} تثبيت الأدوات الموصى بها الناقصة البالغ عددها {{count}} نيابةً عنك. هذا يملأ صندوق الإرسال لديه — ولا يعمل شيء حتى تضغط \"أرسل\".",
+ "allReady": "كل ما هو موصى به مثبَّت. المحرّكات المفردة أعلاه اختيارية — أعِدّ ما تستخدمه فقط.",
+ "askMichael": "اطلب من {{godName}} إعداد كل شيء",
+ "sections": {
+ "prerequisites": {
+ "title": "المتطلّبات",
+ "blurb": "الأساس الذي يُبنى عليه كل شيء آخر."
+ },
+ "memory": {
+ "title": "طبقة الذاكرة",
+ "blurb": "استرجاع بالمعنى عبر كل ما يتعلّمه وكلاؤك."
+ },
+ "engine": {
+ "title": "محرّكات الوكلاء",
+ "blurb": "أدوات الـCLI التي يعمل عليها وكلاؤك. تحتاج ما تستخدمه فعلًا منها — لا كلها."
+ }
+ }
+ },
+ "aiEngines": {
+ "providers": "مزوّدو محرّكات الذكاء الاصطناعي (بمفتاحك)",
+ "providersDesc": "مفاتيح API ونقاط النهاية المحلية لمحرّكات OpenCode وCrush وpi.dev وQwen. تُخزَّن المفاتيح للكتابة فقط (مشفَّرة عند التخزين؛ ولا تُعرض ثانيةً) وتُستخدم فقط عند إنشاء تلك المحرّكات. أمّا Claude Code وCodex فيستخدمان تسجيل الدخول الخاص بهما.",
+ "apiKeys": "مفاتيح API",
+ "setCheck": "مضبوط ✓",
+ "keyStoredPlaceholder": "•••••••• (مخزَّن — اكتب للاستبدال)",
+ "keyPlaceholder": "الصق مفتاح {{label}}",
+ "saved": "حُفِظ",
+ "failed": "فشل",
+ "cleared": "مُسح",
+ "localEndpoint": "نقطة نهاية محلية · النموذج الافتراضي (لكل محرّك)",
+ "defaultModelPlaceholder": "النموذج الافتراضي (مزوّد/نموذج)",
+ "runningOpenModels": "تشغّل نماذج مفتوحة؟ أدلّة خطوة بخطوة:",
+ "runOnOpenModels": "شغّل Munder Difflin على نماذج مفتوحة",
+ "setUpMacMini": "أعِدّه على جهاز Mac Mini",
+ "autoModeCaveat": "⚠ في الوضع التلقائي تعمل هذه المحرّكات بصلاحية كاملة على نظام الملفات والصدفة (بلا صندوق رملي) — مثل وضع التجاوز لدى Claude. أوقف الوضع التلقائي (عام) لتجعلها تسأل أولًا. التحقّق الحيّ الكامل باستدعاءات نماذج حقيقية ينتظر مفاتيحك أو نموذجًا محليًا."
+ },
+ "mcpDefaults": {
+ "title": "خوادم MCP الافتراضية",
+ "desc": "تُدمج هذه الخوادم في إعدادات جلسة كل وكيل جديد. الخوادم الآمنة مفعّلة افتراضيًا؛ أمّا خوادم الكتابة والأسرار فمعطّلة حتى توافق عليها. تسري التغييرات عند إنشاء الوكيل التالي — الوكلاء العاملون لا يتأثّرون.",
+ "toggleNote": "{{id}}: {{state}}",
+ "couldNotSave": "تعذّر الحفظ",
+ "tiers": {
+ "safeReadonly": "آمنة وللقراءة فقط (مفعّلة افتراضيًا)",
+ "write": "صلاحية كتابة (تتطلّب موافقتك)",
+ "secret": "تتطلّب سرًّا / مفتاح API (تتطلّب موافقتك)",
+ "safeReadonlyNote": "تقرأ هذه الخوادم البيانات فقط، ولا تحتاج أي أسرار، ونطاقها محصور بمساحة عمل الوكيل. وهي مفعّلة لكل وكيل جديد.",
+ "writeNote": "تستطيع هذه الخوادم تغيير الحالة خارج مساحة العمل. معطّلة افتراضيًا — لا تفعّلها إلا بعد المراجعة.",
+ "secretNote": "تتطلّب هذه الخوادم مفتاح API أو بيانات اعتماد. معطّلة افتراضيًا — أضف بياناتك ثم فعّلها بعد الموافقة."
+ }
+ },
+ "devicePicker": {
+ "microphone": "الميكروفون",
+ "speaker": "السمّاعة",
+ "systemDefault": "افتراضي النظام",
+ "namesHint": "تظهر أسماء الأجهزة بعد أول جلسة صوتية تبدأها وتمنح فيها إذن الميكروفون. يُطبَّق اختيار الميكروفون في المرة القادمة التي يتصل فيها {{godName}}؛ أمّا السمّاعة فتتبدّل مباشرةً."
+ },
+ "realtimeToggle": {
+ "talk": "تحدّث",
+ "connecting": "…",
+ "listening": "يستمع",
+ "speaking": "يتحدّث",
+ "working": "يعمل",
+ "helpOff": "تحدّث إلى {{godName}} — ابدأ الجلسة الصوتية",
+ "helpConnecting": "جارٍ الاتصال بـ {{godName}}…",
+ "helpListening": "يستمع — {{godName}} يسمعك (انقر للإيقاف)",
+ "helpSpeaking": "{{godName}} يتحدّث (انقر للإيقاف)",
+ "helpWorking": "{{godName}} يشغّل أداة — الميكروفون مكتوم (انقر للإيقاف)",
+ "noKeyTitle": "تحتاج ميزة التحدّث إلى مفتاح OpenAI API (يُستخدَم لواجهة الصوت الفورية). أضفه في الإعدادات ← الصوت.",
+ "whyDisabled": "لماذا التحدّث معطّل؟",
+ "popoverBody": "يلزم مفتاح OpenAI API لاستخدام هذه الميزة.",
+ "setItUpNow": "أعِدّه الآن"
+ },
+ "updatesSection": {
+ "title": "التحديثات",
+ "onVersion": "أنت على الإصدار v{{v}}",
+ "checkingDetail": "جارٍ البحث عن إصدار أحدث…",
+ "availableHeadline": "الإصدار v{{version}} متاح",
+ "availableDetail": "أنت على v{{v}}. نزّله الآن — وسيُطلَب منك إعادة التشغيل حين يجهز.",
+ "downloadBtn": "نزّل v{{version}}",
+ "downloadingHeadline": "جارٍ تنزيل v{{version}}",
+ "downloadingDetail": "اكتمل {{percent}}%. يمكنك مواصلة العمل؛ وإعادة التشغيل قرارك أنت.",
+ "downloadedHeadline": "الإصدار v{{version}} جاهز للتثبيت",
+ "downloadedDetail": "أعِد تشغيل Munder Difflin لإتمام التحديث من v{{v}}.",
+ "restartBtn": "أعِد التشغيل للتحديث",
+ "manualDetail": "لا تستطيع هذه النسخة تحديث نفسها — نزّلها من صفحة الإصدارات.",
+ "manualDetailReason": "لا تستطيع هذه النسخة تحديث نفسها ({{reason}}) — نزّلها من صفحة الإصدارات.",
+ "openReleaseBtn": "افتح صفحة الإصدار",
+ "errorHeadline": "فشل التحقّق من التحديثات",
+ "errorDetail": "{{message}} (أنت على v{{v}}).",
+ "retryBtn": "حاول مجددًا",
+ "latestHeadline": "v{{v}} هو أحدث إصدار",
+ "latestDetail": "أنت محدَّث بالفعل — لا شيء لتثبيته.",
+ "checkAgainBtn": "تحقّق مجددًا",
+ "idleDetail": "يُتحقَّق من التحديثات تلقائيًا كل 6 ساعات. تحقّق الآن إن أردت التأكّد.",
+ "checkBtn": "تحقّق من التحديثات",
+ "downloadManually": "نزّل يدويًا",
+ "downloadManuallyTitle": "نزّل مثبّت v{{version}} واستبدل التطبيق بنفسك",
+ "manualDownloadingTitle": "<b>يجري تنزيل v{{version}} في متصفّحك.</b>",
+ "manualDownloadingBody": "عند اكتماله، أغلق هذا التطبيق، وثبّت الإصدار الجديد فوق الحالي، ثم افتحه واختر المشروع نفسه. على {{os}}:"
+ },
+ "triggersTab": {
+ "intro": "كل ما يمكنه بدء العمل دون أن تكتب أنت شيئًا.",
+ "schedules": "الجدولة",
+ "schedulesBlurb": "شغّل مطالبة على ساعة متكرّرة.",
+ "context": "السياق",
+ "contextBlurb": "اضغط سياق وكيل أو امسحه كلما امتلأ.",
+ "webhooks": "خطّافات الويب",
+ "webhooksBlurb": "دع نظامًا خارجيًا يرسل العمل إليك.",
+ "organisation": "المؤسسة",
+ "organisationBlurb": "دع نسخة Munder Difflin لدى زميلك تراسل نسختك."
+ },
+ "orgSection": {
+ "acceptMessages": "قبول الرسائل من مؤسستك",
+ "key": "مفتاح المؤسسة",
+ "keyPlaceholder": "الصق مفتاحك",
+ "trust": "الثقة",
+ "settingsOnly": "إعدادات فقط، في الوقت الحالي. خدمة مراسلة المؤسسة غير موجودة بعد، لذا لا يبدأ المفتاح هنا أي اتصال ولا يُرسَل أو يُستقبَل شيء. يُخزَّن جاهزًا لحين توفّرها.",
+ "noKeyWarning": "هذا مفعّل بلا مفتاح، لذا لا يستطيع أي زميل الوصول إليك بعد.",
+ "noKey": "بلا مفتاح"
+ },
+ "contextSection": {
+ "loading": "لحظة…",
+ "intro": "لا تعمل القاعدة إلا إذا تحقّق الشرطان معًا: مرور المدّة منذ آخر تشغيل، وامتلاء سياق ذلك الوكيل بقدر الحدّ على الأقل. الحدّ 0% يعني الاعتماد على الوقت وحده.",
+ "compact": "ضغط",
+ "compactBlurb": "يلخّص السياق ليستمر الحوار.",
+ "clear": "مسح",
+ "clearBlurb": "يتخلّص من السياق. لا يُلخَّص شيء.",
+ "clearCaution": "المسح يرمي السياق — وهو ليس نسخة أصغر من الضغط. الوكيل في منتصف مهمة سينسى ما كان يفعله. اتركه معطّلًا ما لم تحفظ السياق بطريقة أخرى.",
+ "extraFocus": "تركيز إضافي",
+ "extraFocusHint": "يُضاف إلى أمر الضغط لدى المزوّد. تركه فارغًا يرسل الأمر مجرّدًا.",
+ "extraFocusPlaceholder": "ما يجب أن يحتفظ به الملخّص…",
+ "command": "الأمر",
+ "commandHint": "يُرسَل حرفيًا. تركه فارغًا يرسل أمر المسح مجرّدًا.",
+ "bothOff": "كلاهما معطّل",
+ "off": "معطّل.",
+ "hintEvery": "كل {{interval}}، بمجرد تجاوز السياق {{pct}}%.",
+ "noSoonerThan": "ليس أسرع من كل",
+ "contextBar": "حدّ السياق",
+ "contextBarHint": "كم يجب أن تمتلئ النافذة قبل السماح بالتشغيل. 0% = الوقت وحده.",
+ "bigWindows": "الحدّ على النوافذ الكبيرة",
+ "bigWindowsHint": "يُستخدَم على النوافذ بحجم مليون رمز تقريبًا، حيث تظل الشريحة الأصغر كمًّا هائلًا من النص."
+ },
+ "schedulesSection": {
+ "justNow": "الآن",
+ "ago": "قبل {{unit}}",
+ "in": "خلال {{unit}}",
+ "summaryNone": "لا شيء",
+ "summary": "{{on}} من {{total}} مفعّل",
+ "nothingScheduled": "لا شيء مجدول بعد.",
+ "addSchedule": "أضف جدولًا",
+ "newSchedule": "جدول جديد",
+ "label": "التسمية",
+ "labelPlaceholder": "الغرض من هذا التشغيل",
+ "goesTo": "يذهب إلى",
+ "everyone": "الجميع",
+ "prompt": "الموجّه",
+ "promptPlaceholder": "يُرسَل حرفيًا في كل تشغيل.",
+ "fired": "عمل {{time}}",
+ "notFired": "لم يعمل بعد",
+ "next": "التالي {{time}}",
+ "beat": "♥ نبضة",
+ "noPrompt": "لا موجّه محدَّد.",
+ "saved": "حُفِظ",
+ "when": "متى",
+ "beatCeiling": "تتكيّف النبضة مع هدوء الأرضية، فهذا هو الحدّ الأعلى لا الفاصل الدقيق."
+ },
+ "webhooksSection": {
+ "summaryNone": "لا شيء",
+ "summary": "{{count}} · {{state}}",
+ "live": "نشط",
+ "offline": "غير متصل",
+ "intro": "أي شخص يملك عنوان URL وسرّه يستطيع إرسال عمل إليك. لكل نقطة نهاية سرّها الخاص، فسحب الثقة من متصل واحد لا يمسّ البقية.",
+ "noEndpoints": "لا نقاط نهاية بعد.",
+ "minting": "جارٍ الإصدار…",
+ "addWebhook": "أضف خطّاف ويب",
+ "newEndpointHint": "تبدأ نقطة النهاية الجديدة معطّلة. انسخ عنوانها وسرّها ثم فعّلها.",
+ "unnamed": "بلا اسم",
+ "reachable": "يمكن الوصول إليه",
+ "noUrlYet": "لا عنوان بعد",
+ "serverOffline": "الخادم غير متصل",
+ "name": "الاسم",
+ "namePlaceholder": "من يستدعي هذا",
+ "postTo": "أرسل إلى",
+ "noAddressYet": "لا يملك هذا الطرف عنوانًا عامًّا بعد. سيظهر بمجرد أن يلتقطه النفق.",
+ "serverNotListening": "خادم خطّافات الويب لا يستمع، فلا يوجد عنوان يُسلَّم بعد.",
+ "secret": "السرّ",
+ "secretHint": "يعيد المتصلون هذا في ترويسة x-md-webhook-secret.",
+ "trust": "الثقة",
+ "bodySchema": "مخطّط الجسم",
+ "editSchema": "حرّر المخطّط",
+ "schemaDesc": "كيف يجب أن يبدو الجسم الوارد",
+ "notValidJson": "ليس JSON صالحًا — {{error}}. لم يُحفَظ شيء.",
+ "saved": "حُفِظ",
+ "saveSchema": "احفظ المخطّط",
+ "sure": "متأكّد؟",
+ "deleteIt": "احذفه",
+ "keep": "احتفظ به"
+ },
+ "triggersUi": {
+ "custom": "مخصّص",
+ "customEllipsis": "مخصّص…",
+ "min": "دقيقة",
+ "every": "كل…",
+ "onDays": "في أيام…",
+ "at": "عند",
+ "weekdays": "أيام العمل",
+ "everyDay": "كل يوم",
+ "pickDayHint": "اختر يومًا واحدًا على الأقل، وإلا فلن يعمل هذا أبدًا."
+ },
+ "triggerHistory": {
+ "justNow": "الآن",
+ "ago": "قبل {{unit}}",
+ "in": "خلال {{unit}}",
+ "kindDirective": "توجيه",
+ "kindCommunication": "مراسلة",
+ "decisionPending": "بحاجة إليك",
+ "decisionApproved": "مقبول",
+ "decisionRejected": "مرفوض",
+ "decisionAuto": "مسموح تلقائيًا",
+ "emptyMessage": "(رسالة فارغة)",
+ "showLess": "عرض أقل",
+ "showAll": "اعرض كل الأحرف البالغة {{count}}",
+ "tailRejected": "رفضتَ هذا. لم يُرسَل شيء إلى الخلية.",
+ "tailNoReply": "لا ردّ بعد. {{godName}} يتولّى هذه.",
+ "waitingForYou": "بانتظارك",
+ "unnamedSource": "مصدر بلا اسم",
+ "from": "من",
+ "to": "إلى",
+ "unknown": "غير معروف",
+ "theySent": "أرسلوا",
+ "weReplied": "رددنا",
+ "weSent": "أرسلنا",
+ "pendingDirectiveDesc": "إن وافقت ذهب هذا إلى {{godName}}، فيشغّل الخلية عليه. وإن رفضت أُسقِط — ولا يعمل شيء.",
+ "pendingDesc": "إن وافقت قرأ {{godName}} هذا. وإن رفضت أُسقِط — ولا يعمل شيء.",
+ "approveTitle": "مرِّر هذه الرسالة إلى {{godName}}",
+ "oneSec": "لحظة…",
+ "approve": "موافقة",
+ "rejectTitle": "أسقِط هذه الرسالة. لا يُرسَل شيء",
+ "reject": "رفض",
+ "task": "المهمة {{id}}",
+ "sectionWebhooks": "خطّافات الويب",
+ "sectionWebhooksBlurb": "كل ما أُرسل إلى نقاط نهاية خطّافاتك، إلى جانب ما ردّ به {{godName}}.",
+ "sectionOrg": "المؤسسة",
+ "sectionOrgBlurb": "رسائل من عُقد النسخ لدى زملائك، إلى جانب ما ردّ به {{godName}}.",
+ "heldOne": "رسالة واحدة محتجزة بانتظار موافقتك أو رفضك.",
+ "heldMany": "{{count}} رسائل محتجزة بانتظار موافقتك أو رفضك.",
+ "decideFailed": "لم يُنفَّذ ذلك. حاول مجددًا.",
+ "clearFailed": "تعذّر مسحه. حاول مجددًا.",
+ "emptyOrgTitle": "لا شيء هنا بعد، ولا شيء معطّل.",
+ "emptyOrgBody": "مراسلة الزملاء لم تُبنَ بعد. يمكنك ضبط مفتاح مؤسسة واختيار وضع اليوم، لكن لا تستطيع عُقدة أي زميل الوصول إلى عقدتك حتى يُشحن النقل. وحين يُشحن، ستصل رسائلهم وردودنا إلى هنا.",
+ "emptyWebhookTitle": "لا رسائل خطّافات بعد.",
+ "emptyWebhookBody": "حين يُرسِل شيء إلى إحدى نقاط نهايتك، يصل إلى هنا ومعه ردّ {{godName}} تحته. لم يتصل أحد حتى الآن. أضف نقطة نهاية تحت \"خطّافات الويب\" لتحصل على عنوان تسلّمه.",
+ "clearConfirm": "حذف كل الرسائل البالغة {{count}}؟ يذهب السجلّ نهائيًا.",
+ "deleteThem": "احذفها",
+ "keepThem": "احتفظ بها",
+ "clearHistoryTitle": "احذف سجلّ هذا القسم",
+ "clearHistory": "امسح السجلّ"
+ },
+ "fileTree": {
+ "loading": "جارٍ التحميل…",
+ "copyPathTitle": "نسخ المسار إلى الحافظة"
+ },
+ "fileEditor": {
+ "file": "ملف",
+ "edit": "تحرير",
+ "preview": "معاينة",
+ "editTitle": "تحرير المصدر",
+ "previewTitle": "معاينة معروضة (للملف المحفوظ)",
+ "openInIde": "فتح في بيئة التطوير",
+ "openInIdeTitle": "افتح هذا الملف في بيئة التطوير الكاملة",
+ "closeTitle": "إغلاق (Esc)"
+ },
+ "gitTab": {
+ "notARepo": "ليس مستودع git.",
+ "notARepoHint": "شغّل git init في طرفية الوكيل.",
+ "detachedHead": "HEAD منفصل",
+ "refresh": "تحديث",
+ "sectionStatus": "الحالة",
+ "sectionBranches": "الفروع",
+ "sectionLog": "السجل",
+ "staged": "مُدرَج",
+ "changes": "تغييرات",
+ "untracked": "غير متتبَّع",
+ "clean": "شجرة العمل نظيفة",
+ "noCommits": "لا إيداعات بعد",
+ "modified": "معدَّل",
+ "added": "مُضاف",
+ "deleted": "محذوف",
+ "renamed": "معاد التسمية",
+ "unmerged": "غير مدموج",
+ "copyPath": "نسخ المسار"
+ },
+ "fullscreenTerminal": {
+ "showAgentList": "أظهر قائمة الوكلاء",
+ "hideAgentList": "أخفِ قائمة الوكلاء — طرفية بعرض كامل",
+ "lightTheme": "التبديل إلى السِمة الفاتحة",
+ "darkTheme": "التبديل إلى السِمة الداكنة",
+ "toggleTheme": "تبديل الوضع الداكن",
+ "exitFullscreen": "الخروج من وضع التركيز (Esc)",
+ "addAgent": "إضافة وكيل",
+ "respawnTitle": "إعادة الإنشاء من الجلسة الماضية: {{names}} — بالمعرّفات نفسها، وتعود الذاكرة وصناديق الوارد تلقائيًا",
+ "contextTitle": "السياق: {{used}} / {{limit}} رمز ({{pct}}%)",
+ "modelTitle": "النموذج: {{model}}",
+ "cliDefault": "افتراضي الـCLI",
+ "closeAgent": "إغلاق {{name}} — يُنهي العملية ويؤرشف الوكيل",
+ "ideTip": "افتح بيئة التطوير: تصفّح وحرّر الملفات في مساحة عمل {{name}}، واعرض تغييراته غير المودعة كفروقات.",
+ "openIdeAria": "افتح بيئة التطوير",
+ "openTerminalTip": "افتح تطبيق الطرفية في نظامك عند {{cwd}} — صدفة عادية داخل مجلد هذا الوكيل، منفصلة عن طرفيته الخاصة.",
+ "openTerminalAria": "افتح طرفية نظام في مجلد هذا الوكيل"
+ },
+ "memoryPanel": {
+ "pill": "🧠 الذاكرة",
+ "pillActive": "🧠 الذاكرة",
+ "openTitle": "ابحث في الذاكرة المشتركة التي يبنيها وكلاؤك",
+ "title": "ذاكرة الخلية",
+ "intro": "ما يتذكّره وكلاؤك عبر الجلسات، مشتركًا بينهم. ابحث فيه بالمعنى، لا بالكلمات الحرفية فقط.",
+ "notSetUp": "غير مُعدّة",
+ "onReady": "مفعّلة · جاهزة",
+ "onGettingReady": "مفعّلة · تستعد…",
+ "turnOff": "إيقاف",
+ "turnOn": "تشغيل",
+ "notInstalled": "البحث بالمعنى غير مثبّت بعد.",
+ "setUpInPrereqs": "أعِدّه في المتطلّبات ←",
+ "plainNotesStill": "يواصل الوكلاء تدوين ملاحظات عادية من دونه.",
+ "searchLanguage": "لغة البحث",
+ "modelFast": "سريع",
+ "modelFastDetail": "الإنجليزية فقط · ~90 م.ب",
+ "modelMultilingual": "متعدّد اللغات",
+ "modelMultilingualDetail": "كل اللغات · ~300 م.ب",
+ "searchPlaceholder": "ابحث بالمعنى…",
+ "nothingMatched": "لا نتائج مطابقة بعد.",
+ "searchFailed": "تعذّر البحث"
+ },
+ "threads": {
+ "noSubject": "(بلا موضوع)",
+ "empty": "لا محادثات بعد. ستظهر هنا الرسائل التي يستقبلها هذا الوكيل على شكل مواضيع.",
+ "less": "أقل",
+ "more": "المزيد",
+ "replyPlaceholder": "ردّ على {{name}}…",
+ "send": "إرسال"
+ },
+ "skillsTab": {
+ "installed": "المثبَّتة",
+ "browse": "تصفّح",
+ "searchInstalled": "ابحث في المهارات المثبَّتة…",
+ "searchCatalog": "ابحث في فهرس المهارات…",
+ "categoryTitle": "الفئات كما ينشرها الفهرس",
+ "allCategories": "كل الفئات",
+ "allPublishers": "كل الناشرين",
+ "loading": "جارٍ التحميل…",
+ "refresh": "تحديث",
+ "scanning": "جارٍ الفحص…",
+ "noSkillsInstalled": "لا مهارات مثبَّتة بعد. افتح \"تصفّح\" لترى المتاح.",
+ "nothingMatches": "لا شيء يطابق هذا البحث.",
+ "openFolder": "فتح المجلد",
+ "shipsWithApp": "تأتي مع التطبيق",
+ "deleteConfirm": "حذف {{name}}؟",
+ "removing": "جارٍ الإزالة…",
+ "uninstall": "إلغاء التثبيت",
+ "loadingCatalog": "جارٍ تحميل الفهرس…",
+ "cachedCopy": "يُعرَض نسخة مخبّأة — {{error}}.",
+ "matching": "{{count}} مطابقة",
+ "matchingFirst": "{{count}} مطابقة · يُعرَض أول {{shown}}",
+ "curatedBy": "من تنسيق abubakarsiddik31/claude-skills-collection",
+ "installing": "جارٍ التثبيت…",
+ "install": "تثبيت",
+ "learnMore": "اعرف المزيد",
+ "installFailed": "فشل التثبيت",
+ "removeFailed": "تعذّرت إزالته",
+ "uninstallFailed": "فشل إلغاء التثبيت",
+ "catalogUnreachable": "تعذّر الوصول إلى الفهرس"
+ },
+ "workersTab": {
+ "stopping": "يتوقّف",
+ "working": "يعمل",
+ "liveWorkers": "العمّال النشطون",
+ "liveIntro": "عمّال معزولون يشغّلهم {{godName}} لمعالجة رسائل Slack — يعملون حتى الإنجاز، ويردّون داخل الموضوع، ثم يُفكَّكون.",
+ "noneRunning": "لا عمّال يعملون الآن.",
+ "repliesToSlack": "يردّ على موضوع في Slack",
+ "stoppingEllipsis": "جارٍ الإيقاف…",
+ "stop": "إيقاف",
+ "workerIdTitle": "معرّف العامل / PTY",
+ "baseBranchTitle": "الفرع الأساس الذي قُطعت منه شجرة العمل",
+ "base": "الأساس: {{branch}}",
+ "upSinceTitle": "المدّة منذ الإنشاء",
+ "up": "منذ {{age}}",
+ "idleTitle": "المدّة منذ آخر خرج للطرفية",
+ "ptyGone": "اختفى pty",
+ "idle": "خامل منذ {{age}}",
+ "tokensTitle": "الرموز التراكمية (دخل+خرج+مخبّأ)",
+ "tokens": "الرموز {{value}}",
+ "uncapped": "بلا سقف",
+ "preserved": "أشجار العمل المحفوظة ({{count}})",
+ "preservedIntro": "عمّال منتهون بقيت في أشجار عملهم أعمال لم تُدمَج — تُحفَظ (ولا تُحذَف تلقائيًا أبدًا) وتُستَعاد تلقائيًا بمجرد وصول العمل إلى فرعه الأساس.",
+ "keptAgo": "حُفظت منذ {{age}}"
+ },
+ "memoryGraph": {
+ "topics": "المواضيع",
+ "refresh": "تحديث",
+ "readingMemory": "جارٍ قراءة الذاكرة…",
+ "topicsShown": "عرض {{shown}} من {{total}} موضوعًا",
+ "loadingMemory": "جارٍ تحميل الذاكرة…",
+ "messageLinks": "{{count}} رابط رسائل",
+ "knowsAbout": "{{a}} يعرف عن “{{b}}”",
+ "messagesLast": "{{count}} رسالة · آخرها: {{act}}",
+ "noMemory": "لم تُسجَّل أي ذاكرة بعد.",
+ "legendRequest": "طلب",
+ "legendQuery": "استعلام",
+ "legendPropose": "اقتراح",
+ "legendAgreeDone": "موافقة/إنجاز",
+ "legendRefuse": "رفض",
+ "legendInformTopic": "إخبار/موضوع"
+ },
+ "integrations": {
+ "errLabel": "أعطِه تسمية.",
+ "errId": "تعذّر اشتقاق معرّف صالح من التسمية.",
+ "errBaseUrl": "عنوان URL الأساسي مطلوب.",
+ "errBaseUrlFormat": "يجب أن يبدأ العنوان الأساسي بـhttps:// (أو http://127.0.0.1 / localhost لهدف محلي).",
+ "errHeader": "اسم الترويسة يجب أن يكون من 1 إلى 64 حرفًا من A–Z أو 0–9 أو \"-\".",
+ "couldNotSave": "تعذّر الحفظ.",
+ "added": "أُضيف التكامل.",
+ "updated": "حُدِّث التكامل.",
+ "removed": "أُزيل “{{label}}”.",
+ "couldNotRemove": "تعذّرت الإزالة.",
+ "testFailed": "تعذّر تشغيل الاختبار.",
+ "connected": "✓ متصل",
+ "connectedWith": "✓ متصل ({{status}})",
+ "failed": "✕",
+ "backToList": "← التكاملات",
+ "pickTemplate": "اختر قالبًا",
+ "galleryDesc": "اختر ما تربطه. القالب يضبط الإعدادات الافتراضية. اختر REST مخصّص لأي شيء غير مدرَج.",
+ "anyHttpApi": "أي واجهة HTTP",
+ "continue": "متابعة",
+ "backToTemplates": "← القوالب",
+ "needsSecret": "يحتاج {{label}}",
+ "publicApi": "واجهة عامة — لا يلزم سرّ",
+ "label": "التسمية",
+ "labelHint": "تظهر في قائمتك. المعرّف",
+ "fixed": "ثابت",
+ "baseUrl": "العنوان الأساسي",
+ "baseUrlHint": "يضبطه قالب {{label}}.",
+ "preset": "مضبوط مسبقًا",
+ "authentication": "المصادقة",
+ "setByTemplate": "يضبطه القالب",
+ "headerName": "اسم الترويسة",
+ "headerHint": "يُرسَل السرّ على هيئة {{header}}: <secret>.",
+ "saved": "حُفِظ",
+ "replaceKey": "استبدل المفتاح",
+ "pasteYour": "الصق",
+ "writeOnly": "للكتابة فقط",
+ "secretDesc": "يُشفَّر في العملية الرئيسية ولا يُعرَض ثانيةً أبدًا. لتغييره الصق مفتاحًا جديدًا — فالقديم لا يمكن قراءته مرة أخرى.",
+ "blankKeepsKey": "اتركه فارغًا للإبقاء على المفتاح المحفوظ.",
+ "availability": "الإتاحة",
+ "enabled": "مفعّل",
+ "disabled": "معطّل",
+ "availableToAll": "✓ متاح لكل العمّال",
+ "notAvailableYet": "غير متاح للعمّال بعد",
+ "addSecretToEnable": "أضف سرًّا وفعّله ليصبح متاحًا.",
+ "readyOnceSaved": "جاهز بمجرد الحفظ.",
+ "disabledNoUse": "معطّل — لا يستطيع أي عامل استخدامه.",
+ "v1Note": "الإصدار الأول يمنح كل تكامل مفعّل لجميع العمّال. تحديد النطاق لكل عامل قادم.",
+ "testConnection": "اختبر الاتصال",
+ "testing": "جارٍ الاختبار…",
+ "testAfterSave": "احفظ التكامل أولًا، ثم اختبر الاتصال الحيّ.",
+ "testLiveDesc": "يجري فحصًا حيًّا للقراءة فقط على العنوان الأساسي بالسرّ المخزَّن.",
+ "saveIntegration": "احفظ التكامل",
+ "saveChanges": "احفظ التغييرات",
+ "title": "التكاملات",
+ "titleDesc": "اربط أدوات خارجية ليتمكّن وكلاؤك من قراءتها والعمل عليها. تُخزَّن الأسرار مشفَّرة في العملية الرئيسية ولا تُعرَض ثانيةً أبدًا.",
+ "addIntegration": "أضف تكاملًا",
+ "empty": "لا تكاملات بعد. اربط GitHub أو واجهة REST مخصّصة ليتمكّن وكلاؤك من استخدامها.",
+ "addFirst": "أضف تكاملك الأول",
+ "count": "{{count}} تكامل · {{usable}} متاح للعمّال",
+ "needsSecretShort": "يحتاج سرًّا",
+ "test": "اختبار",
+ "edit": "تحرير"
+ },
+ "kanban": {
+ "count": "{{count}} مهمة",
+ "newWorkHint": "عمل جديد؟ أرسله إلى {{godName}} (تبويب المراقبة)",
+ "colTodo": "للتنفيذ",
+ "colDoing": "قيد التنفيذ",
+ "colBlocked": "معطَّل",
+ "colDone": "منجَز",
+ "openTaskDetails": "افتح تفاصيل المهمة",
+ "needsYouTitle": "بانتظار إجابتك — راجع تبويب \"اسألني\"",
+ "dismissTitle": "تجاهل هذه المهمة (تُزال من اللوحة)",
+ "dismissAria": "تجاهل المهمة",
+ "taskTitle": "المهمة",
+ "unassigned": "غير مُسنَدة",
+ "noDescription": "(لا وصف على هذه البطاقة)",
+ "humanQA": "أسئلة وأجوبة بشرية",
+ "awaitingAnswer": "بانتظار إجابتك — تبويب اسألني",
+ "dependsOn": "يعتمد على",
+ "assign": "إسناد",
+ "priority": "الأولوية {{level}}/5"
+ },
+ "queueComposer": {
+ "recording": "● يسجّل — انقر إيقاف للتفريغ النصي",
+ "transcribing": "جارٍ التفريغ النصي…",
+ "voice": "صوت",
+ "busyQueued": "{{name}} مشغول — {{count}} في الطابور",
+ "heldFloor": "محتجز — التسليم موقوف على مستوى الأرضية",
+ "heldDraft": "محتجز — طرفية {{name}} فيها نص لم يُرسل على موجّه الإدخال",
+ "heldPicker": "محتجز — منتقي أوامر مائلة مفتوح في طرفية {{name}}",
+ "heldExited": "محتجز — طرفية {{name}} انتهت",
+ "sendingOneByOne": "جارٍ الإرسال إلى {{name}} واحدة تلو الأخرى…",
+ "pausedTitle": "التسليم التلقائي موقوف للأرضية كلها. استأنفه من مركز القيادة، أو استخدم \"أرسل الآن\" على رسالة أدناه.",
+ "dropToAttach": "أفلِت للإرفاق",
+ "queue": "الطابور",
+ "closePicker": "أغلق المنتقي",
+ "recoverPrompt": "استعد الموجّه",
+ "clearAllTitle": "امسح كل الرسائل المصفوفة",
+ "clearAll": "امسح الكل",
+ "removeAttachment": "أزِل المرفق",
+ "messagePlaceholder": "راسِل {{name}}",
+ "busyPlaceholder": "{{name}} مشغول — أضِف رسالة إلى الطابور",
+ "files": "ملفات",
+ "collapse": "اطوِ هذه الرسالة",
+ "showFull": "اعرض الرسالة كاملة",
+ "seeLess": "عرض أقل",
+ "seeMore": "عرض المزيد",
+ "sendNowTitle": "سلّم هذه الرسالة رغم إيقاف التسليم التلقائي. تنتقل إلى مقدّمة الطابور وتُكتَب فور تفرّغ الطرفية.",
+ "sendNow": "أرسل الآن",
+ "sendingWhenFree": "سيُرسَل عند التفرّغ…",
+ "removeFromQueue": "أزِل من الطابور",
+ "ffNoKeyTitle": "الإملاء الصوتي يحتاج مفتاح Groq API مجانيًا. انقر علامة المعلومات لمعرفة الخطوات.",
+ "ffStopTranscribe": "إيقاف وتفريغ نصي",
+ "ffTitle": "التدفّق الحر — أملِ في الطابور. انقر، أو اضغط مع الاستمرار على Option (⌥).",
+ "stop": "إيقاف",
+ "ffHowEnable": "كيف أفعّل الإملاء الصوتي؟",
+ "ffSetupTitle": "إعداد الإملاء الصوتي",
+ "ffSetupIntro": "تحدّث بدل الكتابة. تتولّى Groq التفريغ النصي، وطبقتها المجانية تغطّي هذا — بلا بطاقة وبلا تكلفة.",
+ "ffCreateKey": "أنشئ مفتاحًا مجانيًا من",
+ "ffPasteKey": "الصقه في الإعدادات ← الصوت ← مفتاح Groq API",
+ "ffClickOrHold": "انقر \"صوت\"، أو اضغط مع الاستمرار على مفتاح Option الأيمن للتحدّث",
+ "ffHoldHint": "اضغط عليه وحده لحظةً للبدء؛ وأفلته ليُفرَّغ النص في المحرّر حيث يمكنك التعديل قبل الإرسال. يعمل أي من مفتاحَي Option، وتصل تركيبات Option+مفتاح إلى الطرفية كما هي."
+ },
+ "idePanel": {
+ "workspace": "مساحة عمل {{name}}",
+ "workspaceInferred": "لم يُسمَّ أي وكيل عند فتح بيئة التطوير — يُعرَض مساحة عمل {{name}} (التحديد الحالي)",
+ "assumed": "مفترَض",
+ "noAgent": "لا وكيل",
+ "noWorkspace": "لا مساحة عمل",
+ "closeIde": "إغلاق بيئة التطوير (Esc)",
+ "expandGit": "وسّع لوحة git",
+ "collapseGit": "اطوِ لوحة git — مساحة أكبر لشجرة الملفات",
+ "rail": {
+ "changes": "التغييرات",
+ "history": "السجل",
+ "compare": "مقارنة"
+ },
+ "refresh": "تحديث",
+ "files": "ملفات",
+ "rev": "مراجعة",
+ "img": "صورة",
+ "diff": "فروقات",
+ "closeTab": "إغلاق التبويب",
+ "loadingDiff": "جارٍ تحميل الفروقات…",
+ "binaryDiff": "ملف ثنائي — لا فروقات نصية",
+ "workingTree": "شجرة العمل",
+ "refreshDiff": "تحديث الفروقات",
+ "mdSourceOnly": "المصدر فقط",
+ "mdSplit": "المصدر + المعاينة",
+ "mdPreview": "معاينة معروضة",
+ "code": "شيفرة",
+ "split": "تقسيم",
+ "preview": "معاينة",
+ "viewImage": "عرض الصورة",
+ "copyPath": "نسخ المسار",
+ "saveTitle": "حفظ (Cmd/Ctrl+S)",
+ "saved": "حُفِظ",
+ "save": "حفظ"
+ },
+ "gitPanes": {
+ "jumpConfirm": "نقل المستودع إلى {{sha}} (\"{{subject}}\")؟\n\nهذا يفصل HEAD. يُمنع تلقائيًا إذا كانت الشجرة غير نظيفة أو كان وكيل في منتصف عمله.",
+ "nowAt": "الآن عند {{sha}} (HEAD منفصل)",
+ "loadingHistory": "جارٍ تحميل السجل…",
+ "loadOlder": "تحميل الأقدم…",
+ "checkoutTitle": "اسحب هذا الإيداع (HEAD منفصل)",
+ "jumpHere": "انتقل إلى هنا",
+ "loadingFiles": "جارٍ تحميل الملفات…",
+ "noFileChanges": "لا تغييرات في الملفات (دمج؟)",
+ "comparing": "جارٍ المقارنة…",
+ "switchConfirm": "تبديل هذا المستودع إلى '{{head}}'؟\n\nيُمنع تلقائيًا إذا كانت الشجرة غير نظيفة أو كان وكيل في منتصف عمله.",
+ "switchedTo": "تم التبديل إلى {{head}}",
+ "baseTitle": "الأساس — الفرع الذي تقارن به",
+ "swapTitle": "بدّل الأساس ↔ المقارَن",
+ "compareTitle": "المقارَن — الفرع الذي تعرض تغييراته",
+ "aheadBehind": "'{{head}}' متقدّم بـ{{ahead}} ومتأخّر بـ{{behind}} عن '{{base}}'",
+ "modeThreeTitle": "يعرض ما يُضيفه الفرع المقارَن منذ السلف المشترك (بأسلوب PR). انقر لعرض الفرق الحرفي ذي النقطتين.",
+ "modeTwoTitle": "يعرض الفرق الحرفي بين حالتَي الفرعين. انقر للعرض بأسلوب PR (ما يُضيفه المقارَن).",
+ "sinceCommonAncestor": "منذ السلف المشترك",
+ "literalDifference": "الفرق الحرفي",
+ "switchToTitle": "اسحب '{{head}}'",
+ "switchTo": "بدّل إلى {{branch}}",
+ "noDifferences": "لا فروقات"
+ },
+ "imagePreview": {
+ "fitTitle": "تصغير الصورة لتناسب اللوحة",
+ "oneToOneTitle": "عرض كل بكسل بمقياس 1:1 (مرّر للتنقّل)",
+ "fit": "ملاءمة",
+ "viewSourceTitle": "فتح شيفرة SVG في المحرّر",
+ "viewSource": "عرض المصدر",
+ "loading": "جارٍ تحميل الصورة…",
+ "decodeFailed": "تعذّر فك ترميز هذه الصورة — قد يكون الملف تالفًا أو امتداده خاطئًا"
+ }
+}
diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json
index e8470e99..b6e4d772 100644
--- a/src/renderer/src/i18n/locales/en.json
+++ b/src/renderer/src/i18n/locales/en.json
@@ -246,7 +246,8 @@
"dangerDesc": "Reset wipes {{godName}}'s memories, the entire hive (every agent, message, task, and the board), the semantic-memory palace, and all settings - then takes you back to onboarding.",
"resetStartOver": "reset & start over",
"arabicTerminal": "Arabic / RTL text in terminals",
- "arabicTerminalDesc": "Renders terminals with the browser's text engine so Arabic joins and reads right-to-left (xterm has no bidi of its own). Off is the GPU renderer: faster, but RTL-blind. Off by default for everyone; applies to newly opened terminals."
+ "arabicTerminalDesc": "Renders terminals with the browser's text engine so Arabic joins and reads right-to-left (xterm has no bidi of its own). Off is the GPU renderer: faster, but RTL-blind. Applies to open terminals and new ones alike.",
+ "arabicTerminalFollowsLanguage": "Following your app language. Switch it here to override that either way — the choice sticks even if you change language again."
},
"agentsModels": {
"defaultModel": "Default agent model",
diff --git a/src/renderer/src/i18n/locales/zh-CN.json b/src/renderer/src/i18n/locales/zh-CN.json
index 7c77d5b0..a15423d8 100644
--- a/src/renderer/src/i18n/locales/zh-CN.json
+++ b/src/renderer/src/i18n/locales/zh-CN.json
@@ -246,7 +246,8 @@
"dangerDesc": "重置会抹掉 {{godName}} 的记忆、整个 hive(每个智能体、消息、任务和看板)、语义记忆宫殿以及所有设置——然后带你回到新手引导。",
"resetStartOver": "重置并重新开始",
"arabicTerminal": "终端中的阿拉伯语 / RTL 文本",
- "arabicTerminalDesc": "使用浏览器的文本引擎渲染终端,让阿拉伯语正确连写并从右向左显示(xterm 自身不支持 bidi)。关闭时使用 GPU 渲染器:更快,但无法处理 RTL。默认对所有人关闭;仅对新打开的终端生效。"
+ "arabicTerminalDesc": "用浏览器的文本引擎渲染终端,让阿拉伯语正确连写并从右向左阅读(xterm 自身没有双向文本支持)。关闭则使用 GPU 渲染器:更快,但无法处理从右向左的文本。对已打开和新开的终端同时生效。",
+ "arabicTerminalFollowsLanguage": "当前跟随应用语言。在此切换即可覆盖,两个方向都可以——你的选择会保留,即使之后再更改语言。"
},
"agentsModels": {
"defaultModel": "默认智能体模型",
diff --git a/src/renderer/src/i18n/useDirection.ts b/src/renderer/src/i18n/useDirection.ts
new file mode 100644
index 00000000..5b587391
--- /dev/null
+++ b/src/renderer/src/i18n/useDirection.ts
@@ -0,0 +1,47 @@
+import { useEffect } from 'react';
+import { useTranslation } from 'react-i18next';
+import { directionFor, isRtlLanguage } from './index';
+
+/**
+ * The single gate for right-to-left layout.
+ *
+ * `useRtl()` is what every component asks; `useDirectionSync()` is mounted once
+ * near the root and stamps `dir`/`lang` on <html>. Both read ONE input — the
+ * language the user picked in Settings. Not `navigator.language`, not the OS,
+ * not the content on screen. A user who has not picked an RTL language gets
+ * `dir="ltr"` and `useRtl() === false`, which is byte-for-byte the behaviour
+ * they had before Arabic existed: no direction flip, no mirrored layout, no
+ * different font, no different spacing.
+ *
+ * That gate is the condition the whole Arabic UI ships under, so it is one
+ * function rather than a `language === 'ar'` check scattered across a dozen
+ * components — a scattered check is a check somebody eventually forgets to
+ * write, and each miss is a layout change for an English user.
+ *
+ * `dir` on <html> rather than on a React wrapper because portalled UI (modals,
+ * tooltips, the fullscreen terminal) mounts outside the React tree and would
+ * otherwise keep the document's direction while the rest of the app mirrored.
+ */
+
+/** True only when the user has selected a right-to-left app language. */
+export function useRtl(): boolean {
+ const { i18n } = useTranslation();
+ return isRtlLanguage(i18n.language);
+}
+
+/**
+ * Keep <html dir> and <html lang> pointed at the selected language.
+ *
+ * Mounted once, near the root. Restores `dir="ltr"`/`lang="en"` on the way
+ * back out of an RTL language, so switching Arabic → English mirrors the UI
+ * back rather than stranding it.
+ */
+export function useDirectionSync(): void {
+ const { i18n } = useTranslation();
+ const lng = i18n.language;
+ useEffect(() => {
+ const html = document.documentElement;
+ html.setAttribute('dir', directionFor(lng));
+ html.setAttribute('lang', lng || 'en');
+ }, [lng]);
+}
diff --git a/src/renderer/src/markdown/MarkdownPreview.tsx b/src/renderer/src/markdown/MarkdownPreview.tsx
index 93ce7463..d8582225 100644
--- a/src/renderer/src/markdown/MarkdownPreview.tsx
+++ b/src/renderer/src/markdown/MarkdownPreview.tsx
@@ -19,6 +19,8 @@ import remarkGfm from 'remark-gfm';
import { useWorkspaceImage } from '@/hooks/useWorkspaceImage';
import { isExternal, isRelativeMd, resolveLocalImageRel, resolveRel } from './mdLinks';
import { remarkSoftBreaks } from './remarkSoftBreaks';
+import { rehypeAutoDir } from './rehypeAutoDir';
+import { useRtl } from '@/i18n/useDirection';
/** How the rendered markdown sits in its host.
* - `document` (default): a page — its own type scale, 72ch measure, page padding.
@@ -32,6 +34,12 @@ export type MarkdownVariant = 'document' | 'card';
const DOC_PLUGINS = [remarkGfm];
const CARD_PLUGINS = [remarkGfm, remarkSoftBreaks];
+/** Per-block `dir="auto"`, for an RTL app language only — see the note at the
+ * `useRtl()` call site below. Frozen module constants so the prop identity is
+ * stable and react-markdown does not re-run the pipeline on every render. */
+const AUTO_DIR_PLUGINS = [rehypeAutoDir];
+const NO_PLUGINS: never[] = [];
+
export interface MarkdownPreviewProps {
source: string;
/** Repo-relative path of the file being previewed (for resolving relative links). */
@@ -50,10 +58,20 @@ export const MarkdownPreview = memo(function MarkdownPreview({
source, baseRel, root, onOpenMarkdownLink, variant = 'document'
}: MarkdownPreviewProps) {
const card = variant === 'card';
+ // Per-block direction, gated on the APP LANGUAGE rather than on the text.
+ //
+ // The plugin stamps `dir="auto"`, which resolves from each block's first
+ // strong character — so ungated it fires for an English user the moment an
+ // agent quotes a line of Arabic, and mirrors a block of their UI over
+ // something they never turned on. Keying it to the chosen language instead
+ // means an English user's markdown renders through exactly the pipeline it
+ // rendered through before this existed, whatever the agent writes into it.
+ const rtl = useRtl();
return (
<div className={card ? 'cth-md-preview cth-md-card' : 'cth-md-preview'}>
<ReactMarkdown
remarkPlugins={card ? CARD_PLUGINS : DOC_PLUGINS}
+ rehypePlugins={rtl ? AUTO_DIR_PLUGINS : NO_PLUGINS}
components={{
a: ({ href, children }) => {
const h = href ?? '';
diff --git a/src/renderer/src/markdown/rehypeAutoDir.ts b/src/renderer/src/markdown/rehypeAutoDir.ts
new file mode 100644
index 00000000..38b942c2
--- /dev/null
+++ b/src/renderer/src/markdown/rehypeAutoDir.ts
@@ -0,0 +1,54 @@
+/**
+ * rehype plugin: stamp `dir="auto"` on every block-level element of rendered
+ * markdown, so each block picks its own reading direction from its first strong
+ * character.
+ *
+ * WHY a plugin and not CSS: `unicode-bidi: plaintext` resolves the *bidi* order
+ * of a block but leaves the `direction` property alone — so an Arabic list item
+ * would read right-to-left while its bullet stayed pinned on the left, and
+ * `text-align: start` would still resolve against the container's LTR. `dir`
+ * sets the real base direction, which markers, alignment and trailing
+ * punctuation all follow. Doing it here rather than in `components` covers every
+ * block element in one pass, including ones nobody has overridden yet.
+ *
+ * Applied per BLOCK, never to the root: a document with English headings and
+ * Arabic prose (the common case for agent output) gets each block right, where a
+ * single `dir` on the wrapper would have to be wrong for one of them.
+ *
+ * `pre`/`code` are skipped deliberately — code is LTR regardless of the language
+ * of the comments inside it, and reordering a shell command would be a bug.
+ */
+import type { Root, Element } from 'hast';
+
+/** Block elements whose text is prose, so direction should follow content. */
+const AUTO_DIR = new Set([
+ 'p', 'li', 'blockquote', 'td', 'th', 'dd', 'dt', 'figcaption', 'summary',
+ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
+ // The list CONTAINER too, not just its items: `dir` on a `ul` resolves from
+ // the first strong character in its subtree, which is the first item's text.
+ // Without it the container stays LTR and an Arabic item reads right-to-left
+ // with its bullet stranded on the left, over the container's left padding.
+ // `table` is left out on purpose — there `dir` would reverse COLUMN order,
+ // which is a bigger claim than "this text is Arabic"; the per-cell `td`/`th`
+ // entries above already give each cell the right alignment.
+ 'ul', 'ol'
+]);
+
+/** Subtrees to leave strictly LTR (code keeps its own order). */
+const SKIP = new Set(['pre', 'code']);
+
+export function rehypeAutoDir() {
+ return (tree: Root): void => {
+ const walk = (node: Root | Element): void => {
+ for (const child of node.children) {
+ if (child.type !== 'element') continue;
+ if (SKIP.has(child.tagName)) continue;
+ if (AUTO_DIR.has(child.tagName)) {
+ child.properties = { ...child.properties, dir: 'auto' };
+ }
+ walk(child);
+ }
+ };
+ walk(tree);
+ };
+}
diff --git a/src/renderer/src/terminal/arabicSetting.ts b/src/renderer/src/terminal/arabicSetting.ts
index 124905b6..5de4da1d 100644
--- a/src/renderer/src/terminal/arabicSetting.ts
+++ b/src/renderer/src/terminal/arabicSetting.ts
@@ -1,3 +1,5 @@
+import i18n, { isRtlLanguage } from '@/i18n';
+
/**
* The renderer switch for RTL-script terminal support: ON keeps xterm on its
* DOM renderer, registers the Arabic character joiner, and lets the bidi CSS
@@ -6,37 +8,73 @@
* cell painter structurally cannot (xterm.js has no bidi: xtermjs/xterm.js#701).
* OFF leases the WebGL renderer: faster, and exactly the previous behavior.
*
- * DEFAULT: OFF, for everyone, until someone turns it on in Settings.
+ * THE LANGUAGE SETS THE DEFAULT; THE TOGGLE IS AN OVERRIDE.
+ *
+ * This shipped in 59d721ed as a manual switch, defaulting off for everyone,
+ * because at the time Arabic could not be selected as a UI language at all — a
+ * manual switch was the only door there was. Now that it can, a user who picks
+ * Arabic has already answered the question this toggle asks, and asking twice
+ * is the confusion the founder reported. So picking an RTL app language turns
+ * it on by itself.
+ *
+ * It is a DEFAULT and not a derived value, because the tradeoff is real in both
+ * directions and neither side is rare enough to lock out:
+ * - An ENGLISH user whose colleagues write Arabic, or whose logs carry it,
+ * has a genuine reason to switch this on without changing their UI language.
+ * - An ARABIC user may want the GPU renderer's speed back. It is their machine.
+ * So the state is THREE-valued, not two: unset (follow the language), forced on,
+ * forced off. An explicit choice outlives a language switch in both directions —
+ * a user who deliberately turned this on does not lose it by moving off Arabic.
*
- * The PR proposed defaulting it on for RTL system locales. That is the same
- * OS-sniffing the language picker deliberately does not do: it would move an
- * existing user off the GPU renderer on upgrade, because of their OS locale,
- * without them asking. The founder's rule for this release is that nothing
- * changes for anyone until they pick it, so the locale sniff is gone and the
- * toggle is the only way in. Re-defaulting it belongs with the rest of the RTL
- * UI work, once an RTL app language actually ships.
+ * What it deliberately does NOT do is sniff the OS locale, which is the same
+ * auto-detect the language picker refuses: `navigator.languages` is not a
+ * choice the user made in this app, and acting on it would move an existing
+ * user off the GPU renderer on upgrade without them asking. Nothing here reads
+ * anything but the language they picked and the override they set.
*/
const KEY = 'cth.arabicTerminal';
-let enabled = read();
+/** The user's explicit choice, or `null` for "follow the app language". */
+type Override = boolean | null;
-function read(): boolean {
+let override: Override = readOverride();
+
+function readOverride(): Override {
try {
const stored = window.localStorage.getItem(KEY);
if (stored === '1') return true;
if (stored === '0') return false;
- } catch { /* private mode — off, like everyone else */ }
- return false;
+ } catch { /* private mode — no override, so the language decides */ }
+ return null;
+}
+
+/** What the current app language asks for, absent an override. */
+function languageDefault(): boolean {
+ // Read live rather than caching: the language changes at runtime, and this is
+ // called on terminal attach, which can happen long after module init.
+ try { return isRtlLanguage(i18n.language); } catch { return false; }
}
-/** Hot path — called on terminal attach; reads the cached value. */
+/** Hot path — called on terminal attach and on every renderer lease. */
export function isArabicTerminalEnabled(): boolean {
- return enabled;
+ return override ?? languageDefault();
+}
+
+/** True when the value above is coming from the language, not a stored choice.
+ * Settings uses this to say so rather than presenting a default as a decision. */
+export function isArabicTerminalFollowingLanguage(): boolean {
+ return override === null;
}
-/** Flip the switch. Renderer choice is made when a terminal leases WebGL (on
- * attach), so this applies to newly created terminal views. */
+/** Record an explicit choice. Always writes — an override that happens to agree
+ * with the language today must still survive a switch away from it tomorrow. */
export function setArabicTerminalEnabled(next: boolean): void {
- enabled = next;
+ override = next;
try { window.localStorage.setItem(KEY, next ? '1' : '0'); } catch { /* private mode */ }
}
+
+/** Drop the override and go back to following the app language. */
+export function clearArabicTerminalOverride(): void {
+ override = null;
+ try { window.localStorage.removeItem(KEY); } catch { /* private mode */ }
+}
diff --git a/src/renderer/src/terminal/useArabicTerminalSync.ts b/src/renderer/src/terminal/useArabicTerminalSync.ts
new file mode 100644
index 00000000..3896b841
--- /dev/null
+++ b/src/renderer/src/terminal/useArabicTerminalSync.ts
@@ -0,0 +1,29 @@
+import { useEffect, useRef } from 'react';
+import { useTranslation } from 'react-i18next';
+import { isArabicTerminalEnabled } from './arabicSetting';
+import { notifyArabicTerminalChangeAll } from '@/components/terminalPool';
+
+/**
+ * Make terminal Arabic/RTL rendering follow the app language.
+ *
+ * Mounted once, near the root. `isArabicTerminalEnabled()` already reads the
+ * language, so the VALUE is correct the moment a user switches — but terminals
+ * that are already open read it at attach time and would otherwise keep
+ * rendering the old way until they were recreated. This is the push half.
+ *
+ * Skips the first run: on mount every terminal was created under the current
+ * setting already, so there is nothing to switch, and firing anyway would drop
+ * a WebGL lease at boot for no reason.
+ */
+export function useArabicTerminalSync(): void {
+ const { i18n } = useTranslation();
+ const lng = i18n.language;
+ const last = useRef<boolean | null>(null);
+ useEffect(() => {
+ const want = isArabicTerminalEnabled();
+ if (last.current === null) { last.current = want; return; }
+ if (last.current === want) return;
+ last.current = want;
+ notifyArabicTerminalChangeAll();
+ }, [lng]);
+}
diff --git a/test/arabic-terminal.test.cjs b/test/arabic-terminal.test.cjs
index 0634fb68..7a1c273d 100644
--- a/test/arabic-terminal.test.cjs
+++ b/test/arabic-terminal.test.cjs
@@ -72,24 +72,79 @@ test('isArabicCp covers the script blocks and nothing else', () => {
// --- the gates -------------------------------------------------------------
-test('the feature is off by default and does not sniff the OS locale', () => {
+test('the default follows the app language, and still never sniffs the OS locale', () => {
+ // The founder amended this after the terminal half landed: picking Arabic as
+ // the UI language should turn terminal RTL on by itself, because a user who
+ // picked Arabic has already answered the question the toggle asks. So the
+ // default is no longer a hardcoded false — it is the app language. What did
+ // NOT change is where the language comes from: a choice made in this app,
+ // never `navigator.languages`.
const src = read('src/renderer/src/terminal/arabicSetting.ts');
- assert.doesNotMatch(src, /navigator/,
+ // Comments stripped: the file explains at length WHY it refuses to read the
+ // OS locale, and naming the API it refuses to call must not read as a use.
+ const code = src.replace(/\/\*[\s\S]*?\*\//g, '').replace(/\/\/.*$/gm, '');
+ assert.doesNotMatch(code, /navigator/,
'arabicSetting reads the OS locale again — the founder ruled that out');
- assert.match(src, /return false;\s*\n\}/, 'read() must fall back to false');
+ assert.match(code, /isRtlLanguage\(i18n\.language\)/,
+ 'the default must come from the SELECTED app language');
+ assert.match(code, /override \?\? languageDefault\(\)/,
+ 'an explicit choice must still win over the language default');
});
-test('nothing Arabic is wired into a terminal unless the toggle is on', () => {
+test('the override is three-valued, so a deliberate choice survives a language switch', () => {
+ // Two-valued would make this a derived flag with no escape hatch: an English
+ // user who needs Arabic terminals for their colleagues' logs could not keep
+ // it on, and an Arabic user could not get the GPU renderer's speed back.
+ const src = read('src/renderer/src/terminal/arabicSetting.ts');
+ assert.match(src, /type Override = boolean \| null/,
+ 'unset must be distinguishable from an explicit false');
+ assert.match(src, /removeItem\(KEY\)/,
+ 'there must be a way back to following the language');
+ // setArabicTerminalEnabled always WRITES, including when the new value
+ // happens to equal today's language default — otherwise the choice would
+ // evaporate the moment the language moved.
+ const setter = src.slice(src.indexOf('export function setArabicTerminalEnabled'));
+ assert.match(setter.slice(0, 300), /setItem\(KEY/,
+ 'an explicit choice must be persisted unconditionally');
+});
+
+test('nothing Arabic is wired into a terminal unless the setting says so', () => {
const src = read('src/renderer/src/components/terminalPool.ts');
- // Match the CALL, not the import line at the top of the file.
+ // All three now live in enableArabicRendering(), which exists so the first
+ // attach and the live language switch cannot drift apart. The guarantee is
+ // unchanged: nothing reaches a terminal except through that one function, and
+ // every call to it is behind isArabicTerminalEnabled().
+ const fn = src.slice(src.indexOf('function enableArabicRendering'));
+ const body = fn.slice(0, fn.indexOf('\n}\n'));
for (const call of ['registerCharacterJoiner(', 'attachArabicSpacingFix(entry.host)', "classList.add('cth-bidi')"]) {
- const i = src.indexOf(call);
- assert.ok(i > 0, `${call} is missing`);
- const guard = src.lastIndexOf('if (isArabicTerminalEnabled())', i);
- assert.ok(guard > 0 && i - guard < 1200, `${call} is not behind the enabled check`);
+ assert.ok(body.includes(call), `${call} is not in enableArabicRendering`);
+ const occurrences = src.split(call).length - 1
+ - (call === 'registerCharacterJoiner(' ? src.split('deregisterCharacterJoiner(').length - 1 : 0);
+ assert.equal(occurrences, 1,
+ `${call} appears more than once — a second path around the gate`);
+ }
+ for (const [i, _] of [...src.matchAll(/enableArabicRendering\(entry\)/g)].map((m) => [m.index])) {
+ const guard = src.lastIndexOf('isArabicTerminalEnabled()', i);
+ assert.ok(guard > 0 && i - guard < 900,
+ 'a call to enableArabicRendering is not behind the enabled check');
}
});
+test('turning it off is a real undo, not a terminal rebuild', () => {
+ // A terminal's scrollback lives only in xterm's buffer and the pty will not
+ // resend it, so recreating one to apply a setting would silently eat the
+ // user's history. Every step of enableArabicRendering has to be reversible.
+ const src = read('src/renderer/src/components/terminalPool.ts');
+ const off = src.slice(src.indexOf('function disableArabicRendering'));
+ const body = off.slice(0, off.indexOf('\n}\n'));
+ assert.match(body, /deregisterCharacterJoiner/, 'the joiner is never removed');
+ assert.match(body, /classList\.remove\('cth-bidi'\)/, 'the bidi class is never removed');
+ assert.match(body, /detachSpacing\(\)/, 'the spacing observer is never detached');
+ const sweep = src.slice(src.indexOf('export function notifyArabicTerminalChangeAll'));
+ assert.doesNotMatch(sweep.slice(0, sweep.indexOf('\n}\n')), /\bterm\.dispose\b|acquireTerminal/,
+ 'the live switch must not dispose or recreate a terminal');
+});
+
test('the bidi CSS is scoped, so it cannot reach a terminal that never opted in', () => {
const css = read('src/renderer/src/design/global.css');
// Only the terminal-row bidi rules. global.css also has a pre-existing
diff --git a/test/arabic-ui.test.cjs b/test/arabic-ui.test.cjs
new file mode 100644
index 00000000..a2c859da
--- /dev/null
+++ b/test/arabic-ui.test.cjs
@@ -0,0 +1,271 @@
+'use strict';
+
+// The UI half of PR #213: the Arabic locale, and right-to-left layout.
+//
+// It lands under ONE condition, the same one the terminal half landed under and
+// the only condition the founder attached to shipping this with gaps: NOTHING
+// CHANGES FOR A USER WHO HAS NOT SELECTED ARABIC. Not layout, not direction,
+// not fonts, not spacing. These tests are that condition, plus the structural
+// checks that keep a partial translation falling back to English cleanly.
+//
+// Arabic CORRECTNESS is NOT tested here and is NOT claimed. The strings were
+// written by an agent, not reviewed by an Arabic reader. Everything below is
+// about coverage, shape, and inertness — never about whether the Arabic reads
+// well. Do not let a green run here be read as "the translation was checked".
+
+const test = require('node:test');
+const assert = require('node:assert/strict');
+const fs = require('node:fs');
+const path = require('node:path');
+
+const root = path.join(__dirname, '..');
+const read = (p) => fs.readFileSync(path.join(root, p), 'utf8');
+const locale = (code) =>
+ JSON.parse(read(`src/renderer/src/i18n/locales/${code}.json`));
+
+/** Every leaf path in a locale tree, arrays included by index. */
+function leaves(node, prefix = '') {
+ if (Array.isArray(node)) return node.flatMap((v, i) => leaves(v, `${prefix}.${i}`));
+ if (node && typeof node === 'object') {
+ return Object.entries(node).flatMap(([k, v]) => leaves(v, prefix ? `${prefix}.${k}` : k));
+ }
+ return [[prefix, node]];
+}
+const pathsOf = (o) => new Map(leaves(o));
+
+/** Source with comments removed, for assertions about what the CODE does. */
+const strip = (src) => src.replace(/\/\*[\s\S]*?\*\//g, '').replace(/\/\/.*$/gm, '');
+
+const en = locale('en');
+const ar = locale('ar');
+const zh = locale('zh-CN');
+
+// --- the gate: inert for everyone who did not pick Arabic ------------------
+
+test('direction is decided by the SELECTED language and nothing else', () => {
+ const src = read('src/renderer/src/i18n/useDirection.ts');
+ // Comments stripped throughout this file: these modules explain at length what
+ // they refuse to read, and naming an API must not read as calling it.
+ const code = strip(src);
+ // Not the OS, not the browser, not the content on screen. Each of these would
+ // mirror the UI of a user who never asked for it.
+ for (const sniff of ['navigator', 'matchMedia', 'textContent']) {
+ assert.ok(!code.includes(sniff), `useDirection reads ${sniff} — that is not a user choice`);
+ }
+ assert.match(code, /isRtlLanguage\(i18n\.language\)/);
+});
+
+test('an unregistered language code is left-to-right, never guessed at', () => {
+ const src = read('src/renderer/src/i18n/index.ts');
+ // Exact set membership. A prefix match ('ar-EG'.startsWith('ar')) or a script
+ // guess would let an unknown value mirror somebody's UI, and LTR is the
+ // direction every existing user already has.
+ assert.match(src, /RTL_CODES\.has\(lng\)/,
+ 'isRtlLanguage must be exact-match on a registered code');
+ assert.match(src, /LANGUAGES\.filter\(\(l\) => l\.dir === 'rtl'\)/,
+ 'the RTL set must be derived from LANGUAGES, not maintained separately');
+});
+
+test('every RTL CSS rule is scoped to [dir="rtl"], so LTR sees no change at all', () => {
+ const css = read('src/renderer/src/design/global.css');
+ const marker = css.indexOf('─── RTL app language');
+ assert.ok(marker > 0, 'the RTL section vanished');
+ // Start at the comment's OPENING delimiter, or strip() sees a dangling `*/`
+ // and eats the wrong span.
+ const start = css.lastIndexOf('/*', marker);
+ const next = css.indexOf('/* ───', marker + 20);
+ // Comments stripped first: this section explains WHY each rule exists, in
+ // prose that otherwise reads like a selector list.
+ const body = strip(next > 0 ? css.slice(start, next) : css.slice(start));
+ const lines = body.split('\n').map((l) => l.trim()).filter(Boolean);
+ const selectors = lines.filter((l) => /^[.[#a-z]/.test(l) && (l.includes('{') || l.endsWith(',')));
+ assert.ok(selectors.length >= 5, `expected the RTL rules, found ${selectors.length}`);
+ for (const sel of selectors) {
+ assert.ok(sel.includes('[dir="rtl"]'),
+ `an unscoped rule in the RTL section changes layout for everyone: ${sel.trim()}`);
+ }
+});
+
+test('the terminal grid is pinned LTR under an RTL page', () => {
+ // `direction` inherits. Without this the xterm viewport picks up rtl from
+ // <html>, right-aligns the whole cell grid, and reverses every box-drawing
+ // frame — while the pty still addresses columns from the left. Per-row
+ // direction is a different layer (.cth-bidi) and is not affected.
+ const css = strip(read('src/renderer/src/design/global.css'));
+ // Every part of the grid, checked one at a time. A single regex over the whole
+ // rule passes while three of the four selectors are missing — the root alone
+ // does cover the rows by inheritance, but the viewport carries the scrollbar
+ // and the measure container decides cell width, and a partial removal here
+ // must not read as green.
+ const rule = css.slice(css.indexOf('[dir="rtl"] .xterm'));
+ const decl = rule.slice(0, rule.indexOf('}') + 1);
+ assert.match(decl, /direction: ltr;/, 'the xterm pin lost its declaration');
+ for (const sel of ['.xterm', '.xterm-viewport', '.xterm-screen', '.xterm-rows',
+ '.xterm-width-cache-measure-container']) {
+ // Anchored on the selector's END. `.xterm` is a prefix of every other name
+ // here, so a plain substring test reports the root as pinned when only
+ // `.xterm-viewport` survives.
+ const re = new RegExp(`\\[dir="rtl"\\] \\${sel}(?=\\s*[,{])`);
+ assert.match(decl, re,
+ `${sel} is not pinned to ltr, so an RTL app language mirrors part of the terminal`);
+ }
+});
+
+test('content direction in components is gated, never content-sniffed', () => {
+ // `dir="auto"` resolves from the first strong character, so ungated it flips
+ // a block of an ENGLISH user's UI the moment an agent writes a line of
+ // Arabic into it. Every site has to be behind the language gate.
+ const files = [
+ 'components/AddAgentModal', 'components/AgentStrip', 'components/AskMeTab',
+ 'components/CommandCenterPanel', 'components/FullscreenTerminal',
+ 'components/MemoryPanel', 'components/MessageQueueComposer',
+ 'components/TasksKanban', 'components/ThreadsPanel',
+ 'components/triggers/ContextSection', 'components/triggers/SchedulesSection',
+ 'components/triggers/TriggerHistoryTab'
+ ];
+ let gated = 0;
+ for (const f of files) {
+ const src = read(`src/renderer/src/${f}.tsx`);
+ const bare = src.match(/dir="auto"/g) ?? [];
+ assert.equal(bare.length, 0,
+ `${f} has an UNGATED dir="auto" — it fires for an English user`);
+ const g = src.match(/dir=\{rtl \? 'auto' : undefined\}/g) ?? [];
+ if (g.length) {
+ assert.match(src, /const rtl = useRtl\(\);/, `${f} uses rtl without reading it`);
+ assert.match(src, /from '@\/i18n\/useDirection'/, `${f} never imports the gate`);
+ }
+ gated += g.length;
+ }
+ assert.ok(gated >= 17, `expected the PR's dir sites to be carried over, found ${gated}`);
+});
+
+test('the markdown auto-direction plugin only runs for an RTL language', () => {
+ // The one piece Kevin held explicitly, because it is content-driven by design:
+ // an English user reading a document that happens to contain Arabic would
+ // have had blocks of it mirrored.
+ const src = read('src/renderer/src/markdown/MarkdownPreview.tsx');
+ assert.match(src, /rehypePlugins=\{rtl \? AUTO_DIR_PLUGINS : NO_PLUGINS\}/,
+ 'rehypeAutoDir is not behind the language gate');
+ assert.match(src, /const rtl = useRtl\(\);/);
+ // And the security invariant it sits next to is unchanged.
+ assert.ok(!src.includes('rehypeRaw'), 'rehype-raw must never be added here');
+});
+
+test('no unbundled webfont rides in with the Arabic locale', () => {
+ // PR #213 added IBM Plex Sans Arabic to every token stack and re-added the
+ // Google Fonts <link> that 41ea4c37 deliberately removed — a network fetch on
+ // boot, blocked in mainland China, and an ungated font change for every user.
+ // The bundled stacks already name system Arabic faces, so nothing is needed.
+ const tokens = read('src/renderer/src/design/tokens.css');
+ const html = read('src/renderer/index.html');
+ assert.ok(!tokens.includes('IBM Plex Sans Arabic'),
+ 'an unbundled font in a token stack changes type for every user');
+ assert.doesNotMatch(html, /<link[^>]*fonts\.googleapis\.com/,
+ 'the Google Fonts link is back — the app must render its own type offline');
+ assert.match(html, /font-src 'self'/,
+ 'the CSP no longer pins fonts to the bundle');
+ for (const face of ['Geeza Pro', 'Noto Naskh Arabic']) {
+ assert.ok(tokens.includes(face), `${face} fallback is missing from the token stacks`);
+ }
+});
+
+// --- coverage and shape: what makes a PARTIAL translation safe -------------
+
+test('English is still the default, and still not auto-detected', () => {
+ const code = strip(read('src/renderer/src/i18n/index.ts'));
+ assert.match(code, /return 'en';/, 'the fallback language must stay English');
+ assert.match(code, /fallbackLng: 'en'/, 'a missing Arabic key must fall back to English');
+ assert.ok(!code.includes('navigator'),
+ 'adding a locale must not turn on OS auto-detect');
+});
+
+test('ar is registered everywhere a language has to be registered', () => {
+ const src = read('src/renderer/src/i18n/index.ts');
+ assert.match(src, /ar: \{ translation: ar \}/, 'ar is missing from resources');
+ assert.match(src, /supportedLngs: \[[^\]]*'ar'[^\]]*\]/, 'ar is missing from supportedLngs');
+ assert.match(src, /code: 'ar'[^}]*dir: 'rtl'/, 'ar is not marked right-to-left');
+});
+
+test('every locale has exactly the same key tree', () => {
+ const e = pathsOf(en), a = pathsOf(ar), z = pathsOf(zh);
+ const missing = [...e.keys()].filter((k) => !a.has(k));
+ const extra = [...a.keys()].filter((k) => !e.has(k));
+ assert.deepEqual(missing, [], 'ar is missing keys — they would silently fall back');
+ assert.deepEqual(extra, [], 'ar has keys en does not — dead strings');
+ assert.equal(z.size, e.size, 'zh-CN drifted from en');
+ assert.ok(e.size > 1000, `sanity: only ${e.size} keys found`);
+});
+
+test('no Arabic string is left as its English source', () => {
+ // A copied English string is worse than a missing one: a missing key falls
+ // back to English deliberately, a copied one looks translated and is not.
+ // Strings that are IDENTICAL ON PURPOSE. Each is a proper noun, a literal
+ // path the user types, or a pure format string — translating any of them
+ // would make the UI wrong, not more Arabic.
+ const SAME_ON_PURPOSE = new Set([
+ 'settings.connections.slack', // product name
+ 'onboarding.providerBlurb.claude', // "Claude Code — Anthropic": two product names
+ 'onboarding.providerBlurb.codex',
+ 'onboarding.providerBlurb.antigravity',
+ 'onboarding.providerBlurb.gemini',
+ 'addAgent.projectPlaceholder', // /path/to/your/project — a filesystem path
+ 'onboarding.home.placeholder', // /path/to/HarnessAgents — same
+ 'mcpDefaults.toggleNote', // "{{id}}: {{state}}" — pure interpolation
+ 'webhooksSection.summary' // "{{count}} · {{state}}" — same
+ ]);
+ const e = pathsOf(en), a = pathsOf(ar);
+ const untranslated = [];
+ for (const [k, v] of e) {
+ if (typeof v !== 'string' || !/[A-Za-z]{4}/.test(v)) continue; // symbols, ids, brands
+ if (a.get(k) === v && !SAME_ON_PURPOSE.has(k)) untranslated.push(k);
+ }
+ assert.deepEqual(untranslated, [], `${untranslated.length} Arabic strings are still English`);
+ // The allowlist must not rot into a way of hiding real gaps.
+ const stale = [...SAME_ON_PURPOSE].filter((k) => a.get(k) !== e.get(k));
+ assert.deepEqual(stale, [], 'allowlisted keys that ARE translated — drop them from the list');
+});
+
+test('every interpolation variable survives translation', () => {
+ // `{{godName}}` mistyped is a literal "{{godname}}" on screen, and i18next
+ // will not warn. This is the highest-frequency way a locale file breaks.
+ const e = pathsOf(en), a = pathsOf(ar), z = pathsOf(zh);
+ const vars = (s) => [...String(s).matchAll(/\{\{\s*([\w.]+)\s*\}\}/g)].map((m) => m[1]).sort().join(',');
+ const bad = [];
+ for (const [k, v] of e) {
+ if (vars(v) !== vars(a.get(k))) bad.push(`ar ${k}: [${vars(v)}] -> [${vars(a.get(k))}]`);
+ if (vars(v) !== vars(z.get(k))) bad.push(`zh ${k}: [${vars(v)}] -> [${vars(z.get(k))}]`);
+ }
+ assert.deepEqual(bad, []);
+ // Positive control: the comparison above can actually fail.
+ assert.notEqual(vars('a {{x}}'), vars('a'));
+});
+
+test('inline markup and array shapes are preserved', () => {
+ // Several onboarding strings carry <strong>; the office flavour lines are
+ // arrays indexed by the scene, so a short array is an out-of-range read.
+ const e = pathsOf(en), a = pathsOf(ar);
+ const tags = (s) => [...String(s).matchAll(/<\/?([a-z]+)>/g)].map((m) => m[1]).sort().join(',');
+ for (const [k, v] of e) {
+ assert.equal(tags(a.get(k)), tags(v), `markup changed in ${k}`);
+ }
+ const count = (o, p) => p.split('.').reduce((n, s) => n?.[s], o);
+ for (const p of ['office.errand.smoke', 'office.suckUp', 'office.gossip', 'office.cheer']) {
+ assert.equal(count(ar, p).length, count(en, p).length, `${p} changed length`);
+ }
+});
+
+test('the terminal setting still explains its performance cost, in every locale', () => {
+ // The founder's amendment moved this setting's default onto the language but
+ // explicitly kept the control, because ON swaps the renderer and costs speed.
+ // Losing that explanation would be a real regression.
+ for (const [code, l] of [['en', en], ['zh-CN', zh], ['ar', ar]]) {
+ const g = l.settings.general;
+ assert.ok(g.arabicTerminalDesc, `${code} lost arabicTerminalDesc`);
+ assert.ok(g.arabicTerminalDesc.length > 80,
+ `${code}'s description is too short to still explain the tradeoff`);
+ assert.ok(g.arabicTerminalFollowsLanguage,
+ `${code} never says the value is coming from the language`);
+ }
+ // en names the two renderers explicitly; that is the substance of the note.
+ assert.match(en.settings.general.arabicTerminalDesc, /GPU/);
+});