Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

feat(mobile): 补齐移动端多语言(zh-CN/en/ja/ko,默认跟随系统,设置内可切换) (#260)

Lizie1b17eac2567
diff --git a/apps/mobile/app/(auth)/login.tsx b/apps/mobile/app/(auth)/login.tsx
index 8de63ea490..6eccc0c93e 100644
--- a/apps/mobile/app/(auth)/login.tsx
+++ b/apps/mobile/app/(auth)/login.tsx
@@ -1,4 +1,5 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
+import { useTranslation } from 'react-i18next';
import { Animated, Easing, Platform, StyleSheet, View } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import {
@@ -74,6 +75,9 @@ import { fontWeight, lineHeight, loginPalettes, loginSizes, radius, spacing, typ
* (x=35,loginY,680×560,figma §5.1 移动帧;键盘位移归 PR4b)。
*/
export default function LoginScreen() {
+ // 订阅语言变化:本屏文案走 loginText()(非响应式),useTranslation 保证
+ // 手动语言 override 恢复/切换时本屏跟着重渲(P2-a:不依赖 auth 重渲兜底)。
+ useTranslation();
const auth = useAuth();
const { markInteractive } = useObserve();
const stage = useLoginSurface();
diff --git a/apps/mobile/app/_layout.tsx b/apps/mobile/app/_layout.tsx
index be0db67e99..010469bb91 100644
--- a/apps/mobile/app/_layout.tsx
+++ b/apps/mobile/app/_layout.tsx
@@ -28,6 +28,9 @@ import {
import { DeviceLinkProvider } from '@/device-link/DeviceLinkContext';
import { PushNotificationsBridge } from '@/notifications/PushNotificationsBridge';
import { GestureHandlerRootView } from '@/platform/gestureHandler';
+// import 即同步完成 i18next init;必须先于任何 t() 消费方挂载。
+import '@/i18n';
+import { LocaleProvider } from '@/i18n/useLocale';
import { ThemeProvider, useTheme } from '@/theme/ThemeProvider';
import { createNavigationTheme } from '@/theme/navigationTheme';
import { MobileLoginHandoffStage } from '@/components/MobileLoginHandoffStage';
@@ -235,14 +238,17 @@ function RootLayout() {
<GestureHandlerRootView style={styles.gestureRoot}>
<SafeAreaProvider>
<ThemeProvider>
- {/* handoff Provider 常驻 root(PR4b):闸门屏切换不重置衔接状态机 */}
- <MobileLoginHandoffProvider>
- <EndpointHandoffBridge status={endpointGate.status} />
- {/* 启动闸门全程共用这一个 splash 实例;端点错误屏需要交互时才隐藏它 */}
- <StartupSplashOverlay hidden={endpointGate.status === 'error'}>
- {body}
- </StartupSplashOverlay>
- </MobileLoginHandoffProvider>
+ {/* 语言 Provider 常驻 root:恢复持久化 override,覆盖含 (auth) 在内的全部屏幕 */}
+ <LocaleProvider>
+ {/* handoff Provider 常驻 root(PR4b):闸门屏切换不重置衔接状态机 */}
+ <MobileLoginHandoffProvider>
+ <EndpointHandoffBridge status={endpointGate.status} />
+ {/* 启动闸门全程共用这一个 splash 实例;端点错误屏需要交互时才隐藏它 */}
+ <StartupSplashOverlay hidden={endpointGate.status === 'error'}>
+ {body}
+ </StartupSplashOverlay>
+ </MobileLoginHandoffProvider>
+ </LocaleProvider>
</ThemeProvider>
</SafeAreaProvider>
</GestureHandlerRootView>
diff --git a/apps/mobile/app/account-deletion.tsx b/apps/mobile/app/account-deletion.tsx
index 8fea89f22c..59e47b4fb6 100644
--- a/apps/mobile/app/account-deletion.tsx
+++ b/apps/mobile/app/account-deletion.tsx
@@ -1,4 +1,5 @@
import { useCallback, useEffect, useState } from 'react';
+import { useTranslation } from 'react-i18next';
import { useRouter } from 'expo-router';
import {
KeyboardAvoidingView,
@@ -36,6 +37,9 @@ import {
} from '@/theme/tokens';
export default function AccountDeletionScreen() {
+ // Subscribe to language changes: this screen renders via the non-reactive
+ // loginText(), so useTranslation() is what re-renders it on locale switch.
+ useTranslation();
const auth = useAuth();
const router = useRouter();
const styles = useThemedStyles(makeStyles);
diff --git a/apps/mobile/app/automations/[deviceId].tsx b/apps/mobile/app/automations/[deviceId].tsx
index f3aed875f1..3c9af37d72 100644
--- a/apps/mobile/app/automations/[deviceId].tsx
+++ b/apps/mobile/app/automations/[deviceId].tsx
@@ -11,6 +11,7 @@ import {
} from 'react-native';
import { Text, TextInput } from '@/components/AppText';
import { SafeAreaView } from 'react-native-safe-area-context';
+import { useTranslation } from 'react-i18next';
import { ConnectionBanner } from '@/components/ConnectionBanner';
import { goBackGuarded } from '@/utils/backGuard';
import {
@@ -110,6 +111,7 @@ interface DeleteRunState {
export default function AutomationsScreen() {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const params = useLocalSearchParams<{ deviceId: string; name?: string }>();
const deviceId = String(params.deviceId ?? '');
const deviceName = String(params.name ?? deviceId);
@@ -516,7 +518,7 @@ export default function AutomationsScreen() {
try {
if (target.source === 'project') {
if (!isProjectAutomationSchedule(target)) {
- throw new Error('项目自动化缺少 projectConfigId,请在桌面端删除');
+ throw new Error(t('devices.automations.error.projectMissingConfig'));
}
await maker.projectAutomation.removeSchedule({
workingDir: target.workingDir!,
@@ -545,7 +547,7 @@ export default function AutomationsScreen() {
setSelectedId((prev) => (prev === schedule.id ? null : prev));
setDeleteState(null);
if (failedSessionIds.length > 0) {
- setError(`自动化已删除,但 ${failedSessionIds.length} 个生成会话未能更新状态。请在桌面端检查这些会话。`);
+ setError(t('devices.automations.error.deletePartial', { count: failedSessionIds.length }));
}
await loadSchedules();
} catch (err) {
@@ -553,7 +555,7 @@ export default function AutomationsScreen() {
} finally {
setBusyAction(null);
}
- }, [busyAction, deleteState, deviceId, loadSchedules, maker]);
+ }, [busyAction, deleteState, deviceId, loadSchedules, maker, t]);
const requestDeleteSchedule = useCallback((schedule: RemoteSchedule) => {
if (busyAction) return;
@@ -726,14 +728,14 @@ export default function AutomationsScreen() {
<SafeAreaView style={styles.safeArea} testID="automations.screen">
<ScreenHeader
action={{
- label: '新建',
+ label: t('devices.common.create'),
onPress: busyAction ? undefined : startCreateSchedule,
testID: 'automations.createButton',
}}
backTestID="automations.backButton"
eyebrow="Remote Automations"
onBack={() => goBackGuarded(router)}
- subtitle={`${overview.activeCount} 个运行中 · ${overview.totalCount} 个任务`}
+ subtitle={t('devices.automations.subtitle', { active: overview.activeCount, total: overview.totalCount })}
title={deviceName}
titleTestID="automations.title"
/>
@@ -757,20 +759,20 @@ export default function AutomationsScreen() {
>
<View style={[styles.summaryTopRow, { gap: windowLayout.metricGap }]}>
<MainWindowMetric
- label="运行中"
+ label={t('devices.automations.metric.running')}
style={{ minHeight: windowLayout.metricMinHeight, minWidth: windowLayout.metricMinWidth }}
value={overview.activeCount}
valueSize="large"
/>
<MainWindowMetric
- label="未读结果"
+ label={t('devices.automations.metric.unreadResults')}
style={{ minHeight: windowLayout.metricMinHeight, minWidth: windowLayout.metricMinWidth }}
urgent={overview.unreadRunCount > 0}
value={overview.unreadRunCount}
valueSize="large"
/>
<MainWindowMetric
- label="执行中"
+ label={t('devices.automations.metric.executing')}
style={{ minHeight: windowLayout.metricMinHeight, minWidth: windowLayout.metricMinWidth }}
urgent={overview.runningRunCount > 0}
value={overview.runningRunCount}
@@ -779,8 +781,8 @@ export default function AutomationsScreen() {
</View>
<Text style={styles.summaryCopy} numberOfLines={2}>
{overview.pausedCount > 0
- ? `${overview.pausedCount} 个任务已暂停。选择任务后可以运行、暂停、编辑或打开最近会话。`
- : '选择任务后可以运行、暂停、编辑或打开最近会话。'}
+ ? t('devices.automations.summary.paused', { count: overview.pausedCount })
+ : t('devices.automations.summary.default')}
</Text>
</SummaryStrip>
@@ -862,20 +864,20 @@ export default function AutomationsScreen() {
<RemoteListSyncingPlaceholder testID="automations.syncing" />
) : (
<MainWindowEmptyState
- copy="可以直接从手机创建第一条自动化任务,或在桌面端创建后同步到这里。"
+ copy={t('devices.automations.empty.copy')}
style={{
minHeight: windowLayout.emptyMinHeight,
padding: windowLayout.emptyPadding,
}}
testID="automations.empty"
- title="这台电脑暂无自动化"
+ title={t('devices.automations.empty.title')}
>
<MainWindowActionGroup
primaryActions={[
{
- accessibilityLabel: '新建自动化',
+ accessibilityLabel: t('devices.automations.createAutomation'),
disabled: !!busyAction,
- label: '新建自动化',
+ label: t('devices.automations.createAutomation'),
onPress: startCreateSchedule,
testID: 'automations.emptyCreateButton',
tone: 'primary',
@@ -922,14 +924,14 @@ export default function AutomationsScreen() {
/>
<View style={styles.runsHeader}>
- <Text style={styles.sectionTitle}>最近执行</Text>
+ <Text style={styles.sectionTitle}>{t('devices.automations.recentRuns')}</Text>
{runsLoading ? <ActivityIndicator color={colors.textSecondary} /> : null}
</View>
{displayedRuns.length === 0 ? (
<MainWindowEmptyState
- copy="点击 Run now 后会在这里看到新 run。"
+ copy={t('devices.automations.runs.emptyCopy')}
style={styles.emptyInline}
- title="还没有执行记录"
+ title={t('devices.automations.runs.emptyTitle')}
/>
) : (
<View style={styles.runList} testID="automations.runList">
@@ -995,6 +997,7 @@ function ScheduleFormCard({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const setField = <K extends keyof MobileScheduleDraft>(key: K, value: MobileScheduleDraft[K]) => {
onChange({ ...draft, [key]: value });
};
@@ -1014,17 +1017,17 @@ function ScheduleFormCard({
[boundSessionInputValue, sessions],
);
const sessionModeCopy = sessionMode === 'bound'
- ? '绑定已有会话后,目录、worktree、Agent 和 Fast 模式跟随该会话。'
+ ? t('devices.automations.form.sessionMode.bound')
: sessionMode === 'persistent'
- ? '首次触发会创建持续会话,后续触发继续接在同一会话里。'
- : '每次触发都会创建新的会话。';
+ ? t('devices.automations.form.sessionMode.persistent')
+ : t('devices.automations.form.sessionMode.fresh');
return (
<View style={styles.formCard} testID="automations.form">
<View style={styles.formHeader}>
<View>
<Text style={styles.sectionTitle}>{mode === 'edit' ? 'Edit Automation' : 'New Automation'}</Text>
- <Text style={styles.formTitle}>{mode === 'edit' ? '编辑自动化' : '新建自动化'}</Text>
+ <Text style={styles.formTitle}>{mode === 'edit' ? t('devices.automations.form.title.edit') : t('devices.automations.form.title.create')}</Text>
</View>
{busy ? <ActivityIndicator color={colors.textSecondary} /> : null}
</View>
@@ -1046,12 +1049,12 @@ function ScheduleFormCard({
) : null}
<View style={styles.fieldGroup}>
- <Text style={styles.fieldLabel}>名称</Text>
+ <Text style={styles.fieldLabel}>{t('devices.automations.form.field.name')}</Text>
<TextInput
autoCapitalize="none"
editable={!busy}
onChangeText={(value) => setField('name', value)}
- placeholder="例如:每日项目巡检"
+ placeholder={t('devices.automations.form.namePlaceholder')}
placeholderTextColor={colors.textTertiary}
style={styles.input}
testID="automations.form.nameInput"
@@ -1061,16 +1064,16 @@ function ScheduleFormCard({
{draft.executionMode === 'script' ? (
<Text style={styles.fieldHint} testID="automations.form.scriptModeHint">
- 这是一个仅运行脚本任务,脚本配置只能在桌面端编辑;此处可以改动名称、触发方式、通知等其它字段。
+ {t('devices.automations.form.scriptHint')}
</Text>
) : (
<View style={styles.fieldGroup}>
- <Text style={styles.fieldLabel}>提示词</Text>
+ <Text style={styles.fieldLabel}>{t('devices.automations.form.field.prompt')}</Text>
<TextInput
editable={!busy}
multiline
onChangeText={onPromptChange}
- placeholder="写清楚每次自动执行要让 Cindy 做什么"
+ placeholder={t('devices.automations.form.promptPlaceholder')}
placeholderTextColor={colors.textTertiary}
style={[styles.input, styles.textArea]}
testID="automations.form.promptInput"
@@ -1081,19 +1084,19 @@ function ScheduleFormCard({
)}
<View style={styles.fieldGroup}>
- <Text style={styles.fieldLabel}>触发方式</Text>
+ <Text style={styles.fieldLabel}>{t('devices.automations.form.field.trigger')}</Text>
<View style={styles.segmentRow}>
<SegmentButton
active={draft.runMode === 'recurring'}
disabled={busy}
- label="周期"
+ label={t('devices.automations.form.trigger.recurring')}
onPress={() => onChange(updateDraftRunMode(draft, 'recurring'))}
testID="automations.form.runModeRecurring"
/>
<SegmentButton
active={draft.runMode === 'manual'}
disabled={busy}
- label="手动"
+ label={t('devices.automations.form.trigger.manual')}
onPress={() => onChange(updateDraftRunMode(draft, 'manual'))}
testID="automations.form.runModeManual"
/>
@@ -1102,26 +1105,26 @@ function ScheduleFormCard({
{!isScriptTask ? (
<View style={styles.fieldGroup}>
- <Text style={styles.fieldLabel}>运行会话</Text>
+ <Text style={styles.fieldLabel}>{t('devices.automations.form.field.runSession')}</Text>
<View style={styles.segmentRow} testID="automations.form.sessionMode">
<SegmentButton
active={sessionMode === 'fresh'}
disabled={busy}
- label="新会话"
+ label={t('devices.automations.form.session.fresh')}
onPress={() => onChange(updateDraftSessionMode(draft, 'fresh'))}
testID="automations.form.sessionModeFresh"
/>
<SegmentButton
active={sessionMode === 'persistent'}
disabled={busy}
- label="持续"
+ label={t('devices.automations.form.session.persistent')}
onPress={() => onChange(updateDraftSessionMode(draft, 'persistent'))}
testID="automations.form.sessionModePersistent"
/>
<SegmentButton
active={sessionMode === 'bound'}
disabled={busy}
- label="绑定"
+ label={t('devices.automations.form.session.bound')}
onPress={() => onChange(updateDraftSessionMode(draft, 'bound'))}
testID="automations.form.sessionModeBound"
/>
@@ -1134,12 +1137,12 @@ function ScheduleFormCard({
{!isScriptTask && sessionMode === 'bound' ? (
<View style={styles.fieldGroup} testID="automations.form.boundSession">
- <Text style={styles.fieldLabel}>绑定会话</Text>
+ <Text style={styles.fieldLabel}>{t('devices.automations.form.field.boundSession')}</Text>
{boundSessionOptions.length ? (
<View style={styles.boundSessionOptions} testID="automations.form.boundSessionOptions">
{boundSessionOptions.map((session) => (
<MainWindowRowButton
- accessibilityLabel={`绑定会话 ${session.title || session.id}`}
+ accessibilityLabel={t('devices.automations.form.boundSessionA11y', { name: session.title || session.id })}
accessibilityRole="radio"
accessibilityState={{ checked: session.id === boundSessionInputValue.trim() }}
disabled={busy}
@@ -1177,12 +1180,12 @@ function ScheduleFormCard({
{draft.runMode === 'recurring' ? (
<>
<View style={styles.fieldGroup}>
- <Text style={styles.fieldLabel}>间隔分钟</Text>
+ <Text style={styles.fieldLabel}>{t('devices.automations.form.field.intervalMinutes')}</Text>
<TextInput
editable={!busy}
keyboardType="number-pad"
onChangeText={(value) => setField('intervalMinutes', value)}
- placeholder="留空则使用 cron"
+ placeholder={t('devices.automations.form.intervalPlaceholder')}
placeholderTextColor={colors.textTertiary}
style={styles.input}
testID="automations.form.intervalInput"
@@ -1207,19 +1210,19 @@ function ScheduleFormCard({
{!isScriptTask ? (
<View style={styles.fieldGroup}>
- <Text style={styles.fieldLabel}>工作区</Text>
+ <Text style={styles.fieldLabel}>{t('devices.automations.form.field.workspace')}</Text>
<View style={styles.segmentRow}>
<SegmentButton
active={draft.workspaceKind === 'project'}
disabled={busy}
- label="项目"
+ label={t('devices.automations.form.workspace.project')}
onPress={() => onChange(updateDraftWorkspaceKind(draft, 'project'))}
testID="automations.form.workspaceProject"
/>
<SegmentButton
active={draft.workspaceKind === 'dialogue'}
disabled={busy}
- label="对话"
+ label={t('devices.automations.form.workspace.dialogue')}
onPress={() => onChange(updateDraftWorkspaceKind(draft, 'dialogue'))}
testID="automations.form.workspaceDialogue"
/>
@@ -1230,7 +1233,7 @@ function ScheduleFormCard({
{(isScriptTask || draft.workspaceKind === 'project') && !hideWorkspaceFields ? (
<>
<View style={styles.fieldGroup}>
- <Text style={styles.fieldLabel}>项目目录</Text>
+ <Text style={styles.fieldLabel}>{t('devices.automations.form.field.projectDir')}</Text>
<TextInput
autoCapitalize="none"
editable={!busy}
@@ -1246,7 +1249,7 @@ function ScheduleFormCard({
<ToggleRow
active={draft.useWorktree}
disabled={busy}
- label="使用 worktree"
+ label={t('devices.automations.form.useWorktree')}
onPress={() => setField('useWorktree', !draft.useWorktree)}
testID="automations.form.worktreeToggle"
/>
@@ -1277,12 +1280,12 @@ function ScheduleFormCard({
</View>
<View style={styles.fieldGroup}>
- <Text style={styles.fieldLabel}>模型</Text>
+ <Text style={styles.fieldLabel}>{t('devices.automations.form.field.model')}</Text>
<TextInput
autoCapitalize="none"
editable={!busy}
onChangeText={(value) => setField('model', value)}
- placeholder={hasRealBinding ? '跟随会话' : draft.agentKind === 'codex' ? 'gpt-5.5' : 'claude-sonnet-4-6'}
+ placeholder={hasRealBinding ? t('devices.automations.form.modelPlaceholderBound') : draft.agentKind === 'codex' ? 'gpt-5.5' : 'claude-sonnet-4-6'}
placeholderTextColor={colors.textTertiary}
style={styles.input}
testID="automations.form.modelInput"
@@ -1291,7 +1294,7 @@ function ScheduleFormCard({
</View>
<View style={styles.fieldGroup}>
- <Text style={styles.fieldLabel}>推理强度</Text>
+ <Text style={styles.fieldLabel}>{t('devices.automations.form.field.effort')}</Text>
<TextInput
autoCapitalize="none"
editable={!busy}
@@ -1308,7 +1311,7 @@ function ScheduleFormCard({
<ToggleRow
active={draft.fastMode}
disabled={busy}
- label="Fast 模式"
+ label={t('devices.automations.form.fastMode')}
onPress={() => setField('fastMode', !draft.fastMode)}
testID="automations.form.fastModeToggle"
/>
@@ -1317,7 +1320,7 @@ function ScheduleFormCard({
) : null}
<View style={styles.fieldGroup}>
- <Text style={styles.fieldLabel}>时区</Text>
+ <Text style={styles.fieldLabel}>{t('devices.automations.form.field.timezone')}</Text>
<TextInput
autoCapitalize="none"
editable={!busy}
@@ -1333,7 +1336,7 @@ function ScheduleFormCard({
<ToggleRow
active={draft.notifyDesktop}
disabled={busy}
- label="桌面通知"
+ label={t('devices.automations.form.notifyDesktop')}
onPress={() => setField('notifyDesktop', !draft.notifyDesktop)}
testID="automations.form.notifyDesktopToggle"
/>
@@ -1341,7 +1344,7 @@ function ScheduleFormCard({
<ToggleRow
active={draft.notifyFeishu}
disabled={busy}
- label="飞书通知"
+ label={t('devices.automations.form.notifyFeishu')}
onPress={() => setField('notifyFeishu', !draft.notifyFeishu)}
testID="automations.form.notifyFeishuToggle"
/>
@@ -1349,18 +1352,18 @@ function ScheduleFormCard({
<MainWindowActionGroup
primaryActions={[
{
- accessibilityLabel: busy ? '正在保存自动化' : '保存自动化',
+ accessibilityLabel: busy ? t('devices.automations.form.savingA11y') : t('devices.automations.form.saveA11y'),
disabled: busy,
- label: busy ? '保存中' : '保存',
+ label: busy ? t('devices.common.saving') : t('devices.common.save'),
onPress: onSubmit,
testID: 'automations.form.saveButton',
tone: 'primary',
},
]}
cancelAction={{
- accessibilityLabel: '取消编辑自动化',
+ accessibilityLabel: t('devices.automations.form.cancelA11y'),
disabled: busy,
- label: '取消',
+ label: t('devices.common.cancel'),
onPress: onCancel,
testID: 'automations.form.cancelButton',
}}
@@ -1385,61 +1388,62 @@ function ScheduleDeleteCard({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const previewText = state.loading
- ? '正在统计由这条自动化生成的会话...'
+ ? t('devices.automations.delete.counting')
: describeScheduleDeletePreview({
sessionIds: state.sessionIds ?? [],
sessionCount: state.sessionIds?.length ?? 0,
inflightCount: state.inflightCount ?? 0,
});
const confirmText = state.disposition === 'delete'
- ? '删除任务和会话'
+ ? t('devices.automations.delete.confirmDeleteBoth')
: state.disposition === 'archive'
- ? '删除任务并归档会话'
- : '只删除任务';
+ ? t('devices.automations.delete.confirmArchive')
+ : t('devices.automations.delete.confirmTaskOnly');
return (
<View style={styles.deleteCard} testID="automations.deleteDialog">
<View style={styles.deleteHeader}>
<View style={styles.deleteHeaderText}>
<Text style={styles.sectionTitle}>Delete Automation</Text>
- <Text style={styles.deleteTitle} numberOfLines={2}>删除 {state.schedule.name}</Text>
+ <Text style={styles.deleteTitle} numberOfLines={2}>{t('devices.automations.delete.title', { name: state.schedule.name })}</Text>
</View>
{state.loading || busy ? <ActivityIndicator color={colors.textSecondary} /> : null}
</View>
<Text style={styles.deleteCopy}>
- 删除自动化任务不会中断已经开始的执行。生成过的会话按下面的选项处理,和桌面端保持一致。
+ {t('devices.automations.delete.copy')}
</Text>
<Text style={styles.deletePreview} testID="automations.delete.preview">
{previewText}
</Text>
{state.error ? <Text style={styles.formError}>{state.error}</Text> : null}
<View
- accessibilityLabel="选择生成会话处理方式"
+ accessibilityLabel={t('devices.automations.delete.optionsA11y')}
accessibilityRole="radiogroup"
style={styles.deleteOptions}
testID="automations.delete.options"
>
<DeleteDispositionOption
- description="只删除这条自动化任务,历史会话继续保留在原列表里。"
+ description={t('devices.automations.delete.keepDesc')}
disabled={busy}
- label="保留生成会话"
+ label={t('devices.automations.delete.keepLabel')}
onPress={() => onDispositionChange('keep')}
selected={state.disposition === 'keep'}
testID="automations.delete.option.keep"
/>
<DeleteDispositionOption
- description="删除任务后,把由它生成的会话移到归档,后续仍可搜索。"
+ description={t('devices.automations.delete.archiveDesc')}
disabled={busy}
- label="归档生成会话"
+ label={t('devices.automations.delete.archiveLabel')}
onPress={() => onDispositionChange('archive')}
selected={state.disposition === 'archive'}
testID="automations.delete.option.archive"
/>
<DeleteDispositionOption
- description="删除任务后,把由它生成的会话也标记为删除。这个操作不可从手机端撤销。"
+ description={t('devices.automations.delete.deleteDesc')}
disabled={busy}
- label="删除生成会话"
+ label={t('devices.automations.delete.deleteLabel')}
onPress={() => onDispositionChange('delete')}
selected={state.disposition === 'delete'}
testID="automations.delete.option.delete"
@@ -1447,17 +1451,17 @@ function ScheduleDeleteCard({
</View>
<MainWindowActionGroup
cancelAction={{
- accessibilityLabel: '取消删除自动化',
+ accessibilityLabel: t('devices.automations.delete.cancelA11y'),
disabled: busy,
- label: '取消',
+ label: t('devices.common.cancel'),
onPress: onCancel,
testID: 'automations.delete.cancelButton',
}}
dangerActions={[
{
- accessibilityLabel: '确认删除自动化',
+ accessibilityLabel: t('devices.automations.delete.confirmA11y'),
disabled: busy || state.loading,
- label: busy ? '删除中' : confirmText,
+ label: busy ? t('devices.common.deleting') : confirmText,
onPress: onConfirm,
testID: 'automations.delete.confirmButton',
tone: 'danger',
@@ -1482,6 +1486,7 @@ function SchedulePauseCard({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const confirmation = buildSchedulePauseConfirmation(state.schedule, state.inflightCount);
return (
<View style={styles.pauseCard} testID="automations.pauseDialog">
@@ -1489,33 +1494,33 @@ function SchedulePauseCard({
<View style={styles.deleteHeaderText}>
<Text style={styles.sectionTitle}>Pause Automation</Text>
<Text style={styles.deleteTitle} numberOfLines={2}>
- {confirmation?.title ?? `暂停 ${state.schedule.name || state.schedule.id}`}
+ {confirmation?.title ?? t('devices.automations.pause.title', { name: state.schedule.name || state.schedule.id })}
</Text>
</View>
{busy ? <ActivityIndicator color={colors.textSecondary} /> : null}
</View>
<Text style={styles.deleteCopy}>
- {confirmation?.detail ?? '暂停会阻止这条自动化继续触发。'}
+ {confirmation?.detail ?? t('devices.automations.pause.detailFallback')}
</Text>
<Text style={styles.deletePreview} testID="automations.pause.preview">
- {confirmation?.preview ?? '没有正在执行的 run'}
+ {confirmation?.preview ?? t('devices.automations.pause.previewFallback')}
</Text>
{state.error ? <Text style={styles.formError}>{state.error}</Text> : null}
<MainWindowActionGroup
primaryActions={[
{
- accessibilityLabel: '确认暂停自动化',
+ accessibilityLabel: t('devices.automations.pause.confirmA11y'),
disabled: busy,
- label: busy ? '暂停中' : '确认暂停',
+ label: busy ? t('devices.automations.pause.pausing') : t('devices.automations.pause.confirm'),
onPress: onConfirm,
testID: 'automations.pause.confirmButton',
tone: 'primary',
},
]}
cancelAction={{
- accessibilityLabel: '取消暂停自动化',
+ accessibilityLabel: t('devices.automations.pause.cancelA11y'),
disabled: busy,
- label: '取消',
+ label: t('devices.common.cancel'),
onPress: onCancel,
testID: 'automations.pause.cancelButton',
}}
@@ -1538,6 +1543,7 @@ function RunDeleteCard({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const summary = summarizeRun(state.run);
return (
<View style={styles.pauseCard} testID="automations.runDeleteDialog">
@@ -1545,13 +1551,13 @@ function RunDeleteCard({
<View style={styles.deleteHeaderText}>
<Text style={styles.sectionTitle}>Delete Run</Text>
<Text style={styles.deleteTitle} numberOfLines={2}>
- 删除这条执行记录
+ {t('devices.automations.runDelete.title')}
</Text>
</View>
{busy ? <ActivityIndicator color={colors.textSecondary} /> : null}
</View>
<Text style={styles.deleteCopy}>
- 只会删除这条自动化执行记录,不会删除它打开过的会话,也不会影响后续自动触发。
+ {t('devices.automations.runDelete.copy')}
</Text>
<Text style={styles.deletePreview} testID="automations.runDelete.preview">
{summary.title} · {summary.subtitle}
@@ -1560,18 +1566,18 @@ function RunDeleteCard({
<MainWindowActionGroup
dangerActions={[
{
- accessibilityLabel: '确认删除执行记录',
+ accessibilityLabel: t('devices.automations.runDelete.confirmA11y'),
disabled: busy,
- label: busy ? '删除中' : '删除记录',
+ label: busy ? t('devices.common.deleting') : t('devices.automations.runDelete.confirm'),
onPress: onConfirm,
testID: 'automations.runDelete.confirmButton',
tone: 'danger',
},
]}
cancelAction={{
- accessibilityLabel: '取消删除执行记录',
+ accessibilityLabel: t('devices.automations.runDelete.cancelA11y'),
disabled: busy,
- label: '取消',
+ label: t('devices.common.cancel'),
onPress: onCancel,
testID: 'automations.runDelete.cancelButton',
}}
@@ -1641,16 +1647,17 @@ function TemplatePicker({
templates: readonly RemoteScheduleTemplate[];
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
const selected = templates.find((template) => template.id === selectedTemplateId) ?? null;
return (
<View style={styles.templateSection} testID="automations.templateSection">
<View style={styles.templateHeader}>
- <Text style={styles.fieldLabel}>模板</Text>
+ <Text style={styles.fieldLabel}>{t('devices.automations.template.label')}</Text>
<MainWindowActionButton
action={{
- accessibilityLabel: loading ? '模板加载中' : '刷新自动化模板',
+ accessibilityLabel: loading ? t('devices.automations.template.loadingA11y') : t('devices.automations.template.refreshA11y'),
disabled: busy || loading,
- label: loading ? '加载中' : '刷新',
+ label: loading ? t('devices.automations.template.loading') : t('devices.automations.template.refresh'),
onPress: onReload,
testID: 'automations.templateReloadButton',
}}
@@ -1704,9 +1711,10 @@ function TemplateCard({
template: RemoteScheduleTemplate;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
return (
<MainWindowCardButton
- accessibilityLabel={`自动化模板 ${template.name}`}
+ accessibilityLabel={t('devices.automations.template.cardA11y', { name: template.name })}
disabled={disabled}
onPress={onPress}
selected={selected}
@@ -1716,7 +1724,7 @@ function TemplateCard({
<Text style={styles.templateName} numberOfLines={1}>{template.name}</Text>
<Text style={styles.templateDescription} numberOfLines={3}>{template.description}</Text>
<Text style={styles.templateMeta} numberOfLines={1}>
- {template.cronExpr ? template.cronExpr : '手动配置'}
+ {template.cronExpr ? template.cronExpr : t('devices.automations.template.manualConfig')}
</Text>
</MainWindowCardButton>
);
@@ -1858,10 +1866,11 @@ function ScheduleRow({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const summary = summarizeSchedule(schedule, runs);
return (
<MainWindowRowButton
- accessibilityLabel={`自动化任务 ${summary.title}`}
+ accessibilityLabel={t('devices.automations.scheduleRowA11y', { title: summary.title })}
onPress={onPress}
selected={selected}
style={styles.scheduleRow}
@@ -1903,6 +1912,7 @@ function ScheduleDetail({
schedule: RemoteSchedule;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
const summary = summarizeSchedule(schedule, runs);
const paused = schedule.status === 'paused';
const actionBusy = !!busyAction || runsLoading;
@@ -1917,36 +1927,36 @@ function ScheduleDetail({
</Text>
) : null}
<Text style={styles.detailPrompt} numberOfLines={4}>
- {schedule.prompt || (schedule.executionMode === 'script' ? '仅运行脚本任务,配置只能在桌面端编辑' : '没有保存任务提示词')}
+ {schedule.prompt || (schedule.executionMode === 'script' ? t('devices.automations.detail.promptScriptFallback') : t('devices.automations.detail.promptEmpty'))}
</Text>
<MainWindowActionGroup
dangerActions={[{
- accessibilityLabel: '删除自动化',
+ accessibilityLabel: t('devices.automations.detail.deleteA11y'),
disabled: actionBusy,
- label: '删除',
+ label: t('devices.common.delete'),
onPress: onDelete,
testID: 'automations.deleteButton',
tone: 'danger',
}]}
primaryActions={[{
- accessibilityLabel: '立即执行自动化',
+ accessibilityLabel: t('devices.automations.detail.runNowA11y'),
disabled: actionBusy,
- label: busyAction === `run:${schedule.id}` ? '执行中' : 'Run now',
+ label: busyAction === `run:${schedule.id}` ? t('devices.automations.detail.running') : 'Run now',
onPress: onRunNow,
testID: 'automations.runNowButton',
tone: 'primary',
}]}
secondaryActions={[{
- accessibilityLabel: paused ? '恢复自动化' : '暂停自动化',
+ accessibilityLabel: paused ? t('devices.automations.detail.resumeA11y') : t('devices.automations.detail.pauseA11y'),
disabled: pauseDisabled,
- label: paused ? '恢复' : '暂停',
+ label: paused ? t('devices.automations.detail.resume') : t('devices.automations.detail.pause'),
onPress: paused ? onResume : onPause,
testID: paused ? 'automations.resumeButton' : 'automations.pauseButton',
tone: 'secondary',
}, {
- accessibilityLabel: '编辑自动化',
+ accessibilityLabel: t('devices.automations.detail.editA11y'),
disabled: actionBusy,
- label: '编辑',
+ label: t('devices.automations.detail.edit'),
onPress: onEdit,
testID: 'automations.editButton',
tone: 'secondary',
@@ -1975,6 +1985,7 @@ function RunRow({
run: RemoteScheduleRun;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
const summary = summarizeRun(run);
const actionBusy = !!busyAction || opening;
const hasActions = summary.canOpenSession || summary.canRestart || summary.canMarkRead || summary.canDelete;
@@ -1998,10 +2009,10 @@ function RunRow({
{summary.canOpenSession ? (
<MainWindowActionButton
action={{
- accessibilityLabel: '打开自动化会话',
+ accessibilityLabel: t('devices.automations.run.openSessionA11y'),
busy: opening,
disabled: actionBusy,
- label: opening ? '打开中' : (summary.openSessionLabel ?? '会话'),
+ label: opening ? t('devices.automations.run.opening') : (summary.openSessionLabel ?? t('devices.automations.run.session')),
onPress: onOpenSession,
testID: 'automations.openRunSessionButton',
}}
@@ -2012,10 +2023,10 @@ function RunRow({
{summary.canRestart ? (
<MainWindowActionButton
action={{
- accessibilityLabel: '重新执行自动化',
+ accessibilityLabel: t('devices.automations.run.restartA11y'),
busy: busyAction === `run-restart:${run.id}`,
disabled: actionBusy,
- label: busyAction === `run-restart:${run.id}` ? '重跑中' : (summary.restartLabel ?? '重跑'),
+ label: busyAction === `run-restart:${run.id}` ? t('devices.automations.run.restarting') : (summary.restartLabel ?? t('devices.automations.run.restart')),
onPress: onRestart,
testID: 'automations.restartRunButton',
}}
@@ -2026,10 +2037,10 @@ function RunRow({
{summary.canMarkRead ? (
<MainWindowActionButton
action={{
- accessibilityLabel: '标记执行记录已读',
+ accessibilityLabel: t('devices.automations.run.markReadA11y'),
busy: busyAction === `run-read:${run.id}`,
disabled: actionBusy,
- label: busyAction === `run-read:${run.id}` ? '标记中' : (summary.markReadLabel ?? '已读'),
+ label: busyAction === `run-read:${run.id}` ? t('devices.automations.run.marking') : (summary.markReadLabel ?? t('devices.automations.run.markRead')),
onPress: onMarkRead,
testID: 'automations.markRunReadButton',
}}
@@ -2040,10 +2051,10 @@ function RunRow({
{summary.canDelete ? (
<MainWindowActionButton
action={{
- accessibilityLabel: '删除执行记录',
+ accessibilityLabel: t('devices.automations.run.deleteA11y'),
busy: busyAction === `run-delete:${run.id}`,
disabled: actionBusy,
- label: busyAction === `run-delete:${run.id}` ? '删除中' : (summary.deleteLabel ?? '删除'),
+ label: busyAction === `run-delete:${run.id}` ? t('devices.common.deleting') : (summary.deleteLabel ?? t('devices.common.delete')),
onPress: onDelete,
testID: 'automations.deleteRunButton',
tone: 'danger',
diff --git a/apps/mobile/app/devices/[deviceId].tsx b/apps/mobile/app/devices/[deviceId].tsx
index 28f158b356..d2ce1afe68 100644
--- a/apps/mobile/app/devices/[deviceId].tsx
+++ b/apps/mobile/app/devices/[deviceId].tsx
@@ -13,6 +13,8 @@ import {
} from 'react-native';
import { Text, TextInput } from '@/components/AppText';
import { SafeAreaView } from 'react-native-safe-area-context';
+import { useTranslation } from 'react-i18next';
+import type { TFunction } from 'i18next';
import { ConnectionBanner, useShowConnectionBanner } from '@/components/ConnectionBanner';
import { goBackGuarded } from '@/utils/backGuard';
import { configureCollapseAnimation } from '@/utils/collapseAnimation';
@@ -80,22 +82,24 @@ import { useTheme, useThemedStyles, type ThemeColors } from '@/theme';
import { fontWeight, iconSize, iconStroke, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';
const LIST_LIMIT = 200;
-const STATUS_FILTERS: Array<{ value: RemoteSessionStatusFilter; label: string }> = [
- { value: 'active', label: '活跃' },
- { value: 'waiting', label: '待处理' },
- { value: 'automation', label: '自动化' },
- { value: 'archived', label: '归档' },
- { value: 'all', label: '全部' },
+// label 走 i18n key(在使用点 t() 求值),不在模块顶层冻结语言。
+const STATUS_FILTERS: Array<{ value: RemoteSessionStatusFilter; labelKey: string }> = [
+ { value: 'active', labelKey: 'devices.detail.filter.active' },
+ { value: 'waiting', labelKey: 'devices.detail.filter.waiting' },
+ { value: 'automation', labelKey: 'devices.detail.filter.automation' },
+ { value: 'archived', labelKey: 'devices.detail.filter.archived' },
+ { value: 'all', labelKey: 'devices.detail.filter.all' },
];
-const GROUP_MODES: Array<{ value: RemoteSessionGroupMode; label: string }> = [
- { value: 'project', label: '项目' },
- { value: 'date', label: '时间' },
+const GROUP_MODES: Array<{ value: RemoteSessionGroupMode; labelKey: string }> = [
+ { value: 'project', labelKey: 'devices.detail.group.project' },
+ { value: 'date', labelKey: 'devices.detail.group.date' },
];
type RemoteListStatusFilter = Extract<RemoteSessionStatusFilter, 'active' | 'archived' | 'all'>;
export default function DeviceDetailScreen() {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const params = useLocalSearchParams<{
deviceId: string;
deviceName?: string;
@@ -437,32 +441,32 @@ export default function DeviceDetailScreen() {
remoteSessionStore.upsertDeviceSession(rowDeviceId, shardName, session);
}
setSelectedSessionIds(failed.map(({ session }) => session.id));
- setBulkNotice(`已处理 ${rows.length - failed.length} 个,${failed.length} 个失败(已还原,可重试)。`);
+ setBulkNotice(t('devices.detail.bulk.partialFailure', { done: rows.length - failed.length, failed: failed.length }));
}
await loadSessions();
} finally {
setBulkActionPending(null);
}
- }, [bulkActionPending, deviceId, loadSessions, maker]);
+ }, [bulkActionPending, deviceId, loadSessions, maker, t]);
const requestBulkAction = useCallback((action: MobileSessionBulkAction) => {
const summary = bulkActionSummaries[action];
if (summary.candidates.length === 0) {
setBulkNotice(
action === 'archive'
- ? '当前选择里没有可归档的活跃会话。'
+ ? t('devices.detail.bulk.noArchivable')
: action === 'pin'
- ? '当前选择里没有可置顶的活跃会话。'
+ ? t('devices.detail.bulk.noPinnable')
: action === 'restore'
- ? '当前选择里没有可恢复的归档会话。'
+ ? t('devices.detail.bulk.noRestorable')
: action === 'unpin'
- ? '当前选择里没有已置顶的会话。'
- : '当前选择里没有可删除的会话。',
+ ? t('devices.detail.bulk.noUnpinnable')
+ : t('devices.detail.bulk.noDeletable'),
);
return;
}
setBulkConfirmAction(action);
- }, [bulkActionSummaries]);
+ }, [bulkActionSummaries, t]);
// 自动化任务作用域(从组行「查看全部 N 次运行」进入):干净布局 —— 头部 + 该任务全部运行的
// 平铺列表,交互与项目作用域页同构。运行归属 = 入口 sessionId 快照 ∪ 组键匹配(scheduleIndex
@@ -491,10 +495,10 @@ export default function DeviceDetailScreen() {
<SafeAreaView style={styles.safeArea} testID="deviceDetail.screen">
<ScreenHeader
backTestID="deviceDetail.backButton"
- eyebrow="自动化任务"
+ eyebrow={t('devices.detail.automationScope.eyebrow')}
onBack={() => goBackGuarded(router)}
subtitle={deviceName}
- title={automationScopeName ?? '自动化任务'}
+ title={automationScopeName ?? t('devices.detail.automationScope.title')}
titleTestID="deviceDetail.title"
/>
{showConnectionBanner ? (
@@ -525,14 +529,14 @@ export default function DeviceDetailScreen() {
ListEmptyComponent={
<MainWindowEmptyState
centered
- copy="任务运行后,每次运行的会话都会出现在这里。"
+ copy={t('devices.detail.automationScope.emptyCopy')}
style={{
marginTop: spacing.xxl,
minHeight: windowLayout.emptyMinHeight,
padding: windowLayout.emptyPadding,
}}
testID="deviceDetail.automationEmpty"
- title="这个任务还没有运行记录"
+ title={t('devices.detail.automationScope.emptyTitle')}
/>
}
/>
@@ -549,7 +553,7 @@ export default function DeviceDetailScreen() {
<SafeAreaView style={styles.safeArea} testID="deviceDetail.screen">
<ScreenHeader
action={{
- label: '新建',
+ label: t('devices.common.create'),
// 在这个项目里建新对话:预填 workingDir。
onPress: () => guardedPush({
pathname: '/sessions/new',
@@ -563,7 +567,7 @@ export default function DeviceDetailScreen() {
testID: 'deviceDetail.newSessionButton',
}}
backTestID="deviceDetail.backButton"
- eyebrow="项目"
+ eyebrow={t('devices.detail.projectScope.eyebrow')}
onBack={() => goBackGuarded(router)}
subtitle={`${projectWorkingDir} · ${deviceName}`}
title={projectName ?? deviceName}
@@ -607,14 +611,14 @@ export default function DeviceDetailScreen() {
) : (
<MainWindowEmptyState
centered
- copy="在这个项目里开始一个新对话。"
+ copy={t('devices.detail.projectScope.emptyCopy')}
style={{
marginTop: spacing.xxl,
minHeight: windowLayout.emptyMinHeight,
padding: windowLayout.emptyPadding,
}}
testID="deviceDetail.projectEmpty"
- title="这个项目还没有对话"
+ title={t('devices.detail.projectScope.emptyTitle')}
/>
)}
/>
@@ -626,7 +630,7 @@ export default function DeviceDetailScreen() {
<SafeAreaView style={styles.safeArea} testID="deviceDetail.screen">
<ScreenHeader
action={{
- label: '新建',
+ label: t('devices.common.create'),
onPress: () => guardedPush({
pathname: '/sessions/new',
params: {
@@ -641,8 +645,8 @@ export default function DeviceDetailScreen() {
eyebrow="Remote Device"
onBack={() => goBackGuarded(router)}
subtitle={projectWorkingDir
- ? `${deviceName} · ${filterCounts.active} 个活动会话`
- : `${filterCounts.active} 个活动会话 · ${filterCounts.projectCount} 个项目`}
+ ? t('devices.detail.subtitle.deviceActive', { deviceName, count: filterCounts.active })
+ : t('devices.detail.subtitle.activeAndProjects', { count: filterCounts.active, projects: filterCounts.projectCount })}
title={projectName ?? deviceName}
titleTestID="deviceDetail.title"
/>
@@ -666,8 +670,8 @@ export default function DeviceDetailScreen() {
>
<View style={[styles.summaryTopRow, { gap: windowLayout.metricGap }]}>
<MainWindowMetric
- accessibilityLabel="筛选活动会话"
- label="活动"
+ accessibilityLabel={t('devices.detail.metric.activeA11y')}
+ label={t('devices.detail.metric.active')}
onPress={() => setStatusFilter('active')}
selected={statusFilter === 'active'}
style={{ minHeight: windowLayout.metricMinHeight, minWidth: windowLayout.metricMinWidth }}
@@ -676,8 +680,8 @@ export default function DeviceDetailScreen() {
value={filterCounts.active}
/>
<MainWindowMetric
- accessibilityLabel="筛选待处理会话"
- label="待处理"
+ accessibilityLabel={t('devices.detail.metric.waitingA11y')}
+ label={t('devices.detail.metric.waiting')}
onPress={() => setStatusFilter('waiting')}
selected={statusFilter === 'waiting'}
style={{ minHeight: windowLayout.metricMinHeight, minWidth: windowLayout.metricMinWidth }}
@@ -687,8 +691,8 @@ export default function DeviceDetailScreen() {
value={filterCounts.waiting}
/>
<MainWindowMetric
- accessibilityLabel="筛选自动化会话"
- label="自动化"
+ accessibilityLabel={t('devices.detail.metric.automationA11y')}
+ label={t('devices.detail.metric.automation')}
onPress={() => setStatusFilter('automation')}
selected={statusFilter === 'automation'}
style={{ minHeight: windowLayout.metricMinHeight, minWidth: windowLayout.metricMinWidth }}
@@ -702,8 +706,8 @@ export default function DeviceDetailScreen() {
>
<MainWindowActionButton
action={{
- accessibilityLabel: '打开远程自动化',
- label: `计划${runningAutomationCount > 0 ? ` · ${runningAutomationCount}` : ''}`,
+ accessibilityLabel: t('devices.detail.automationsButtonA11y'),
+ label: `${t('devices.detail.plan')}${runningAutomationCount > 0 ? ` · ${runningAutomationCount}` : ''}`,
onPress: () => guardedPush({
pathname: '/automations/[deviceId]',
params: { deviceId, name: deviceName },
@@ -740,9 +744,9 @@ export default function DeviceDetailScreen() {
density="compact"
secondaryActions={[
{
- accessibilityLabel: searchOpen ? '关闭搜索远程会话' : '搜索远程会话',
+ accessibilityLabel: searchOpen ? t('devices.detail.search.closeA11y') : t('devices.detail.search.openA11y'),
active: searchOpen || !!searchQuery.trim(),
- label: '搜索',
+ label: t('devices.detail.search.label'),
onPress: () => {
if (searchOpen && !searchQuery.trim()) {
setSearchOpen(false);
@@ -753,9 +757,9 @@ export default function DeviceDetailScreen() {
testID: 'deviceDetail.searchToggleButton',
},
{
- accessibilityLabel: filtersOpen ? '收起会话筛选' : '展开会话筛选',
+ accessibilityLabel: filtersOpen ? t('devices.detail.filters.collapseA11y') : t('devices.detail.filters.expandA11y'),
active: filtersOpen,
- label: '筛选',
+ label: t('devices.detail.filters.label'),
onPress: () => setFiltersOpen((value) => !value),
testID: 'deviceDetail.filtersToggleButton',
},
@@ -767,12 +771,12 @@ export default function DeviceDetailScreen() {
{searchOpen || !!searchQuery.trim() ? (
<View style={styles.searchRow}>
<TextInput
- accessibilityLabel="搜索远程会话"
+ accessibilityLabel={t('devices.detail.search.openA11y')}
autoCapitalize="none"
autoCorrect={false}
autoFocus={searchOpen && !searchQuery}
onChangeText={setSearchQuery}
- placeholder="搜索标题、项目、模型、消息"
+ placeholder={t('devices.detail.search.placeholder')}
placeholderTextColor={colors.textTertiary}
style={styles.searchInput}
testID="deviceDetail.searchInput"
@@ -780,8 +784,8 @@ export default function DeviceDetailScreen() {
/>
<MainWindowActionButton
action={{
- accessibilityLabel: searchQuery.trim() ? '清除搜索' : '关闭搜索',
- label: searchQuery.trim() ? '清除' : '关闭',
+ accessibilityLabel: searchQuery.trim() ? t('devices.detail.search.clearA11y') : t('devices.detail.search.closeInputA11y'),
+ label: searchQuery.trim() ? t('devices.detail.search.clear') : t('devices.detail.search.close'),
onPress: () => {
if (searchQuery.trim()) {
setSearchQuery('');
@@ -805,31 +809,37 @@ export default function DeviceDetailScreen() {
style={styles.segmentScroll}
contentContainerStyle={styles.segmentScrollContent}
>
- {STATUS_FILTERS.map((item) => (
- <MainWindowOptionButton
- accessibilityLabel={`筛选${item.label}会话`}
- key={item.value}
- label={remoteSessionFilterLabel(item.value, filterCounts, item.label)}
- onPress={() => setStatusFilter(item.value)}
- selected={statusFilter === item.value}
- testID={`deviceDetail.statusFilter.${item.value}`}
- />
- ))}
- </ScrollView>
- <View style={styles.groupModeRow}>
- <Text style={styles.groupModeLabel}>分组</Text>
- <View style={styles.groupModeButtons}>
- {GROUP_MODES.map((item) => (
+ {STATUS_FILTERS.map((item) => {
+ const label = t(item.labelKey);
+ return (
<MainWindowOptionButton
- accessibilityLabel={`按${item.label}分组`}
+ accessibilityLabel={t('devices.detail.filter.a11y', { label })}
key={item.value}
- label={item.label}
- onPress={() => setGroupMode(item.value)}
- selected={groupMode === item.value}
- testID={`deviceDetail.groupMode.${item.value}`}
- variant="segmented"
+ label={remoteSessionFilterLabel(item.value, filterCounts, label)}
+ onPress={() => setStatusFilter(item.value)}
+ selected={statusFilter === item.value}
+ testID={`deviceDetail.statusFilter.${item.value}`}
/>
- ))}
+ );
+ })}
+ </ScrollView>
+ <View style={styles.groupModeRow}>
+ <Text style={styles.groupModeLabel}>{t('devices.detail.group.label')}</Text>
+ <View style={styles.groupModeButtons}>
+ {GROUP_MODES.map((item) => {
+ const label = t(item.labelKey);
+ return (
+ <MainWindowOptionButton
+ accessibilityLabel={t('devices.detail.group.a11y', { label })}
+ key={item.value}
+ label={label}
+ onPress={() => setGroupMode(item.value)}
+ selected={groupMode === item.value}
+ testID={`deviceDetail.groupMode.${item.value}`}
+ variant="segmented"
+ />
+ );
+ })}
</View>
</View>
</>
@@ -839,21 +849,21 @@ export default function DeviceDetailScreen() {
<View style={styles.selectionHeaderRow}>
<View style={styles.selectionTitleBlock}>
<Text style={styles.selectionText} testID="deviceDetail.selectionCount">
- 已选择 {selectedSessionIds.length} 个会话
+ {t('devices.detail.selection.count', { count: selectedSessionIds.length })}
</Text>
<Text style={styles.selectionMeta}>
{bulkActionLayout.primary.length + bulkActionLayout.destructive.length > 0
- ? '可执行操作'
- : '没有可执行操作'}
+ ? t('devices.detail.selection.canAct')
+ : t('devices.detail.selection.cannotAct')}
</Text>
</View>
<MainWindowActionGroup
density="compact"
secondaryActions={[
{
- accessibilityLabel: '取消选择会话',
+ accessibilityLabel: t('devices.detail.selection.clearA11y'),
disabled: bulkActionPending !== null,
- label: '取消',
+ label: t('devices.common.cancel'),
onPress: clearSelection,
testID: 'deviceDetail.clearSelectionButton',
},
@@ -864,10 +874,10 @@ export default function DeviceDetailScreen() {
{bulkActionLayout.primary.length > 0 ? (
<MainWindowActionGroup
secondaryActions={bulkActionLayout.primary.map((action) => ({
- accessibilityLabel: bulkActionAccessibilityLabel(action),
+ accessibilityLabel: bulkActionAccessibilityLabel(action, t),
disabled: bulkActionPending !== null,
label: bulkActionPending === action
- ? bulkActionPendingLabel(action)
+ ? bulkActionPendingLabel(action, t)
: mobileSessionBulkActionButtonLabel(bulkActionSummaries[action]),
onPress: () => requestBulkAction(action),
testID: bulkActionTestID(action),
@@ -878,10 +888,10 @@ export default function DeviceDetailScreen() {
{bulkActionLayout.destructive.length > 0 ? (
<MainWindowActionGroup
dangerActions={bulkActionLayout.destructive.map((action) => ({
- accessibilityLabel: bulkActionAccessibilityLabel(action),
+ accessibilityLabel: bulkActionAccessibilityLabel(action, t),
disabled: bulkActionPending !== null,
label: bulkActionPending === action
- ? bulkActionPendingLabel(action)
+ ? bulkActionPendingLabel(action, t)
: mobileSessionBulkActionButtonLabel(bulkActionSummaries[action]),
onPress: () => requestBulkAction(action),
testID: bulkActionTestID(action),
@@ -897,10 +907,10 @@ export default function DeviceDetailScreen() {
<MainWindowActionGroup
primaryActions={[
{
- accessibilityLabel: bulkActionAccessibilityLabel(bulkConfirmSummary.action),
+ accessibilityLabel: bulkActionAccessibilityLabel(bulkConfirmSummary.action, t),
disabled: bulkActionPending !== null || bulkConfirmSummary.candidates.length === 0,
label: bulkActionPending === bulkConfirmSummary.action
- ? bulkActionPendingLabel(bulkConfirmSummary.action)
+ ? bulkActionPendingLabel(bulkConfirmSummary.action, t)
: bulkConfirmSummary.confirmText,
onPress: () => void executeBulkAction(bulkConfirmSummary.action, bulkConfirmSummary.candidates),
testID: 'deviceDetail.bulkConfirmButton',
@@ -908,9 +918,9 @@ export default function DeviceDetailScreen() {
},
]}
cancelAction={{
- accessibilityLabel: '取消批量操作',
+ accessibilityLabel: t('devices.detail.bulk.cancelA11y'),
disabled: bulkActionPending !== null,
- label: '取消',
+ label: t('devices.common.cancel'),
onPress: () => setBulkConfirmAction(null),
testID: 'deviceDetail.bulkConfirmCancelButton',
}}
@@ -919,7 +929,7 @@ export default function DeviceDetailScreen() {
</View>
) : null}
{bulkActionLayout.primary.length === 0 && bulkActionLayout.destructive.length === 0 ? (
- <Text style={styles.bulkNotice}>当前选择的会话都不能修改。</Text>
+ <Text style={styles.bulkNotice}>{t('devices.detail.bulk.noneModifiable')}</Text>
) : null}
</View>
) : null}
@@ -1024,6 +1034,7 @@ function SessionRow({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const isAutomationGroup = !!item.automationGroup;
// 与首页组行同语义:收起且有需关注内容(未读运行 / 待处理)时点行直开 primary 会话,
// 展开走行尾「展开」独立热区;其余情况点行仍是展开 / 收起。
@@ -1058,7 +1069,7 @@ function SessionRow({
const row = (
<View>
<MainWindowRowButton
- accessibilityLabel={`${isAutomationGroup ? '自动化会话组' : '会话'} ${item.title}`}
+ accessibilityLabel={isAutomationGroup ? t('devices.detail.row.a11yAutomationGroup', { title: item.title }) : t('devices.detail.row.a11ySession', { title: item.title })}
expanded={isAutomationGroup ? automationGroupExpanded : undefined}
onLongPress={onLongPress}
onPress={onPress}
@@ -1084,7 +1095,7 @@ function SessionRow({
</Text>
{item.pendingInteractionCount > 0 ? (
<Text style={styles.waitingBadge} testID="deviceDetail.sessionWaitingBadge">
- 待处理 {item.pendingInteractionCount}
+ {t('devices.detail.badge.waiting', { count: item.pendingInteractionCount })}
</Text>
) : null}
</View>
@@ -1094,22 +1105,22 @@ function SessionRow({
{item.scheduleInfo ? (
<View style={styles.badgeRow}>
<Text style={styles.scheduleBadge} numberOfLines={1} testID="deviceDetail.sessionScheduleBadge">
- 自动化 · {item.scheduleInfo.scheduleName}
- {item.automationGroup ? ` · ${item.automationGroup.sessionCount} 个会话` : ''}
+ {t('devices.detail.badge.automationPrefix')} · {item.scheduleInfo.scheduleName}
+ {item.automationGroup ? ` · ${t('devices.detail.badge.sessionCount', { count: item.automationGroup.sessionCount })}` : ''}
</Text>
{item.automationGroup ? (
<Text style={styles.scheduleBadge} testID="deviceDetail.automationGroupBadge">
- 聚合
+ {t('devices.detail.badge.aggregate')}
</Text>
) : null}
{item.scheduleInfo.running ? (
<Text style={styles.runningBadge} testID="deviceDetail.sessionScheduleRunning">
- 执行中
+ {t('devices.detail.badge.running')}
</Text>
) : null}
{item.scheduleInfo.unreadCount > 0 ? (
<Text style={styles.unreadBadge} testID="deviceDetail.sessionScheduleUnread">
- 未读 {item.scheduleInfo.unreadCount}
+ {t('devices.detail.badge.unread', { count: item.scheduleInfo.unreadCount })}
</Text>
) : null}
</View>
@@ -1132,7 +1143,7 @@ function SessionRow({
</View>
{selectionMode ? null : isAutomationGroup ? (
<Pressable
- accessibilityLabel={automationGroupExpanded ? `收起 ${item.title}` : `展开 ${item.title}`}
+ accessibilityLabel={automationGroupExpanded ? t('devices.detail.row.a11yCollapse', { title: item.title }) : t('devices.detail.row.a11yExpand', { title: item.title })}
accessibilityRole="button"
hitSlop={{ bottom: 12, left: 8, right: 12, top: 12 }}
onPress={(event) => {
@@ -1143,7 +1154,7 @@ function SessionRow({
}}
testID="deviceDetail.automationGroupToggle"
>
- <Text style={styles.groupExpandText}>{automationGroupExpanded ? '收起' : '展开'}</Text>
+ <Text style={styles.groupExpandText}>{automationGroupExpanded ? t('devices.detail.row.collapse') : t('devices.detail.row.expand')}</Text>
</Pressable>
) : (
<ChevronRight color={colors.textTertiary} size={iconSize.xl} strokeWidth={iconStroke.regular} />
@@ -1153,7 +1164,7 @@ function SessionRow({
<View style={styles.automationChildren} testID="deviceDetail.automationGroupChildren">
{visibleAutomationChildren.map(({ child, ordinal }) => (
<MainWindowRowButton
- accessibilityLabel={`打开自动化会话 ${child.title}`}
+ accessibilityLabel={t('devices.detail.child.openA11y', { title: child.title })}
key={child.sessionId}
onPress={() => onOpenSession(child.sessionId)}
style={styles.automationChildRow}
@@ -1164,16 +1175,16 @@ function SessionRow({
<View style={styles.automationChildTitleRow}>
<Text style={styles.automationChildTitle} numberOfLines={1}>{child.title}</Text>
{child.running ? (
- <Text style={styles.runningBadge} testID="deviceDetail.automationChildRunning">执行中</Text>
+ <Text style={styles.runningBadge} testID="deviceDetail.automationChildRunning">{t('devices.detail.badge.running')}</Text>
) : null}
{child.unreadCount > 0 ? (
<Text style={styles.unreadBadge} testID="deviceDetail.automationChildUnread">
- 未读 {child.unreadCount}
+ {t('devices.detail.badge.unread', { count: child.unreadCount })}
</Text>
) : null}
{child.pendingInteractionCount > 0 ? (
<Text style={styles.waitingBadge} testID="deviceDetail.automationChildWaiting">
- 待处理 {child.pendingInteractionCount}
+ {t('devices.detail.badge.waiting', { count: child.pendingInteractionCount })}
</Text>
) : null}
</View>
@@ -1184,14 +1195,14 @@ function SessionRow({
))}
{hiddenAutomationChildCount > 0 ? (
<Pressable
- accessibilityLabel={`查看全部 ${item.automationGroup.sessionCount} 次运行`}
+ accessibilityLabel={t('devices.detail.viewAllRuns', { count: item.automationGroup.sessionCount })}
accessibilityRole="button"
onPress={onOpenAutomationGroup}
style={({ pressed }) => [styles.automationViewAllRow, pressed && styles.pressedRow]}
testID="deviceDetail.automationViewAll"
>
<Text style={styles.automationViewAllText} numberOfLines={1}>
- {`查看全部 ${item.automationGroup.sessionCount} 次运行`}
+ {t('devices.detail.viewAllRuns', { count: item.automationGroup.sessionCount })}
</Text>
<ChevronRight color={colors.textTertiary} size={iconSize.action} strokeWidth={iconStroke.regular} />
</Pressable>
@@ -1218,20 +1229,20 @@ function rowStatusRailStyle(item: RemoteSessionListItem, styles: ReturnType<type
return styles.statusRailDefault;
}
-function bulkActionPendingLabel(action: MobileSessionBulkAction): string {
- if (action === 'pin') return '置顶中';
- if (action === 'unpin') return '取消中';
- if (action === 'archive') return '归档中';
- if (action === 'restore') return '恢复中';
- return '删除中';
+function bulkActionPendingLabel(action: MobileSessionBulkAction, t: TFunction): string {
+ if (action === 'pin') return t('devices.detail.bulk.pinning');
+ if (action === 'unpin') return t('devices.detail.bulk.unpinning');
+ if (action === 'archive') return t('devices.detail.bulk.archiving');
+ if (action === 'restore') return t('devices.detail.bulk.restoring');
+ return t('devices.detail.bulk.deleting');
}
-function bulkActionAccessibilityLabel(action: MobileSessionBulkAction): string {
- if (action === 'pin') return '批量置顶选中会话';
- if (action === 'unpin') return '批量取消置顶选中会话';
- if (action === 'archive') return '批量归档选中会话';
- if (action === 'restore') return '批量恢复选中会话';
- return '批量删除选中会话';
+function bulkActionAccessibilityLabel(action: MobileSessionBulkAction, t: TFunction): string {
+ if (action === 'pin') return t('devices.detail.bulk.pinA11y');
+ if (action === 'unpin') return t('devices.detail.bulk.unpinA11y');
+ if (action === 'archive') return t('devices.detail.bulk.archiveA11y');
+ if (action === 'restore') return t('devices.detail.bulk.restoreA11y');
+ return t('devices.detail.bulk.deleteA11y');
}
function bulkActionTestID(action: MobileSessionBulkAction): string {
diff --git a/apps/mobile/app/devices/index.tsx b/apps/mobile/app/devices/index.tsx
index d97446f264..1882cefc5b 100644
--- a/apps/mobile/app/devices/index.tsx
+++ b/apps/mobile/app/devices/index.tsx
@@ -38,6 +38,8 @@ import {
X,
} from 'lucide-react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
+import { useTranslation } from 'react-i18next';
+import type { TFunction } from 'i18next';
import { useAuth } from '@/auth/AuthContext';
import { configureCollapseAnimation } from '@/utils/collapseAnimation';
import { useGuardedPush } from '@/utils/useGuardedPush';
@@ -163,6 +165,7 @@ type HydrateDeviceSessionsResult = {
export default function HomeScreen() {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
// 所有前进导航(进会话 / 新建 / 设置 / 组页面)统一走守卫 push:列表卡顿时的
// 连点会各自触发一次裸 push,把同一页压进栈 N 层(返回也要 N 次)。
const guardedPush = useGuardedPush();
@@ -732,9 +735,9 @@ export default function HomeScreen() {
})), [deviceRows]);
const revokedTipDeviceName = useMemo(
() => revokedTipDeviceId
- ? deviceModels.find((item) => item.deviceId === revokedTipDeviceId)?.name ?? '这台电脑'
+ ? deviceModels.find((item) => item.deviceId === revokedTipDeviceId)?.name ?? t('devices.list.thisComputer')
: null,
- [deviceModels, revokedTipDeviceId],
+ [deviceModels, revokedTipDeviceId, t],
);
// 三个派生索引的依赖挂在全局 messageVersion / storeVersion 上,桌面端活跃期逐 emit
// 重建出内容相同的新 Map——若不做内容稳定化,home → sections → 全列表行整链每次
@@ -827,12 +830,12 @@ export default function HomeScreen() {
: connectionError ? 'muted' : status === 'online' ? 'ready' : status === 'connecting' ? 'busy' : 'off';
const connectionTitle = activeConnectionIssue
? connectionIssueTitle(activeConnectionIssue.kind)
- : connectionError ? '同步失败' : homeConnectionTitle(status);
+ : connectionError ? t('devices.list.syncFailed') : homeConnectionTitle(status, t);
const connectionCopy = activeConnectionIssue
? connectionIssueHint(activeConnectionIssue.kind)
: connectionError;
- const emptyStateTitle = initialHomeError ? '同步失败' : home.emptyTitle;
- const emptyStateCopy = initialHomeError ? (connectionError ?? '请求失败') : home.emptyCopy;
+ const emptyStateTitle = initialHomeError ? t('devices.list.syncFailed') : home.emptyTitle;
+ const emptyStateCopy = initialHomeError ? (connectionError ?? t('devices.list.requestFailed')) : home.emptyCopy;
// 无可控制电脑的引导态(landing)可见性,与 ListEmptyComponent 的分支同口径。
// 引导态下首页没有可筛选的对话:表头「所有对话 ▾」退化为纯品牌标题、新建 FAB 隐藏,
// 避免在产品说明页上摆一堆无意义的入口。
@@ -858,12 +861,12 @@ export default function HomeScreen() {
[deviceModels],
);
const selectedDeviceLabel = useMemo(() => {
- if (!selectedDeviceId) return '所有对话';
+ if (!selectedDeviceId) return t('devices.list.allConversations');
// 设备列表尚未同步回来时,用偏好里存的设备名兜底,避免冷启动表头闪占位文案。
return home.deviceFilters.find((item) => item.deviceId === selectedDeviceId)?.label
?? restoredDeviceName
- ?? '这台电脑';
- }, [home.deviceFilters, restoredDeviceName, selectedDeviceId]);
+ ?? t('devices.list.thisComputer');
+ }, [home.deviceFilters, restoredDeviceName, selectedDeviceId, t]);
const avatarLabel = useMemo(() => {
const trimmed = user?.name?.trim() || user?.email?.trim() || 'D';
return trimmed.slice(0, 1).toUpperCase();
@@ -877,7 +880,7 @@ export default function HomeScreen() {
// (当前可达设备),否则 re-link 后旧 deviceId 不可达会导致「首页卡片点开打不开」。回退物理 id / store 索引。
const deviceId = session.canonicalDeviceId ?? session.deviceLinkDeviceId ?? remoteSessionStore.getSessionDeviceId(session.id);
if (!deviceId) {
- setError('找不到这个会话所属电脑,请重新同步后再试。');
+ setError(t('devices.list.error.sessionDeviceNotFound'));
return;
}
guardedPush({
@@ -888,7 +891,7 @@ export default function HomeScreen() {
sessionId: session.id,
},
});
- }, [guardedPush, swipeRegistry]);
+ }, [guardedPush, swipeRegistry, t]);
// ── 会话行滑动操作(置顶 / 归档 / 选项菜单 / 删除 / 重命名)────────────────
// 首页会话横跨多台设备,不能用页面级单一 transport:RPC 走可达设备(canonicalDeviceId
@@ -913,7 +916,7 @@ export default function HomeScreen() {
const patchHomeSession = useCallback(async (session: RemoteSession, patch: SessionMetaPatch) => {
const rpcDeviceId = session.canonicalDeviceId ?? session.deviceLinkDeviceId
?? remoteSessionStore.getSessionDeviceId(session.id);
- if (!rpcDeviceId) throw new Error('找不到这个会话所属电脑,请重新同步后再试。');
+ if (!rpcDeviceId) throw new Error(t('devices.list.error.sessionDeviceNotFound'));
const shardId = session.deviceLinkDeviceId ?? remoteSessionStore.getSessionDeviceId(session.id) ?? rpcDeviceId;
const fields = Object.keys(patch);
// 写序登记:delete 终态取代全字段(pending 重命名/置顶让位);其余按 patch 字段。
@@ -1006,15 +1009,15 @@ export default function HomeScreen() {
} finally {
releasePending();
}
- }, [invoke]);
+ }, [invoke, t]);
const runSwipeAction = useCallback((session: RemoteSession, action: Exclude<SessionSwipeAction, 'rename'>) => {
void patchHomeSession(session, swipeActionPatch(action)).catch((err: unknown) => {
// 归档路径不预先收行(成功时行随数据消失),失败时行可能还停在滑开态:先收行再提示。
swipeRegistry.closeOpenRow();
- Alert.alert('操作失败', humanizeRemoteError(err));
+ Alert.alert(t('devices.list.alert.actionFailed'), humanizeRemoteError(err));
});
- }, [patchHomeSession, swipeRegistry]);
+ }, [patchHomeSession, swipeRegistry, t]);
// 「选项」菜单动作分发。删除走系统 Alert(系统层弹窗,不受兄弟 Modal 卸载时序影响,
// 关 sheet 后直接弹);重命名要等 sheet 卸载后再挂弹窗(pendingSheetActionRef,时序
@@ -1025,10 +1028,10 @@ export default function HomeScreen() {
if (!session) return;
if (action === 'delete') {
// 菜单不再展示会话标题(2026-07-07 产品反馈),删除确认在这里带上标题作上下文。
- const title = session.title?.trim() || '未命名对话';
- Alert.alert('删除对话?', `将删除「${title}」,删除后不可恢复。`, [
- { style: 'cancel', text: '取消' },
- { onPress: () => runSwipeAction(session, 'delete'), style: 'destructive', text: '删除' },
+ const title = session.title?.trim() || t('devices.list.untitled');
+ Alert.alert(t('devices.list.alert.deleteTitle'), t('devices.list.alert.deleteMessage', { title }), [
+ { style: 'cancel', text: t('devices.common.cancel') },
+ { onPress: () => runSwipeAction(session, 'delete'), style: 'destructive', text: t('devices.common.delete') },
]);
return;
}
@@ -1040,7 +1043,7 @@ export default function HomeScreen() {
return;
}
runSwipeAction(session, action);
- }, [actionSheetSession, runSwipeAction]);
+ }, [actionSheetSession, runSwipeAction, t]);
const handleSessionSheetClosed = useCallback(() => {
const pending = pendingSheetActionRef.current;
@@ -1060,9 +1063,9 @@ export default function HomeScreen() {
setRenameSessionTarget(null);
if (title === (target.title ?? '')) return;
void patchHomeSession(target, { title }).catch((err: unknown) => {
- Alert.alert('重命名失败', humanizeRemoteError(err));
+ Alert.alert(t('devices.list.alert.renameFailed'), humanizeRemoteError(err));
});
- }, [patchHomeSession, renameSessionDraft, renameSessionTarget]);
+ }, [patchHomeSession, renameSessionDraft, renameSessionTarget, t]);
// 右滑置顶(收行时序在 SwipeableSessionRow 内:置顶前先收行,避免列表重排后行停在打开态)。
const toggleSessionPinned = useCallback((session: RemoteSession) => {
@@ -1090,7 +1093,7 @@ export default function HomeScreen() {
const deviceId = project?.deviceId ?? home.primaryDevice?.deviceId;
const deviceName = project?.deviceName ?? home.primaryDevice?.label ?? deviceId ?? '';
if (!deviceId) {
- setError('没有可用电脑。请先打开桌面端远程控制,然后重新同步。');
+ setError(t('devices.list.error.noDevice'));
return;
}
guardedPush({
@@ -1105,7 +1108,7 @@ export default function HomeScreen() {
...(selectedDeviceId ? { deviceExplicit: '1' } : {}),
},
});
- }, [guardedPush, home.primaryDevice, newSessionDeviceOptions, selectedDeviceId]);
+ }, [guardedPush, home.primaryDevice, newSessionDeviceOptions, selectedDeviceId, t]);
const toggleProject = useCallback((key: string) => {
configureCollapseAnimation();
@@ -1128,7 +1131,7 @@ export default function HomeScreen() {
// 设备解析与 openSession 同口径:可达优先(canonicalDeviceId),回退物理 id / store 索引。
const deviceId = session.canonicalDeviceId ?? session.deviceLinkDeviceId ?? remoteSessionStore.getSessionDeviceId(session.id);
if (!deviceId) {
- setError('找不到这个任务所属电脑,请重新同步后再试。');
+ setError(t('devices.list.error.taskDeviceNotFound'));
return;
}
// 项目组内的组行(有 workingDir)带上项目维度:baseKey 不含项目 scope,同一任务跨
@@ -1147,7 +1150,7 @@ export default function HomeScreen() {
automationSessionIds: JSON.stringify(group.sessionIds),
},
});
- }, [guardedPush]);
+ }, [guardedPush, t]);
// 置顶组与项目组一致:点表头收起/展开,共用同一条收起动画。
const togglePinned = useCallback(() => {
@@ -1240,7 +1243,7 @@ export default function HomeScreen() {
</View>
) : (
<Pressable
- accessibilityLabel="选择对话范围"
+ accessibilityLabel={t('devices.list.a11y.selectScope')}
accessibilityRole="button"
onPress={openDeviceMenu}
onPressIn={openDeviceMenu}
@@ -1252,7 +1255,7 @@ export default function HomeScreen() {
</Pressable>
)}
<Pressable
- accessibilityLabel="打开设置"
+ accessibilityLabel={t('devices.list.a11y.openSettings')}
accessibilityRole="button"
onPress={() => guardedPush('/settings')}
style={({ pressed }) => [styles.avatarButton, pressed && styles.pressed]}
@@ -1276,7 +1279,7 @@ export default function HomeScreen() {
{connectionCopy ? `${connectionTitle} · ${connectionCopy}` : connectionTitle}
</Text>
<Pressable
- accessibilityLabel={refreshing ? '正在重新同步' : '重新同步'}
+ accessibilityLabel={refreshing ? t('devices.list.a11y.syncing') : t('devices.list.a11y.sync')}
accessibilityRole="button"
accessibilityState={{ busy: refreshing || undefined, disabled: refreshing }}
disabled={refreshing}
@@ -1313,7 +1316,7 @@ export default function HomeScreen() {
if (section.key !== 'pinned' || !section.title) return null;
return (
<Pressable
- accessibilityLabel={`置顶 ${home.pinned.length} 条对话`}
+ accessibilityLabel={t('devices.list.a11y.pinnedConversations', { count: home.pinned.length })}
accessibilityRole="button"
accessibilityState={{ expanded: !pinnedCollapsed }}
onPress={togglePinned}
@@ -1387,7 +1390,7 @@ export default function HomeScreen() {
{showRemoteGuide ? null : (
// 引导态(无可控制电脑)下没有可发起对话的设备,置灰 FAB 也是噪音,直接不渲染。
<Pressable
- accessibilityLabel="新建远程对话"
+ accessibilityLabel={t('devices.list.a11y.newRemoteConversation')}
accessibilityRole="button"
accessibilityState={{ busy: initialHomeLoading || undefined, disabled: newSessionDisabled }}
disabled={newSessionDisabled}
@@ -1485,10 +1488,11 @@ export default function HomeScreen() {
function HomeInitialLoadingState({ style }: { style?: StyleProp<ViewStyle> }) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
return (
<View style={[styles.initialLoadingState, style]} testID="home.loading">
<ActivityIndicator color={colors.textSecondary} size="small" />
- <Text style={styles.initialLoadingText}>正在读取可控制电脑</Text>
+ <Text style={styles.initialLoadingText}>{t('devices.list.loading')}</Text>
</View>
);
}
@@ -1520,6 +1524,7 @@ function DeviceMenuModal({
visible: boolean;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
const { height: screenHeight } = useWindowDimensions();
const insets = useSafeAreaInsets();
// 设备多 / 字体放大时,scope 列表(所有对话 + 设备)可能超出屏幕,给它一个可滚动上限,
@@ -1545,7 +1550,7 @@ function DeviceMenuModal({
>
{allFilter ? (
<DeviceMenuItem
- label="所有对话"
+ label={t('devices.list.allConversations')}
onPress={() => onSelect(allFilter)}
selected={allFilter.selected}
testID="home.deviceChip.all"
@@ -1569,7 +1574,7 @@ function DeviceMenuModal({
<View style={styles.deviceMenuDivider} />
<DeviceMenuItem
checked={groupByProject}
- label="按项目分组"
+ label={t('devices.list.menu.groupByProject')}
onPress={onToggleGroupByProject}
selected={false}
testID="home.deviceMenu.groupByProject"
@@ -1605,6 +1610,7 @@ function DeviceMenuItem({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const rowDisabled = dimmed;
return (
<Pressable
@@ -1639,7 +1645,7 @@ function DeviceMenuItem({
) : null}
{onRename ? (
<Pressable
- accessibilityLabel={`重命名 ${label}`}
+ accessibilityLabel={t('devices.list.a11y.renameDevice', { label })}
accessibilityRole="button"
hitSlop={8}
onPress={(event) => {
@@ -1673,12 +1679,13 @@ function RenameDeviceModal({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const canSave = draft.trim().length > 0 && !saving;
return (
<Modal animationType="fade" transparent visible={visible} onRequestClose={onCancel}>
<Pressable style={styles.renameDeviceBackdrop} onPress={onCancel} testID="home.renameDevice.backdrop">
<Pressable style={styles.renameDeviceCard} onPress={() => undefined} testID="home.renameDevice.modal">
- <Text style={styles.renameDeviceTitle}>重命名设备</Text>
+ <Text style={styles.renameDeviceTitle}>{t('devices.list.renameDevice.title')}</Text>
<TextInput
autoFocus
editable={!saving}
@@ -1687,7 +1694,7 @@ function RenameDeviceModal({
onSubmitEditing={() => {
if (canSave) onConfirm();
}}
- placeholder="设备名称"
+ placeholder={t('devices.list.renameDevice.placeholder')}
placeholderTextColor={colors.textTertiary}
returnKeyType="done"
selectTextOnFocus
@@ -1698,18 +1705,18 @@ function RenameDeviceModal({
{/* 确认对统一规则:共享满宽纵排组(保存在上/取消居底),置于卡片底部。 */}
<MainWindowActionGroup
primaryActions={[{
- accessibilityLabel: saving ? '正在保存设备名' : '保存设备名',
+ accessibilityLabel: saving ? t('devices.list.renameDevice.savingA11y') : t('devices.list.renameDevice.saveA11y'),
busy: saving,
disabled: !canSave,
- label: saving ? '保存中' : '保存',
+ label: saving ? t('devices.common.saving') : t('devices.common.save'),
onPress: onConfirm,
testID: 'home.renameDevice.save',
tone: 'primary',
}]}
cancelAction={{
- accessibilityLabel: '取消重命名',
+ accessibilityLabel: t('devices.list.a11y.cancelRename'),
disabled: saving,
- label: '取消',
+ label: t('devices.common.cancel'),
onPress: onCancel,
testID: 'home.renameDevice.cancel',
}}
@@ -1742,12 +1749,13 @@ function RenameSessionModal({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const canSave = draft.trim().length > 0 && !saving;
return (
<Modal animationType="fade" transparent visible={visible} onRequestClose={onCancel}>
<Pressable style={styles.renameDeviceBackdrop} onPress={onCancel} testID="home.renameSession.backdrop">
<Pressable style={styles.renameDeviceCard} onPress={() => undefined} testID="home.renameSession.modal">
- <Text style={styles.renameDeviceTitle}>重命名对话</Text>
+ <Text style={styles.renameDeviceTitle}>{t('devices.list.renameSession.title')}</Text>
<TextInput
autoFocus
editable={!saving}
@@ -1756,7 +1764,7 @@ function RenameSessionModal({
onSubmitEditing={() => {
if (canSave) onConfirm();
}}
- placeholder="对话标题"
+ placeholder={t('devices.list.renameSession.placeholder')}
placeholderTextColor={colors.textTertiary}
returnKeyType="done"
selectTextOnFocus
@@ -1767,17 +1775,17 @@ function RenameSessionModal({
{/* 确认对统一规则:共享满宽纵排组(保存在上/取消恒居底),与重命名设备卡同款。 */}
<MainWindowActionGroup
cancelAction={{
- accessibilityLabel: '取消重命名',
+ accessibilityLabel: t('devices.list.a11y.cancelRename'),
disabled: saving,
- label: '取消',
+ label: t('devices.common.cancel'),
onPress: onCancel,
testID: 'home.renameSession.cancel',
}}
primaryActions={[{
- accessibilityLabel: saving ? '正在保存对话标题' : '保存对话标题',
+ accessibilityLabel: saving ? t('devices.list.renameSession.savingA11y') : t('devices.list.renameSession.saveA11y'),
busy: saving,
disabled: !canSave,
- label: saving ? '保存中' : '保存',
+ label: saving ? t('devices.common.saving') : t('devices.common.save'),
onPress: onConfirm,
testID: 'home.renameSession.save',
tone: 'primary',
@@ -1803,6 +1811,7 @@ function RevokedAccessTip({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
return (
<Modal animationType="fade" transparent visible={deviceName != null} onRequestClose={onClose}>
<Pressable style={styles.revokedTipBackdrop} onPress={onClose} testID="home.revokedTip.backdrop">
@@ -1813,7 +1822,7 @@ function RevokedAccessTip({
<Lock color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />
</View>
<Pressable
- accessibilityLabel="关闭"
+ accessibilityLabel={t('devices.list.a11y.close')}
accessibilityRole="button"
hitSlop={8}
onPress={onClose}
@@ -1822,12 +1831,12 @@ function RevokedAccessTip({
<X color={colors.textSecondary} size={iconSize.lg} strokeWidth={iconStroke.regular} />
</Pressable>
</View>
- <Text style={styles.revokedTipTitle}>已撤销访问权限</Text>
+ <Text style={styles.revokedTipTitle}>{t('devices.list.revoked.title')}</Text>
<Text style={styles.revokedTipBody}>
- {`「${deviceName ?? '这台电脑'}」撤销了本机的远程访问权限。请在该电脑的 Cindy 设置里重新授权本设备,然后点「重试访问」。`}
+ {t('devices.list.revoked.body', { deviceName: deviceName ?? t('devices.list.thisComputer') })}
</Text>
<Pressable
- accessibilityLabel="重试访问"
+ accessibilityLabel={t('devices.list.revoked.retry')}
accessibilityRole="button"
accessibilityState={{ busy: retrying, disabled: retrying }}
disabled={retrying}
@@ -1838,7 +1847,7 @@ function RevokedAccessTip({
{retrying ? (
<ActivityIndicator color={colors.ctaText} size="small" />
) : (
- <Text style={styles.revokedTipRetryText}>重试访问</Text>
+ <Text style={styles.revokedTipRetryText}>{t('devices.list.revoked.retry')}</Text>
)}
</Pressable>
</Pressable>
@@ -1882,6 +1891,7 @@ function ProjectRow({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
// 折叠豁免要命令式读会话运行态,而派生链稳定化后本组件不再逐 emit 重渲染(cell 经
// PureComponent bail)——以 storeVersion 订阅兜底感知运行态变化,与 AutomationGroup-
// Children 同款(否则折叠线以下转入 running 的会话不会被豁免展开,review P1)。
@@ -1903,7 +1913,7 @@ function ProjectRow({
testID="home.projectGroup"
>
<Pressable
- accessibilityLabel={`项目 ${project.title}`}
+ accessibilityLabel={t('devices.list.a11y.project', { title: project.title })}
accessibilityRole="button"
accessibilityState={{ expanded: !collapsed }}
onPress={onToggle}
@@ -1963,7 +1973,7 @@ function ProjectRow({
})}
{hiddenRowCount > 0 ? (
<Pressable
- accessibilityLabel={`查看全部 ${project.sessionCount} 条对话`}
+ accessibilityLabel={t('devices.list.viewAllConversations', { count: project.sessionCount })}
accessibilityRole="button"
disabled={!project.deviceId}
onPress={onOpenProject}
@@ -1975,7 +1985,7 @@ function ProjectRow({
testID="home.projectViewAll"
>
<Text style={styles.projectViewAllText} numberOfLines={1}>
- {`查看全部 ${project.sessionCount} 条对话`}
+ {t('devices.list.viewAllConversations', { count: project.sessionCount })}
</Text>
<ChevronRight color={colors.textTertiary} size={iconSize.action} strokeWidth={iconStroke.regular} />
</Pressable>
@@ -2150,6 +2160,7 @@ function HomeSessionRowInner({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const cindyList = variant === 'cindyList';
// 运行态走订阅而非命令式读取:行已 memo 化,父层不再逐 emit 重渲染,命令式读取会 stale。
const sessionIsRunning = useSessionRunning(item.session.id);
@@ -2185,7 +2196,7 @@ function HomeSessionRowInner({
// 预览走共享 buildRemoteSessionCardPreview(已并入 #368 的 liveActivity),运行中会显示实时活动;
// 组行的预览位改为任务态摘要(需关注数 / 执行中 / 共 N 次运行),对齐桌面版组头 meta。
const preview = group
- ? automationGroupPreview(item, group.sessionCount)
+ ? automationGroupPreview(item, group.sessionCount, t)
: buildRemoteSessionCardPreview(item, { running });
// 组行点击语义对齐桌面版侧边栏:收起且有需关注内容(未读运行 / 待处理)时,点行直接打开
// 该看的那条会话(共享层 primary:运行中 > 有未读 > 最新);想展开点行首箭头(独立热区)。
@@ -2210,8 +2221,8 @@ function HomeSessionRowInner({
<Pressable
accessibilityRole="button"
accessibilityLabel={group
- ? groupRowOpensPrimary ? `打开自动化任务 ${item.title} 的最新会话` : `自动化任务 ${item.title}`
- : `打开会话 ${item.title}`}
+ ? groupRowOpensPrimary ? t('devices.list.a11y.openAutomationLatest', { title: item.title }) : t('devices.list.a11y.automationTask', { title: item.title })
+ : t('devices.list.a11y.openConversation', { title: item.title })}
accessibilityState={group ? { expanded: groupExpanded } : undefined}
onPress={group
? groupRowOpensPrimary ? openGroupPrimary : () => onToggleAutomationGroup?.(group.key)
@@ -2234,7 +2245,7 @@ function HomeSessionRowInner({
// 展开箭头放行首,与项目组的折叠交互一致(chevron → 图标 → 标题);
// 独立热区:即使组行点击直开会话(有需关注内容时),点箭头仍然是展开 / 收起。
<Pressable
- accessibilityLabel={groupExpanded ? `收起 ${item.title}` : `展开 ${item.title}`}
+ accessibilityLabel={groupExpanded ? t('devices.list.a11y.collapse', { title: item.title }) : t('devices.list.a11y.expand', { title: item.title })}
accessibilityRole="button"
hitSlop={{ bottom: 12, left: 12, right: 4, top: 12 }}
onPress={(event) => {
@@ -2290,7 +2301,7 @@ function HomeSessionRowInner({
<SessionRightSpinner testID={`home.sessionRightStatus.running.${item.session.id}`} />
) : (
<View
- accessibilityLabel={rightStatus === 'error' ? '任务出错' : rightStatus === 'awaiting' ? '等待你处理' : '已完成未读'}
+ accessibilityLabel={rightStatus === 'error' ? t('devices.list.a11y.taskError') : rightStatus === 'awaiting' ? t('devices.list.a11y.awaitingYou') : t('devices.list.a11y.doneUnread')}
accessibilityRole="image"
style={[styles.sessionRightDot, {
backgroundColor: rightStatus === 'error'
@@ -2378,6 +2389,7 @@ function AutomationGroupChildren({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
// 折叠豁免要命令式读子会话运行态,而父行(HomeSessionRow)已 memo 化、不再逐 emit
// 重渲染——这里以 storeVersion 订阅兜底感知运行态变化。仅组展开时挂载,量小成本可忽略。
useRemoteSessionStoreVersion();
@@ -2417,7 +2429,7 @@ function AutomationGroupChildren({
})}
{hasViewAllRow ? (
<Pressable
- accessibilityLabel={`查看全部 ${group.sessionCount} 次运行`}
+ accessibilityLabel={t('devices.list.viewAllRuns', { count: group.sessionCount })}
accessibilityRole="button"
onPress={() => onOpenGroup?.(group)}
style={({ pressed }) => [
@@ -2429,7 +2441,7 @@ function AutomationGroupChildren({
testID={`${testID}.automationViewAll`}
>
<Text style={styles.projectViewAllText} numberOfLines={1}>
- {`查看全部 ${group.sessionCount} 次运行`}
+ {t('devices.list.viewAllRuns', { count: group.sessionCount })}
</Text>
<ChevronRight color={colors.textTertiary} size={variant === 'cindyList' ? iconSize.xs : iconSize.action} strokeWidth={iconStroke.regular} />
</Pressable>
@@ -2439,17 +2451,17 @@ function AutomationGroupChildren({
}
/** 自动化组行的预览位文案:需关注数 > 执行中 > 共 N 次运行(对齐桌面版组头 meta 的优先级)。 */
-function automationGroupPreview(item: RemoteSessionListItem, sessionCount: number): string {
+function automationGroupPreview(item: RemoteSessionListItem, sessionCount: number, t: TFunction): string {
const unread = item.scheduleInfo?.unreadCount ?? 0;
const waiting = item.pendingInteractionCount;
if (unread > 0 || waiting > 0) {
return [
- unread > 0 ? `${unread} 个需关注` : null,
- waiting > 0 ? `等待处理 ${waiting} 个` : null,
+ unread > 0 ? t('devices.list.preview.needAttention', { count: unread }) : null,
+ waiting > 0 ? t('devices.list.preview.waiting', { count: waiting }) : null,
].filter(Boolean).join(' · ');
}
- if (item.scheduleInfo?.running) return '自动化执行中';
- return `共 ${sessionCount} 次运行`;
+ if (item.scheduleInfo?.running) return t('devices.list.preview.automationRunning');
+ return t('devices.list.preview.totalRuns', { count: sessionCount });
}
// 状态提醒点已移到行右侧(替代时间位,与桌面一致),行首图标只保留 vendor 标识 +
@@ -2530,6 +2542,7 @@ function SessionRelativeTime({ lastActivityAt, style }: { lastActivityAt: string
function SessionRightSpinner({ testID }: { testID?: string }) {
const { colors } = useTheme();
+ const { t } = useTranslation();
const spin = useRef(new Animated.Value(0)).current;
useEffect(() => {
const loop = Animated.loop(
@@ -2548,7 +2561,7 @@ function SessionRightSpinner({ testID }: { testID?: string }) {
const rotate = spin.interpolate({ inputRange: [0, 1], outputRange: ['0deg', '360deg'] });
return (
<Animated.View
- accessibilityLabel="运行中"
+ accessibilityLabel={t('devices.list.a11y.running')}
style={{ transform: [{ rotate }] }}
testID={testID}
>
@@ -2648,9 +2661,9 @@ function isClaudeCodeAgentKind(agentKind: string): boolean {
return agentKind !== 'codex';
}
-function homeConnectionTitle(status: 'online' | 'connecting' | 'stopped'): string {
- if (status === 'connecting') return '连接中';
- if (status === 'stopped') return '连接断开';
+function homeConnectionTitle(status: 'online' | 'connecting' | 'stopped', t: TFunction): string {
+ if (status === 'connecting') return t('devices.list.connection.connecting');
+ if (status === 'stopped') return t('devices.list.connection.disconnected');
return '';
}
diff --git a/apps/mobile/app/files/[sessionId].tsx b/apps/mobile/app/files/[sessionId].tsx
index e36d4c6591..1c805993ae 100644
--- a/apps/mobile/app/files/[sessionId].tsx
+++ b/apps/mobile/app/files/[sessionId].tsx
@@ -10,6 +10,7 @@ import * as Clipboard from 'expo-clipboard';
import { useFocusEffect, useLocalSearchParams, useRouter } from 'expo-router';
import { fsWatchTopic } from '@cindy/device-link';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
+import { useTranslation } from 'react-i18next';
import {
ArrowDownAZ,
ArrowDownWideNarrow,
@@ -116,6 +117,7 @@ const SEARCH_FILES_CAP = 20000;
export default function RemoteFileBrowserScreen() {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const params = useLocalSearchParams<{
sessionId: string;
deviceId?: string;
@@ -340,13 +342,13 @@ export default function RemoteFileBrowserScreen() {
const localUri = displayUri.startsWith('file://')
? displayUri
: await downloadRemoteMediaShareTemp(displayUri, mime);
- if (!localUri) throw new Error('无法获取本地图片文件');
+ if (!localUri) throw new Error('failed to obtain local image file');
const sharing = await import('expo-sharing');
await sharing.shareAsync(localUri, { mimeType: mime });
} catch {
- showNotice('分享失败,请重试');
+ showNotice(t('files.browser.shareFailed'));
}
- }, [showNotice]);
+ }, [showNotice, t]);
const openItem = useCallback((item: FileBrowserGridItem) => {
if (item.kind === 'dir') {
@@ -402,8 +404,8 @@ export default function RemoteFileBrowserScreen() {
const copyItemPath = useCallback(async (item: FileBrowserGridItem) => {
await Clipboard.setStringAsync(absolutePathOf(item.relPath));
setContextItem(null);
- showNotice('已复制路径');
- }, [absolutePathOf, showNotice]);
+ showNotice(t('files.browser.copiedPath'));
+ }, [absolutePathOf, showNotice, t]);
const sendItemToSession = useCallback((item: FileBrowserGridItem) => {
setContextItem(null);
@@ -442,7 +444,7 @@ export default function RemoteFileBrowserScreen() {
// 导出/分享 = 系统分享单一步到位(iOS 分享单自带「存储图像」,不再单设保存)。
setContextItem(null);
if (item.kind !== 'file') return;
- showNotice('正在从电脑导出…');
+ showNotice(t('files.browser.exporting'));
void (async () => {
try {
let url: string;
@@ -468,7 +470,7 @@ export default function RemoteFileBrowserScreen() {
mime = shareMimeForFileName(item.name);
}
const localUri = await downloadRemoteMediaShareTemp(url, mime, item.name);
- if (!localUri) throw new Error('下载失败');
+ if (!localUri) throw new Error(t('files.browser.downloadFailed'));
const sharing = await import('expo-sharing');
await sharing.shareAsync(localUri, { mimeType: mime });
setNotice(null);
@@ -476,13 +478,13 @@ export default function RemoteFileBrowserScreen() {
showNotice(formatRemoteError(err));
}
})();
- }, [absolutePathOf, deviceId, maker, openLink, presignGet, resolveFileMedia, showNotice, workdir]);
+ }, [absolutePathOf, deviceId, maker, openLink, presignGet, resolveFileMedia, showNotice, t, workdir]);
/** lightbox 底部显式操作(与预览页底栏同构):复制路径 / 发送到会话。 */
const lightboxActions = useMemo((): readonly ImageLightboxAction[] => [
{
key: 'copyPath',
- label: '复制路径',
+ label: t('files.browser.copyPath'),
icon: Copy,
onPress: (image) => {
const rel = relPathFromGalleryKey(image.key);
@@ -491,7 +493,7 @@ export default function RemoteFileBrowserScreen() {
},
{
key: 'sendToSession',
- label: '发送到会话',
+ label: t('files.browser.sendToSession'),
icon: MessageSquarePlus,
onPress: (image) => {
const rel = relPathFromGalleryKey(image.key);
@@ -509,7 +511,7 @@ export default function RemoteFileBrowserScreen() {
});
},
},
- ], [absolutePathOf, sendItemToSession]);
+ ], [absolutePathOf, sendItemToSession, t]);
/**
* lightbox 圈点标注(与聊天/托盘同一套画笔):提交只投递「图源 + 矢量笔迹」
@@ -517,7 +519,7 @@ export default function RemoteFileBrowserScreen() {
* 统一执行——文件浏览器页没有附件托盘,不在本页做任何重活。
*/
const lightboxAnnotation = useMemo((): ImageLightboxAnnotationConfig => ({
- submitLabel: '发送到会话',
+ submitLabel: t('files.browser.sendToSession'),
onSubmit: (_image, displayUri, strokes, context) => {
queueComposerAnnotationSubmission(sessionId, {
displayUri,
@@ -534,14 +536,14 @@ export default function RemoteFileBrowserScreen() {
},
});
},
- }), [deviceId, router, sessionId]);
+ }), [deviceId, router, sessionId, t]);
/** 标题菜单里的当前目录操作(显式入口,不依赖长按)。 */
const copyCurrentDirPath = useCallback(() => {
setTitleMenuOpen(false);
void Clipboard.setStringAsync(absolutePathOf(relPath));
- showNotice('已复制路径');
- }, [absolutePathOf, relPath, showNotice]);
+ showNotice(t('files.browser.copiedPath'));
+ }, [absolutePathOf, relPath, showNotice, t]);
const sendCurrentDirToSession = useCallback(() => {
setTitleMenuOpen(false);
@@ -633,7 +635,8 @@ export default function RemoteFileBrowserScreen() {
if (seq !== contentSeqRef.current) return;
setContentMatches(res.matches ?? []);
setContentSummary(
- `${res.totalMatches} 处匹配 · ${res.totalFiles} 个文件${res.truncated ? ' · 已达上限截断' : ''}`,
+ t('files.browser.contentSummary', { matches: res.totalMatches, files: res.totalFiles })
+ + (res.truncated ? t('files.browser.contentSummaryTruncated') : ''),
);
})
.catch((err) => {
@@ -644,7 +647,7 @@ export default function RemoteFileBrowserScreen() {
});
}, 450);
return () => clearTimeout(timer);
- }, [deviceId, maker, openLink, query, searchMode, searchOpen, workdir]);
+ }, [deviceId, maker, openLink, query, searchMode, searchOpen, t, workdir]);
// fs-watch:聚焦时订阅当前 workdir 的文件树变更,变更去抖后静默刷新;
// 失焦/退出释放订阅(被控端 watch 引擎由订阅计数驱动启停)。
@@ -677,7 +680,7 @@ export default function RemoteFileBrowserScreen() {
() => (workdir ? buildWorkdirPathLevels(workdir, relPath) : []),
[relPath, workdir],
);
- const title = pathLevels.find((level) => level.current)?.label ?? '远程文件';
+ const title = pathLevels.find((level) => level.current)?.label ?? t('files.browser.titleFallback');
const summary = summarizeFileBrowserGrid(items);
const isRoot = relPath === '';
const noWorkdir = !!session && !workdir;
@@ -726,7 +729,7 @@ export default function RemoteFileBrowserScreen() {
testID="files.backButton"
/>
<Pressable
- accessibilityLabel="路径与视图菜单"
+ accessibilityLabel={t('files.browser.a11yTitleMenu')}
onPress={() => setTitleMenuOpen(true)}
style={styles.titleGroup}
testID="files.titleMenuButton"
@@ -737,7 +740,7 @@ export default function RemoteFileBrowserScreen() {
</View>
</Pressable>
<Pressable
- accessibilityLabel="搜索文件名"
+ accessibilityLabel={t('files.browser.a11ySearch')}
hitSlop={8}
onPress={() => setSearchOpen(true)}
style={({ pressed }) => [styles.navActionBtn, pressed && styles.pressed]}
@@ -746,7 +749,7 @@ export default function RemoteFileBrowserScreen() {
<Search color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />
</Pressable>
<Pressable
- accessibilityLabel="更多"
+ accessibilityLabel={t('files.browser.a11yMore')}
hitSlop={8}
onPress={() => setTitleMenuOpen(true)}
style={({ pressed }) => [styles.navActionBtn, pressed && styles.pressed]}
@@ -760,7 +763,7 @@ export default function RemoteFileBrowserScreen() {
{!searchOpen ? (
<View style={styles.sectionRow}>
<Text numberOfLines={1} style={styles.sectionLabel}>
- {deviceName}{isRoot ? ' · 工作目录' : ''}
+ {deviceName}{isRoot ? t('files.browser.workdirSuffix') : ''}
</Text>
{loading && !refreshing ? <ActivityIndicator color={colors.textTertiary} size="small" /> : null}
</View>
@@ -790,10 +793,10 @@ export default function RemoteFileBrowserScreen() {
ListEmptyComponent={
<Text style={styles.searchHint} testID="files.contentSearchHint">
{searchLoading
- ? '正在搜索文件内容…'
+ ? t('files.browser.searchingContent')
: query.trim().length >= 2
- ? '没有匹配的内容。'
- : '输入至少 2 个字符搜索文件内容。'}
+ ? t('files.browser.noContentMatch')
+ : t('files.browser.contentSearchMinChars')}
</Text>
}
ListFooterComponent={
@@ -818,15 +821,15 @@ export default function RemoteFileBrowserScreen() {
ListEmptyComponent={
<Text style={styles.searchHint} testID="files.searchHint">
{searchLoading
- ? '正在建立文件索引…'
+ ? t('files.browser.indexing')
: query.trim()
- ? '没有匹配的文件名。'
- : '输入关键字按文件名搜索。'}
+ ? t('files.browser.noNameMatch')
+ : t('files.browser.nameSearchPrompt')}
</Text>
}
ListFooterComponent={
searchMatches.length > 0 ? (
- <Text style={styles.footerText}>{searchMatches.length} 个结果 · 按名称匹配</Text>
+ <Text style={styles.footerText}>{t('files.browser.nameResultSummary', { n: searchMatches.length })}</Text>
) : null
}
renderItem={({ item }) => (
@@ -836,7 +839,7 @@ export default function RemoteFileBrowserScreen() {
/>
) : noWorkdir ? (
<Text style={styles.searchHint} testID="files.noWorkdir">
- 该会话没有工作目录,无法浏览文件。
+ {t('files.browser.noWorkdir')}
</Text>
) : viewMode === 'grid' ? (
<FlatList
@@ -845,7 +848,7 @@ export default function RemoteFileBrowserScreen() {
data={items}
key={`grid-${gridColumns}`}
keyExtractor={(item) => item.key}
- ListEmptyComponent={!loading ? <Text style={styles.searchHint}>文件夹为空。</Text> : null}
+ ListEmptyComponent={!loading ? <Text style={styles.searchHint}>{t('files.browser.folderEmpty')}</Text> : null}
numColumns={gridColumns}
refreshControl={
<RefreshControl
@@ -863,7 +866,7 @@ export default function RemoteFileBrowserScreen() {
ItemSeparatorComponent={ListSeparator}
key="list"
keyExtractor={(item) => item.key}
- ListEmptyComponent={!loading ? <Text style={styles.searchHint}>文件夹为空。</Text> : null}
+ ListEmptyComponent={!loading ? <Text style={styles.searchHint}>{t('files.browser.folderEmpty')}</Text> : null}
refreshControl={
<RefreshControl
onRefresh={() => void loadDirectory({ refreshing: true })}
@@ -885,7 +888,7 @@ export default function RemoteFileBrowserScreen() {
<View style={styles.footer}>
<Text style={styles.footerStrong} testID="files.summary">{summary}</Text>
<Text style={styles.footerText}>
- {notice ?? (status === 'online' ? '已连接 · 实时同步' : '连接中…')}
+ {notice ?? (status === 'online' ? t('files.browser.footerOnline') : t('files.browser.footerConnecting'))}
</Text>
</View>
) : null}
@@ -953,9 +956,10 @@ const GridCell = memo(function GridCell({
workdir: string;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
return (
<Pressable
- accessibilityLabel={`${item.kind === 'dir' ? '打开文件夹' : '预览文件'} ${item.name}`}
+ accessibilityLabel={t(item.kind === 'dir' ? 'files.browser.a11yOpenFolder' : 'files.browser.a11yPreviewFile', { name: item.name })}
onLongPress={() => onContext(item)}
onPress={() => onOpen(item)}
style={({ pressed }) => [styles.gridCell, { width }, pressed && styles.pressed]}
@@ -1072,10 +1076,11 @@ function ListRow({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const Icon = listIconFor(item);
return (
<Pressable
- accessibilityLabel={`${item.kind === 'dir' ? '打开文件夹' : '预览文件'} ${item.name}`}
+ accessibilityLabel={t(item.kind === 'dir' ? 'files.browser.a11yOpenFolder' : 'files.browser.a11yPreviewFile', { name: item.name })}
onLongPress={onLongPress}
onPress={onPress}
style={({ pressed }) => [styles.listRow, pressed && styles.pressed]}
@@ -1114,6 +1119,11 @@ function SearchHeader({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
+ const modes = [
+ ['name', t('files.browser.searchModeName')],
+ ['content', t('files.browser.searchModeContent')],
+ ] as const;
return (
<View>
<View style={styles.searchRow}>
@@ -1124,26 +1134,26 @@ function SearchHeader({
autoCorrect={false}
autoFocus
onChangeText={onChangeQuery}
- placeholder="搜索"
+ placeholder={t('files.browser.searchPlaceholder')}
placeholderTextColor={colors.textTertiary}
style={styles.searchInput}
testID="files.searchInput"
value={query}
/>
{query ? (
- <Pressable accessibilityLabel="清空" hitSlop={8} onPress={() => onChangeQuery('')}>
+ <Pressable accessibilityLabel={t('files.browser.a11yClear')} hitSlop={8} onPress={() => onChangeQuery('')}>
<X color={colors.textTertiary} size={iconSize.md} strokeWidth={iconStroke.regular} />
</Pressable>
) : null}
</View>
- <Pressable accessibilityLabel="取消搜索" hitSlop={8} onPress={onCancel} testID="files.searchCancel">
- <Text style={styles.cancelText}>取消</Text>
+ <Pressable accessibilityLabel={t('files.browser.a11yCancelSearch')} hitSlop={8} onPress={onCancel} testID="files.searchCancel">
+ <Text style={styles.cancelText}>{t('files.browser.cancel')}</Text>
</Pressable>
</View>
<View style={styles.searchModeRow}>
- {([['name', '文件名'], ['content', '内容']] as const).map(([value, label]) => (
+ {modes.map(([value, label]) => (
<Pressable
- accessibilityLabel={`按${label}搜索`}
+ accessibilityLabel={t('files.browser.searchModeA11y', { mode: label })}
key={value}
onPress={() => onChangeMode(value)}
style={[styles.searchModePill, mode === value && styles.searchModePillActive]}
@@ -1155,7 +1165,7 @@ function SearchHeader({
</Pressable>
))}
<Text style={styles.scopeHintInline}>
- 在 {workdirLabel} 内{loading ? ' · 搜索中…' : ''}
+ {t('files.browser.searchScope', { workdir: workdirLabel })}{loading ? t('files.browser.searching') : ''}
</Text>
</View>
</View>
@@ -1174,13 +1184,14 @@ function ContentMatchRow({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const name = match.relPath.split('/').filter(Boolean).pop() ?? match.relPath;
const dirPath = match.relPath.slice(0, Math.max(0, match.relPath.length - name.length - 1));
const line = match.lineText.trim();
const hit = highlightSpan(line, query);
return (
<Pressable
- accessibilityLabel={`预览 ${name} 第 ${match.lineNumber} 行`}
+ accessibilityLabel={t('files.browser.a11yPreviewNameLine', { name, line: match.lineNumber })}
onPress={onPress}
style={({ pressed }) => [styles.contentMatchRow, pressed && styles.pressed]}
testID={`files.contentResult.${sanitizeTestId(name)}`}
@@ -1202,7 +1213,7 @@ function ContentMatchRow({
</>
) : line}
</Text>
- <Text numberOfLines={1} style={styles.cellMeta}>{dirPath || '(根目录)'}</Text>
+ <Text numberOfLines={1} style={styles.cellMeta}>{dirPath || t('files.browser.rootDir')}</Text>
</View>
</Pressable>
);
@@ -1225,9 +1236,10 @@ function highlightSpan(line: string, query: string): { before: string; matched:
function SearchResultRow({ match, onPress }: { match: FileBrowserNameMatch; onPress(): void }) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
return (
<Pressable
- accessibilityLabel={`预览 ${match.name}`}
+ accessibilityLabel={t('files.browser.a11yPreviewName', { name: match.name })}
onPress={onPress}
style={({ pressed }) => [styles.resultRow, pressed && styles.pressed]}
testID={`files.result.${sanitizeTestId(match.name)}`}
@@ -1239,7 +1251,7 @@ function SearchResultRow({ match, onPress }: { match: FileBrowserNameMatch; onPr
</View>
<View style={styles.listTextCol}>
<Text numberOfLines={1} style={styles.listName}>{match.name}</Text>
- <Text numberOfLines={1} style={styles.cellMeta}>{match.dirRelPath || '(根目录)'}</Text>
+ <Text numberOfLines={1} style={styles.cellMeta}>{match.dirRelPath || t('files.browser.rootDir')}</Text>
</View>
</Pressable>
);
@@ -1270,6 +1282,7 @@ function TitleMenu({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const row = (
key: string,
@@ -1312,27 +1325,27 @@ function TitleMenu({
</View>
))}
<View style={styles.menuGroupSep} />
- {row('view.grid', '网格视图', viewMode === 'grid', () => onSetView('grid'),
+ {row('view.grid', t('files.browser.viewGrid'), viewMode === 'grid', () => onSetView('grid'),
<LayoutGrid color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />)}
<View style={styles.menuSep} />
- {row('view.list', '列表视图', viewMode === 'list', () => onSetView('list'),
+ {row('view.list', t('files.browser.viewList'), viewMode === 'list', () => onSetView('list'),
<ListIcon color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />)}
<View style={styles.menuGroupSep} />
- {row('sort.name', '按名称排序', sortMode === 'name', () => onSetSort('name'),
+ {row('sort.name', t('files.browser.sortName'), sortMode === 'name', () => onSetSort('name'),
<ArrowDownAZ color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />)}
<View style={styles.menuSep} />
- {row('sort.mtime', '按修改时间排序', sortMode === 'mtime', () => onSetSort('mtime'),
+ {row('sort.mtime', t('files.browser.sortMtime'), sortMode === 'mtime', () => onSetSort('mtime'),
<History color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />)}
<View style={styles.menuSep} />
- {row('sort.size', '按大小排序', sortMode === 'size', () => onSetSort('size'),
+ {row('sort.size', t('files.browser.sortSize'), sortMode === 'size', () => onSetSort('size'),
<ArrowDownWideNarrow color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />)}
<View style={styles.menuGroupSep} />
{onSendCurrentToSession
- ? row('folder.send', '发送到会话', false, onSendCurrentToSession,
+ ? row('folder.send', t('files.browser.sendToSession'), false, onSendCurrentToSession,
<MessageSquarePlus color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />)
: null}
{onSendCurrentToSession ? <View style={styles.menuSep} /> : null}
- {row('folder.copy', '复制路径', false, onCopyCurrentPath,
+ {row('folder.copy', t('files.browser.copyPath'), false, onCopyCurrentPath,
<Copy color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />)}
</Pressable>
</Pressable>
@@ -1357,14 +1370,15 @@ function ContextMenu({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
if (!item) return null;
const isFile = item.kind === 'file';
const actions = [
- ...(isFile ? [{ key: 'preview', label: '快速预览', Icon: Eye, onPress: () => onPreview(item) }] : []),
- { key: 'send', label: '发送到会话', Icon: MessageSquarePlus, onPress: () => onSend(item) },
- { key: 'copy', label: '复制路径', Icon: Copy, onPress: () => onCopyPath(item) },
- ...(isFile ? [{ key: 'share', label: '导出 / 分享', Icon: ShareIcon, onPress: () => onShare(item) }] : []),
+ ...(isFile ? [{ key: 'preview', label: t('files.browser.preview'), Icon: Eye, onPress: () => onPreview(item) }] : []),
+ { key: 'send', label: t('files.browser.sendToSession'), Icon: MessageSquarePlus, onPress: () => onSend(item) },
+ { key: 'copy', label: t('files.browser.copyPath'), Icon: Copy, onPress: () => onCopyPath(item) },
+ ...(isFile ? [{ key: 'share', label: t('files.browser.exportShare'), Icon: ShareIcon, onPress: () => onShare(item) }] : []),
];
return (
diff --git a/apps/mobile/app/files/preview/[sessionId].tsx b/apps/mobile/app/files/preview/[sessionId].tsx
index adbbfa95de..aeadf40532 100644
--- a/apps/mobile/app/files/preview/[sessionId].tsx
+++ b/apps/mobile/app/files/preview/[sessionId].tsx
@@ -15,6 +15,7 @@
import * as Clipboard from 'expo-clipboard';
import { useLocalSearchParams, useRouter } from 'expo-router';
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
+import { useTranslation } from 'react-i18next';
import { ArrowDownToLine, Copy, Database, File as FileIcon, Info, MessageSquarePlus, Share as ShareIcon } from 'lucide-react-native';
import {
ActivityIndicator,
@@ -85,6 +86,7 @@ function avKindFor(name: string): 'video' | 'audio' | null {
export default function RemoteFilePreviewScreen() {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const params = useLocalSearchParams<{
sessionId: string;
deviceId?: string;
@@ -268,14 +270,14 @@ export default function RemoteFilePreviewScreen() {
const downloadAndShare = useCallback(async (item: FileBrowserGridItem) => {
if (busyLabel) return;
- setBusyLabel('正在从电脑导出…');
+ setBusyLabel(t('files.preview.exporting'));
try {
const url = await exportToUrl(item.relPath, item.mtimeMs);
// 传原始文件名:分享单按真实扩展名识别类型(PDF/视频等非图片 mime 不在
// extOfMime 映射里,不带名字会落成 .img 让接收方无法预览)。
const mime = shareMimeForFileName(item.name);
const localUri = await downloadRemoteMediaShareTemp(url, mime, item.name);
- if (!localUri) throw new Error('下载失败');
+ if (!localUri) throw new Error(t('files.preview.downloadFailed'));
const sharing = await import('expo-sharing');
await sharing.shareAsync(localUri, { mimeType: mime });
} catch (err) {
@@ -283,12 +285,12 @@ export default function RemoteFilePreviewScreen() {
} finally {
setBusyLabel(null);
}
- }, [busyLabel, exportToUrl, showNotice]);
+ }, [busyLabel, exportToUrl, showNotice, t]);
const copyPath = useCallback(async (item: FileBrowserGridItem) => {
await Clipboard.setStringAsync(absolutePathOf(item.relPath));
- showNotice('已复制路径');
- }, [absolutePathOf, showNotice]);
+ showNotice(t('files.preview.copiedPath'));
+ }, [absolutePathOf, showNotice, t]);
const sendToSession = useCallback((item: FileBrowserGridItem) => {
const merged = mergePathIntoComposerDraft(sessionId, item.relPath);
@@ -399,14 +401,14 @@ export default function RemoteFilePreviewScreen() {
<ToolbarButton
disabled={!!busyLabel}
Icon={Copy}
- label="复制路径"
+ label={t('files.preview.copyPath')}
onPress={() => void copyPath(current)}
testID="filePreview.copyPath"
/>
<ToolbarButton
disabled={!!busyLabel}
Icon={MessageSquarePlus}
- label="发送到会话"
+ label={t('files.preview.sendToSession')}
onPress={() => sendToSession(current)}
testID="filePreview.sendToSession"
/>
@@ -441,17 +443,18 @@ function PreviewNav({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
return (
<View style={styles.navRow}>
- <Pressable accessibilityLabel="完成" hitSlop={10} onPress={onDone} testID="filePreview.done">
- <Text style={styles.doneText}>完成</Text>
+ <Pressable accessibilityLabel={t('files.preview.done')} hitSlop={10} onPress={onDone} testID="filePreview.done">
+ <Text style={styles.doneText}>{t('files.preview.done')}</Text>
</Pressable>
<View style={styles.navTitleCol}>
<Text numberOfLines={1} style={styles.navTitle} testID="filePreview.title">{title}</Text>
{meta ? <Text numberOfLines={1} style={styles.navMeta}>{meta}</Text> : null}
</View>
{onShare ? (
- <Pressable accessibilityLabel="导出分享" hitSlop={10} onPress={onShare} testID="filePreview.share">
+ <Pressable accessibilityLabel={t('files.preview.a11yShare')} hitSlop={10} onPress={onShare} testID="filePreview.share">
<ShareIcon color={colors.textPrimary} size={iconSize.xl} strokeWidth={iconStroke.regular} />
</Pressable>
) : (
@@ -485,6 +488,7 @@ function FilePreviewPage({
targetLine: number | null;
workdir: string;
}) {
+ const { t } = useTranslation();
if (item.thumb === 'image') {
return (
<ImagePreviewPage
@@ -507,7 +511,7 @@ function FilePreviewPage({
if (item.thumb === 'doc') {
return <TextPreviewPage active={active} item={item} onDownload={onDownload} onQuoteSelection={onQuoteSelection} readTextFile={readTextFile} targetLine={targetLine} workdir={workdir} />;
}
- return <UnsupportedPage item={item} onDownload={onDownload} reason="此类型暂不支持在手机上预览" />;
+ return <UnsupportedPage item={item} onDownload={onDownload} reason={t('files.preview.unsupportedType')} />;
}
/** 音视频页:导出→presign→复用消息同款播放器(切后台/换页自动暂停)。 */
@@ -528,6 +532,7 @@ function AvPreviewPage({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const [url, setUrl] = useState<string | null>(null);
const [failure, setFailure] = useState<string | null>(null);
const requestedRef = useRef(false);
@@ -551,13 +556,13 @@ function AvPreviewPage({
}, [active, exportToUrl, item.mtimeMs, item.relPath, workdir]);
if (failure) {
- return <UnsupportedPage item={item} onDownload={onDownload} reason={`取回失败:${failure}`} />;
+ return <UnsupportedPage item={item} onDownload={onDownload} reason={t('files.preview.fetchAvFailed', { detail: failure })} />;
}
if (!url) {
return (
<View style={styles.centerFill} testID="filePreview.avLoading">
<ActivityIndicator color={colors.textTertiary} />
- <Text style={styles.hintText}>正在从电脑取回{kind === 'video' ? '视频' : '音频'}…</Text>
+ <Text style={styles.hintText}>{kind === 'video' ? t('files.preview.fetchingVideo') : t('files.preview.fetchingAudio')}</Text>
</View>
);
}
@@ -590,6 +595,7 @@ function PdfPreviewPage({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const [url, setUrl] = useState<string | null>(null);
const [failure, setFailure] = useState<string | null>(null);
const requestedRef = useRef(false);
@@ -615,13 +621,13 @@ function PdfPreviewPage({
}, [active, exportToUrl, item.mtimeMs, item.relPath, workdir]);
if (failure) {
- return <UnsupportedPage item={item} onDownload={onDownload} reason={`取回 PDF 失败:${failure}`} />;
+ return <UnsupportedPage item={item} onDownload={onDownload} reason={t('files.preview.fetchPdfFailed', { detail: failure })} />;
}
if (!url) {
return (
<View style={styles.centerFill} testID="filePreview.pdfLoading">
<ActivityIndicator color={colors.textTertiary} />
- <Text style={styles.hintText}>正在从电脑取回 PDF…</Text>
+ <Text style={styles.hintText}>{t('files.preview.fetchingPdf')}</Text>
</View>
);
}
@@ -650,6 +656,7 @@ function TextPreviewPage({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const markdown = isMarkdownFile(item.name);
// absPath 单文件模式(item.relPath 为绝对路径)没有可靠 mtime(恒 0),
// 缓存键无法随文件覆写失效,读写一律跳过缓存。
@@ -686,12 +693,14 @@ function TextPreviewPage({
setState({
status: 'unavailable',
oversize: true,
- reason: `文件超过预览上限(${res.stat ? formatByteSize(res.stat.size) : '过大'}),可下载原文件查看`,
+ reason: t('files.preview.oversize', {
+ size: res.stat ? formatByteSize(res.stat.size) : t('files.preview.oversizeUnknown'),
+ }),
});
} else if (res.code === 'BINARY_FILE') {
- setState({ status: 'unavailable', reason: '二进制文件,无法以文本预览' });
+ setState({ status: 'unavailable', reason: t('files.preview.binaryFile') });
} else {
- setState({ status: 'unavailable', reason: res.message ?? '读取失败' });
+ setState({ status: 'unavailable', reason: res.message ?? t('files.preview.readFailed') });
}
return;
}
@@ -717,7 +726,7 @@ function TextPreviewPage({
return () => {
cancelled = true;
};
- }, [active, cacheable, item.relPath, markdown, readTextFile, workdir]);
+ }, [active, cacheable, item.relPath, markdown, readTextFile, t, workdir]);
if (state.status === 'loading') {
return (
@@ -741,15 +750,15 @@ function TextPreviewPage({
<View style={styles.truncBar} testID="filePreview.truncBanner">
<Info color={colors.textSecondary} size={iconSize.sm} strokeWidth={iconStroke.regular} />
<Text style={styles.truncText}>
- {state.truncated ? '文件超过 2 MB,仅显示前 2 MB 内容' : `仅显示前 ${MAX_RENDERED_LINES} 行`}
+ {state.truncated ? t('files.preview.truncated2mb') : t('files.preview.truncatedLines', { lines: MAX_RENDERED_LINES })}
</Text>
</View>
) : null}
{canRenderMarkdown ? (
<View style={styles.mdToggleRow}>
- {([['rendered', '渲染'], ['source', '源码']] as const).map(([value, label]) => (
+ {([['rendered', t('files.preview.mdRendered')], ['source', t('files.preview.mdSource')]] as const).map(([value, label]) => (
<Pressable
- accessibilityLabel={`${label}视图`}
+ accessibilityLabel={t('files.preview.mdViewA11y', { view: label })}
key={value}
onPress={() => setMdView(value)}
style={[styles.mdTogglePill, mdView === value && styles.mdTogglePillActive]}
@@ -817,6 +826,7 @@ function ImagePreviewPage({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
// absPath 单文件模式(item.relPath 为绝对路径):thumbnail op 只认 workdir
// 内 relPath,禁用缩略图,直接等原图(media:fetch 通道)。
const thumbUri = useFileThumbnail(
@@ -853,7 +863,7 @@ function ImagePreviewPage({
const displayUri = fullUrl ?? thumbUri;
return (
<Pressable
- accessibilityLabel={`查看大图 ${item.name}`}
+ accessibilityLabel={t('files.preview.a11yViewImage', { name: item.name })}
disabled={!displayUri}
onPress={() => displayUri && onOpenLightbox(fullUrl ?? displayUri)}
style={styles.imagePage}
@@ -864,25 +874,25 @@ function ImagePreviewPage({
) : failure ? (
<View style={styles.imageStateWrap} testID="filePreview.imageError">
<GenericGlyph name={item.name} />
- <Text style={styles.hintText}>取回原图失败:{failure}</Text>
+ <Text style={styles.hintText}>{t('files.preview.fetchOriginalFailed', { detail: failure })}</Text>
<Pressable
- accessibilityLabel="重试取回原图"
+ accessibilityLabel={t('files.preview.a11yRetryOriginal')}
onPress={() => setAttempt((n) => n + 1)}
style={({ pressed }) => [styles.retryBtn, pressed && styles.pressed]}
testID="filePreview.imageRetry"
>
- <Text style={styles.retryLabel}>重试</Text>
+ <Text style={styles.retryLabel}>{t('files.preview.retry')}</Text>
</Pressable>
</View>
) : (
<View style={styles.imageStateWrap} testID="filePreview.imageLoading">
<ActivityIndicator color={colors.textTertiary} />
- <Text style={styles.hintText}>正在从电脑取回原图…</Text>
+ <Text style={styles.hintText}>{t('files.preview.fetchingOriginal')}</Text>
</View>
)}
{displayUri && !fullUrl ? (
<Text style={styles.imageUpgradeHint}>
- {failure ? '原图取回失败,当前为缩略图' : '缩略图 · 正在取回原图…'}
+ {failure ? t('files.preview.originalFailedThumb') : t('files.preview.fetchingOriginalHint')}
</Text>
) : null}
</Pressable>
@@ -900,6 +910,7 @@ function UnsupportedPage({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
return (
<View style={styles.centerFill} testID="filePreview.unsupported">
<View style={styles.bigPage}>
@@ -909,13 +920,13 @@ function UnsupportedPage({
<Text style={styles.bigMeta}>{item.metaLabel}</Text>
<Text style={styles.hintText}>{reason}</Text>
<Pressable
- accessibilityLabel="导出分享原文件"
+ accessibilityLabel={t('files.preview.a11yExportShareFile')}
onPress={onDownload}
style={({ pressed }) => [styles.ctaBtn, pressed && styles.pressed]}
testID="filePreview.unsupportedDownload"
>
<ArrowDownToLine color={colors.ctaText} size={iconSize.md} strokeWidth={iconStroke.regular} />
- <Text style={styles.ctaLabel}>导出 / 分享</Text>
+ <Text style={styles.ctaLabel}>{t('files.preview.exportShare')}</Text>
</Pressable>
</View>
);
diff --git a/apps/mobile/app/sessions/[sessionId].tsx b/apps/mobile/app/sessions/[sessionId].tsx
index 454d0f8b30..b2c13b2f2b 100644
--- a/apps/mobile/app/sessions/[sessionId].tsx
+++ b/apps/mobile/app/sessions/[sessionId].tsx
@@ -291,9 +291,9 @@ import {
subscribeAgentCapabilities,
} from '@/session/agentCapabilitiesCache';
import {
- MOBILE_VOICE_MIC_PERMISSION_ERROR,
- MOBILE_VOICE_REALTIME_AUDIO_UNAVAILABLE_ERROR,
isMobileVoiceMicPermissionError,
+ mobileVoiceMicPermissionError,
+ mobileVoiceRealtimeAudioUnavailableError,
type MobileVoiceState,
} from '@/session/mobileVoiceInput';
import {
@@ -454,6 +454,8 @@ import type {
RemoteDirectoryEntry,
} from '@/device-link/mobileMakerTransport';
import type { MobileCodexRateLimitsResult } from '@cindy/maker-shared/device-link-contract';
+import { useTranslation } from 'react-i18next';
+import { i18n } from '@/i18n';
import { useTheme, useThemedStyles, type ThemeColors } from '@/theme';
import { fontWeight, iconSize, iconStroke, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';
@@ -595,6 +597,7 @@ function restoreOutboxItemsToDraft(items: readonly MobileOutboxItem[]): void {
export default function SessionScreen() {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const params = useLocalSearchParams<{
sessionId: string;
deviceId?: string;
@@ -1296,12 +1299,12 @@ export default function SessionScreen() {
// fresh 元数据(getSession→upsertDeviceSession)到达前禁发,输入框仍可编辑存草稿
// (复用降级 composer 既有语义;codex review R15)。
const cacheSeededReason = currentSession?.cacheSeeded
- ? '正在同步会话数据,同步完成后即可发送。'
+ ? t('session.screen.composerSyncing')
: null;
// 新建会话乐观管线在途:合成行(pendingLocalCreation)在被控端确认前禁发,
// 输入框仍可编辑存草稿(与 cacheSeeded 同一降级通道);权威 upsert 后自净解禁。
const pendingCreationReason = currentSession?.pendingLocalCreation
- ? '会话创建中,首条消息发出后即可继续发送。'
+ ? t('session.screen.composerCreating')
: null;
const sessionOperationLayout = useMemo(
() => buildSessionOperationLayout({
@@ -1559,7 +1562,7 @@ export default function SessionScreen() {
});
const composerRuntimeLabel = composerRuntimeSummary
? agentSwitchIntent
- ? `下条切到 ${mobileAgentLabel(agentSwitchIntent.targetAgentKind)} · ${composerRuntimeSummary.modelSummary}`
+ ? t('session.screen.nextAgentSwitch', { agent: mobileAgentLabel(agentSwitchIntent.targetAgentKind), model: composerRuntimeSummary.modelSummary })
: composerRuntimeSummary.modelSummary
: '';
const composerSendUnavailableReason = canUseComposer ? null : sessionOperationLayout.composerDisabledReason;
@@ -2407,7 +2410,7 @@ export default function SessionScreen() {
} else {
if (!isAgentCapabilitiesGenerationCurrent(deviceId, generation)) return;
if (!cachedCapabilities) setCapabilities(null);
- setCapabilitiesError('远程能力返回格式不支持');
+ setCapabilitiesError(t('session.common.capabilitiesUnsupported'));
}
})
.catch((err) => {
@@ -2487,7 +2490,7 @@ export default function SessionScreen() {
} else {
if (!isAgentCapabilitiesGenerationCurrent(deviceId, generation)) return;
if (!cached) setAlternateCapabilities(null);
- setAlternateCapabilitiesError('远程能力返回格式不支持');
+ setAlternateCapabilitiesError(t('session.common.capabilitiesUnsupported'));
}
})
.catch((err) => {
@@ -2673,11 +2676,11 @@ export default function SessionScreen() {
return;
}
if (status === 'create-failed') {
- const message = creationTask?.error ?? '会话创建失败。';
- setError(`会话创建失败:${message}`);
- Alert.alert('会话创建失败', message, [
+ const message = creationTask?.error ?? t('session.screen.createFailedDefault');
+ setError(t('session.screen.createFailedNotice', { message }));
+ Alert.alert(t('session.screen.createFailedTitle'), message, [
{
- text: '返回编辑',
+ text: t('session.screen.backToEdit'),
style: 'cancel',
onPress: () => {
if (!creationTask) return;
@@ -2687,7 +2690,7 @@ export default function SessionScreen() {
},
},
{
- text: '重试',
+ text: t('session.screen.retry'),
onPress: () => {
setError(null);
retryNewSessionCreation(sessionId);
@@ -2723,7 +2726,7 @@ export default function SessionScreen() {
});
}
}
- setError(creationTask?.error ?? '首条消息没有发出,内容已还原到输入框。');
+ setError(creationTask?.error ?? t('session.screen.firstMessageNotSent'));
dismissNewSessionCreation(sessionId);
void load();
}
@@ -3126,7 +3129,7 @@ export default function SessionScreen() {
if (cancelled) return;
remoteSessionStore.mergeMessages(sessionId, Array.isArray(list) ? list : []);
if (!Array.isArray(list) || list.length === 0) {
- setError('未找到要定位的消息。');
+ setError(t('session.screen.locateMessageNotFound'));
return;
}
appliedRouteFocusKeyRef.current = routeFocusKey;
@@ -3234,15 +3237,15 @@ export default function SessionScreen() {
}
}
}
- if (!localUri) throw new Error('无法获取本地图片文件');
+ if (!localUri) throw new Error(t('session.screen.shareNoLocalImage'));
// 动态 import:expo-sharing 在模块顶层 requireNativeModule('ExpoSharing'),
// 旧构建(未含该原生模块)静态 import 会直接崩屏;延迟到点击时加载,缺模块走兜底提示。
const sharing = await import('expo-sharing');
await sharing.shareAsync(localUri, effectiveMime ? { mimeType: effectiveMime } : undefined);
} catch {
- Alert.alert('分享失败', '当前客户端暂不支持分享,更新到最新版本后重试。');
+ Alert.alert(t('session.screen.shareFailedTitle'), t('session.screen.shareUnsupported'));
}
- }, [diskCacheSourceOf]);
+ }, [diskCacheSourceOf, t]);
// 换会话与退屏共用一套清理:本屏切 sessionId 不重挂载,若只在 unmount 清理,
// 连续浏览多个多图会话会让上一会话的 OSS 对象一路累积。cleanup 在 sessionId
@@ -3341,12 +3344,12 @@ export default function SessionScreen() {
try {
if (!deviceId) {
setVoiceState('error');
- setVoiceError('缺少远程设备,不能开始语音输入。');
+ setVoiceError(t('session.screen.voiceNoRemoteDevice'));
return;
}
if (!isMobileRealtimeAudioAvailable()) {
setVoiceState('error');
- setVoiceError(MOBILE_VOICE_REALTIME_AUDIO_UNAVAILABLE_ERROR);
+ setVoiceError(mobileVoiceRealtimeAudioUnavailableError());
return;
}
startupSeq = voiceStartupSeqRef.current + 1;
@@ -3364,7 +3367,7 @@ export default function SessionScreen() {
voiceRecordingActiveRef.current = false;
voiceStopAfterStartRef.current = false;
setVoiceState('error');
- setVoiceError(MOBILE_VOICE_MIC_PERMISSION_ERROR);
+ setVoiceError(mobileVoiceMicPermissionError());
return;
}
await setAudioModeAsync({
@@ -3506,7 +3509,7 @@ export default function SessionScreen() {
setVoiceError(formatRemoteError(err));
await setAudioModeAsync({ allowsRecording: false }).catch(() => undefined);
}
- }, [deviceId, draft, openLink, renderItems, voiceIsProcessing, voiceState]);
+ }, [deviceId, draft, openLink, renderItems, t, voiceIsProcessing, voiceState]);
const cancelVoiceForAppBackground = useCallback(() => {
const controller = voiceControllerSessionRef.current;
@@ -3605,7 +3608,7 @@ export default function SessionScreen() {
: documentBeforeStop;
if (options.sendAfterTranscribe && (composerDocumentHasContent(latestDocument) || attachments.length > 0)) {
const sendLatest = sendLatestRef.current;
- if (!sendLatest) throw new Error('消息发送器未初始化。');
+ if (!sendLatest) throw new Error(t('session.screen.voiceSenderNotReady'));
await sendLatest({ documentOverride: latestDocument });
}
} catch (err) {
@@ -3617,7 +3620,7 @@ export default function SessionScreen() {
} finally {
voiceStopInFlightRef.current = false;
}
- }, [attachments.length, moveComposerCaretToEnd, voiceState]);
+ }, [attachments.length, moveComposerCaretToEnd, t, voiceState]);
const openVoiceSettings = useCallback(() => {
void Linking.openSettings().catch((err) => {
@@ -3662,7 +3665,7 @@ export default function SessionScreen() {
const renderComposerVoiceButton = (buttonStyle?: StyleProp<ViewStyle>) => (
<RouteActionButton
- accessibilityLabel={voiceIsListening ? '停止录音' : '开始语音输入'}
+ accessibilityLabel={voiceIsListening ? t('session.common.voiceStopRecording') : t('session.screen.voiceStartInput')}
accessibilityHint={composerLayout.voice.disabledReason ?? composerSendUnavailableReason ?? undefined}
active={composerLayout.voice.active}
busy={voiceIsProcessing}
@@ -3841,11 +3844,11 @@ export default function SessionScreen() {
};
const sessionNow = remoteSessionStore.getSessions().find((entry) => entry.id === item.sessionId);
if (!sessionNow) {
- failItem('未找到当前远程会话,请重新同步后再发送。');
+ failItem(t('session.screen.sessionNotFoundResync'));
return;
}
if (!sessionNow.workingDir) {
- failItem('当前会话缺少工作目录,不能发送消息。');
+ failItem(t('session.screen.missingWorkingDir'));
return;
}
const sessionAtSend = { ...sessionNow, permissionMode: item.permissionModeAtSend };
@@ -4025,7 +4028,7 @@ export default function SessionScreen() {
return;
}
if (!currentSession) {
- setError('未找到当前远程会话,请重新同步后再发送。');
+ setError(t('session.screen.sessionNotFoundResync'));
if (options.documentOverride) applyComposerDocument(options.documentOverride);
return;
}
@@ -4108,7 +4111,7 @@ export default function SessionScreen() {
&& (uploadsInFlight > 0 || outboxRef.current.length > 0 || outboxPumpBusyRef.current)) {
try {
if (!currentSession.workingDir) {
- setError('当前会话缺少工作目录,不能发送消息。');
+ setError(t('session.screen.missingWorkingDir'));
restoreDraftAfterFailure();
return;
}
@@ -4201,7 +4204,7 @@ export default function SessionScreen() {
.find((entry) => entry.clientId === editingQueueItem.clientId);
if (!original) {
// 条目已被远端发出/删除(vanish effect 与本次点击竞态):原文不可改,放弃保存。
- setError('这条排队消息已不在队列里,修改未保存。');
+ setError(t('session.screen.queueMessageGone'));
cancelQueueEdit();
return;
}
@@ -4282,7 +4285,7 @@ export default function SessionScreen() {
throw fallbackErr;
}
} else if (isChannelNotAllowedError(err)) {
- setError('电脑端版本过旧,还不支持安全修改排队引用、附件或清空文本。请升级电脑端,或仅修改普通文字。');
+ setError(t('session.screen.editQueueUnsupported'));
restoreQueueEditDraftAfterFailure();
return false;
} else {
@@ -4350,7 +4353,7 @@ export default function SessionScreen() {
// 点选意图明确,不应被白名单覆盖。点选后再次打开 palette 或发送后 ref 清零。
const desktopCommand = hasAttachments ? null : earlyDesktopCommand;
if (!sessionAtSend.workingDir && !localSystemCommand && !desktopCommand) {
- setError('当前会话缺少工作目录,不能发送消息。');
+ setError(t('session.screen.missingWorkingDir'));
restoreDraftAfterFailure();
return;
}
@@ -4615,7 +4618,7 @@ export default function SessionScreen() {
const renderComposerAttachmentButton = () => (
<RouteActionButton
- accessibilityLabel={composerLayout.attachment.active ? composerLayout.attachment.label : '打开上下文面板'}
+ accessibilityLabel={composerLayout.attachment.active ? composerLayout.attachment.label : t('session.common.openContextPanel')}
accessibilityHint={composerLayout.attachment.disabledReason ?? composerSendUnavailableReason ?? undefined}
active={composerLayout.attachment.active}
disabled={composerLayout.attachment.disabled || (!canUseComposer && !composerLayout.attachment.active)}
@@ -4672,7 +4675,7 @@ export default function SessionScreen() {
<>
{composerShowInlineStop ? (
<RouteActionButton
- accessibilityLabel="停止远程会话"
+ accessibilityLabel={t('session.screen.stopSession')}
accessibilityHint={composerLayout.stop.disabledReason ?? undefined}
disabled={composerLayout.stop.disabled}
hitSlop={COMPOSER_CONTROL_HIT_SLOP}
@@ -4700,7 +4703,7 @@ export default function SessionScreen() {
) : null}
{composerSendSlotIsStop ? (
<RouteActionButton
- accessibilityLabel="停止远程会话"
+ accessibilityLabel={t('session.screen.stopSession')}
accessibilityHint={composerLayout.stop.disabledReason ?? undefined}
disabled={composerLayout.stop.disabled}
hitSlop={COMPOSER_CONTROL_HIT_SLOP}
@@ -4728,7 +4731,7 @@ export default function SessionScreen() {
) : composerShowSendButton ? (
<RouteActionButton
ref={sendButtonRef}
- accessibilityLabel={voiceIsListening ? '结束语音输入并发送' : '发送远程消息'}
+ accessibilityLabel={voiceIsListening ? t('session.screen.voiceStopAndSend') : t('session.screen.sendMessage')}
accessibilityHint={composerLayout.send.disabledReason ?? composerLayout.guidanceText}
disabled={composerSendDisabled}
hitSlop={COMPOSER_CONTROL_HIT_SLOP}
@@ -4869,14 +4872,14 @@ export default function SessionScreen() {
// OSS 引用在物化完成前被删(review P2)。编辑生命周期的全部入口/出口由此都被
// in-flight promise 串行化。
if (queueEditSaveInFlightRef.current) {
- setError('正在保存上一条排队消息的修改,完成后再编辑。');
+ setError(t('session.screen.savingPreviousQueueEdit'));
return;
}
// 托盘里还有在途上传时不进入编辑:上传完成回调会把文件追加进当前托盘,编辑中
// 落定会把用户的草稿附件误挂到队列条目上、取消时又会被当作编辑期新增而回收
// (review P1)。等待落定后再编辑,错误文案给出下一步。
if (pendingUploads.length > 0) {
- setError('还有附件正在上传,等上传完成后再编辑排队消息。');
+ setError(t('session.screen.attachmentsUploadingBeforeEdit'));
return;
}
const previous = queueEditingRef.current;
@@ -5051,7 +5054,7 @@ export default function SessionScreen() {
const sessionAtSend = currentSession;
if (!state || tailBannerBusy || !sessionId) return;
if (!sessionAtSend || sessionAtSend.cacheSeeded) {
- setError('会话尚未同步完成,请稍后再试。');
+ setError(t('session.screen.sessionNotSyncedRetry'));
return;
}
const interrupted = state.kind === 'interrupted' || state.continueKind === 'interrupted';
@@ -5080,7 +5083,7 @@ export default function SessionScreen() {
} finally {
setTailBannerBusy(false);
}
- }, [currentSession, maker, sessionId, tailBannerBusy, tailBannerState]);
+ }, [currentSession, maker, sessionId, t, tailBannerBusy, tailBannerState]);
//「忽略」:error-tail 持久化 dismiss(被控端 merge dismissed:true,重拉不复活),
// 本地 dismissed 集合乐观熄灭 banner,同时错误卡回流消息流(errorTailClientId 排除
@@ -5294,12 +5297,12 @@ export default function SessionScreen() {
// 窗口(原生还在读剪贴板)任务未入队也未进 pendingUploads state,不计入的话
// 这里会放行超额选图,占位兑现时轮到粘贴图自己撞上限被丢(review P2)。
if (attachments.length + pendingMediaAssets.length + getPendingUploadCount() >= MOBILE_MAX_ATTACHMENTS) {
- setAttachmentError(`最多添加 ${MOBILE_MAX_ATTACHMENTS} 个附件。`);
+ setAttachmentError(t('session.common.maxAttachments', { max: MOBILE_MAX_ATTACHMENTS }));
return;
}
setAttachmentError(null);
setPendingMediaAssets([...pendingMediaAssets, asset]);
- }, [attachments.length, getPendingUploadCount, mediaAssetAttachments, pendingMediaAssets, removeRemoteFileAttachment, uploadingMediaAssetIds]);
+ }, [attachments.length, getPendingUploadCount, mediaAssetAttachments, pendingMediaAssets, removeRemoteFileAttachment, t, uploadingMediaAssetIds]);
// 底部「加入对话」:点击当帧把待选照片同步入队(缩略图立即进托盘)并关面板;token 传
// Promise 由任务自行等待(codex review R8:先 await token 再 enqueue 的等待窗里,面板可被
// 背板关掉、send() 的 waitForPendingUploads 看不到任务,文字消息会丢下刚选的图先发出去)。
@@ -5452,7 +5455,7 @@ export default function SessionScreen() {
const current = await maker.goal.getStatus(sessionId);
remoteSessionStore.setGoalStatus(sessionId, current ?? null);
if (current) {
- setGoalError('该会话已有进行中的目标,请先在此处理它。');
+ setGoalError(t('session.screen.goalAlreadyActive'));
return;
}
}
@@ -5469,7 +5472,7 @@ export default function SessionScreen() {
setGoalBusy(false);
}
})();
- }, [goalBusy, goalStatus, maker, requestMessageListFollowLatest, sessionId, setComposerDraft]);
+ }, [goalBusy, goalStatus, maker, requestMessageListFollowLatest, sessionId, setComposerDraft, t]);
const handlePauseGoal = useCallback(() => {
void runGoalAction(
() => maker.goal.pause(sessionId),
@@ -5667,7 +5670,7 @@ export default function SessionScreen() {
setCodexResetRetryKey(null);
await refreshAccountUsage();
if (contextUsageSessionRef.current !== sessionId) return;
- Alert.alert('请重新确认', '重置凭证已过期,请确认刷新后的额度信息。');
+ Alert.alert(t('session.screen.resetReconfirmTitle'), t('session.screen.resetOfferExpired'));
return;
}
setCodexResetRetryKey(idempotencyKey);
@@ -5684,12 +5687,12 @@ export default function SessionScreen() {
if (contextUsageSessionRef.current !== sessionId) return;
}
const message = {
- reset: 'Codex 用量窗口已重置。',
- nothingToReset: '当前没有需要重置的用量窗口。',
- noCredit: '当前没有可用的重置次数。',
- alreadyRedeemed: '这次重置请求已经处理过,用量已刷新。',
+ reset: t('session.screen.resetOutcomeReset'),
+ nothingToReset: t('session.screen.resetOutcomeNothing'),
+ noCredit: t('session.screen.resetOutcomeNoCredit'),
+ alreadyRedeemed: t('session.screen.resetOutcomeAlready'),
}[result.outcome];
- Alert.alert(result.outcome === 'reset' ? '重置完成' : '重置结果', message);
+ Alert.alert(result.outcome === 'reset' ? t('session.screen.resetDoneTitle') : t('session.screen.resetResultTitle'), message);
} catch (err) {
if (contextUsageSessionRef.current === sessionId) {
if (isPreconditionFailedRemoteError(err)) {
@@ -5697,10 +5700,10 @@ export default function SessionScreen() {
setCodexRateLimits((current) => current ? { ...current, resetOffer: null } : null);
await refreshAccountUsage();
if (contextUsageSessionRef.current === sessionId) {
- Alert.alert('请重新确认', humanizeRemoteError(err));
+ Alert.alert(t('session.screen.resetReconfirmTitle'), humanizeRemoteError(err));
}
} else {
- Alert.alert('重置失败', humanizeRemoteError(err));
+ Alert.alert(t('session.screen.resetFailedTitle'), humanizeRemoteError(err));
}
}
} finally {
@@ -5869,13 +5872,13 @@ export default function SessionScreen() {
}
const mime = shareMimeForFileName(name);
const localUri = await downloadRemoteMediaShareTemp(url, mime, name);
- if (!localUri) throw new Error('下载失败');
+ if (!localUri) throw new Error(t('session.screen.downloadFailed'));
const sharing = await import('expo-sharing');
await sharing.shareAsync(localUri, { mimeType: mime });
// 只关本次分享对应的菜单:分享期间用户可能已关闭并长按另一 chip 打开新菜单
setChipMenuTarget((prev) => (prev?.absPath === target.absPath ? null : prev));
} catch (err) {
- Alert.alert('分享失败', formatRemoteError(err));
+ Alert.alert(t('session.screen.shareFailedTitle'), formatRemoteError(err));
} finally {
setChipShareBusy(false);
}
@@ -6010,7 +6013,7 @@ export default function SessionScreen() {
// 污染的快照值(与首页失败分支同口径);离线时 reseed 失败无害。
remoteSessionStore.requestReseed(deviceId);
// 与首页同款人话文案(review P2):不把 [NOT_CONNECTED] 原始错误码怼给用户。
- Alert.alert('操作失败', humanizeRemoteError(err));
+ Alert.alert(t('session.screen.operationFailed'), humanizeRemoteError(err));
} finally {
releasePending();
}
@@ -6141,7 +6144,7 @@ export default function SessionScreen() {
?? targetSession?.deviceLinkDeviceId
?? remoteSessionStore.getSessionDeviceId(target.sessionId);
if (!targetDeviceId) {
- setError('未找到这个会话所属的电脑,请确认对应设备已连接后重试。');
+ setError(t('session.screen.sessionDeviceNotFound'));
return;
}
router.push({
@@ -6242,13 +6245,10 @@ export default function SessionScreen() {
const deleteMessage = useCallback((clientId: string) => {
if (!deviceId || messageActionBusy) return;
- Alert.alert('删除本条对话?', [
- '用户消息只删除本条;AI 消息会删除上一次用户输入之后产生的整轮输出。',
- '之后的对话继续保留。下次发送时,AI 上下文会从剩余记录重建。',
- ].join(''), [
- { text: '取消', style: 'cancel' },
+ Alert.alert(t('session.screen.deleteMessageTitle'), t('session.screen.deleteMessageBody'), [
+ { text: t('session.common.cancel'), style: 'cancel' },
{
- text: '删除本条对话',
+ text: t('session.screen.deleteMessageAction'),
style: 'destructive',
onPress: () => {
void (async () => {
@@ -6368,9 +6368,9 @@ export default function SessionScreen() {
remoteUnavailableReason={remoteUnavailableReason}
searchOpen={searchOpen}
title={isDeviceAccessRevoked
- ? '访问已撤销'
+ ? t('session.screen.accessRevokedShort')
: currentSession?.title || currentSession?.workingDir
- || (connectionError ? '会话未同步' : (deviceName || '对话'))}
+ || (connectionError ? t('session.screen.sessionNotSynced') : (deviceName || t('session.screen.conversationFallback')))}
/>
{showConnectionBanner ? (
@@ -6456,7 +6456,7 @@ export default function SessionScreen() {
footer={contextSheetView !== 'goal' && pendingMediaAssets.length > 0 ? (
<ContextSheetFooterButton
disabled={!canUseComposer}
- label={`加入对话(${pendingMediaAssets.length} 张)`}
+ label={t('session.common.joinConversation', { num: pendingMediaAssets.length })}
onPress={() => void commitPendingMediaAssets()}
testID="session.contextSheetCommitMedia"
/>
@@ -6465,7 +6465,7 @@ export default function SessionScreen() {
onBack={contextSheetView !== 'main' ? () => setContextSheetView('main') : undefined}
onClose={() => setContextSheetOpen(false)}
testID="session.contextSheet"
- title={contextSheetView === 'screenshots' ? '截图' : contextSheetView === 'goal' ? '目标模式' : '上下文'}
+ title={contextSheetView === 'screenshots' ? t('session.common.screenshot') : contextSheetView === 'goal' ? t('session.common.goalMode') : t('session.common.context')}
visible={contextSheetOpen}
>
{contextSheetView === 'main' ? (
@@ -6479,14 +6479,14 @@ export default function SessionScreen() {
selectedAssetIds={selectedMediaAssetIds}
testID="session.contextSheetPhotos"
/>
- <ContextSheetGroup label="模式">
+ <ContextSheetGroup label={t('session.common.groupMode')}>
{planModeSupported ? (
// 点击即切换计划模式并关面板(产品决策,不做开关);已开启时显示 ✓,再点退出。
<ContextSheetRow
accessibilityHint={composerSendUnavailableReason ?? undefined}
disabled={!canUseComposer || controlBusy}
icon={<ListTodo color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
- label="计划模式"
+ label={t('session.common.planMode')}
onPress={() => {
togglePlanMode(!planModeOn);
setContextSheetOpen(false);
@@ -6497,7 +6497,7 @@ export default function SessionScreen() {
) : null}
<ContextSheetRow
icon={<Target color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
- label="目标模式"
+ label={t('session.common.goalMode')}
onPress={() => setContextSheetView('goal')}
testID="session.contextSheetGoalRow"
trailing={goalStatus ? (
@@ -6510,19 +6510,19 @@ export default function SessionScreen() {
) : 'chevron'}
/>
</ContextSheetGroup>
- <ContextSheetGroup label="添加">
+ <ContextSheetGroup label={t('session.common.groupAdd')}>
<ContextSheetRow
accessibilityHint={composerSendUnavailableReason ?? undefined}
disabled={!canUseComposer}
icon={<Image color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
- label="照片"
+ label={t('session.common.photo')}
onPress={() => void addLocalImageAttachments('library')}
testID="session.contextSheetPhotoRow"
/>
<ContextSheetRow
disabled={!canUseComposer}
icon={<Scan color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
- label="截图"
+ label={t('session.common.screenshot')}
onPress={() => setContextSheetView('screenshots')}
testID="session.contextSheetScreenshotsRow"
trailing="chevron"
@@ -6531,7 +6531,7 @@ export default function SessionScreen() {
accessibilityHint={composerSendUnavailableReason ?? undefined}
disabled={!canUseComposer}
icon={<Camera color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
- label="拍照"
+ label={t('session.common.takePhoto')}
onPress={() => void addLocalImageAttachments('camera')}
testID="session.contextSheetCameraRow"
/>
@@ -6539,7 +6539,7 @@ export default function SessionScreen() {
accessibilityHint={composerSendUnavailableReason ?? undefined}
disabled={!canUseComposer}
icon={<Folder color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
- label="文件"
+ label={t('session.common.file')}
onPress={() => void addLocalFileAttachment()}
testID="session.contextSheetFileRow"
/>
@@ -6595,7 +6595,7 @@ export default function SessionScreen() {
keyboardAvoidingBehavior={nativeShellLayout.keyboardAvoidingBehavior}
loading={composerDeviceProviders.loading || modelSheetCapabilitiesLoading}
loadingHint={modelSheetCapabilitiesLoading
- ? `正在读取 ${mobileAgentLabel(modelSheetAgentKind)} 运行能力…`
+ ? t('session.screen.readingCapabilities', { agent: mobileAgentLabel(modelSheetAgentKind) })
: undefined}
modelMemory={sessionMirrorAccessors}
onChangeSelectedEffort={changeComposerSelectedEffort}
@@ -6771,7 +6771,7 @@ export default function SessionScreen() {
>
{canUseComposer && composerTrigger.kind === 'slash' ? (
<ComposerPaletteFrame
- emptyText="没有匹配的命令"
+ emptyText={t('session.common.noMatchingCommands')}
errorText={slashPaletteError}
loading={slashPaletteLoading}
maxHeight={nativeShellLayout.paletteMaxHeight}
@@ -6779,7 +6779,7 @@ export default function SessionScreen() {
>
{visibleSlashCommands.map((command) => (
<ComposerPaletteRow
- accessibilityLabel={`插入命令 ${command.name}`}
+ accessibilityLabel={t('session.common.insertCommand', { name: command.name })}
key={`${command.kind}:${command.name}`}
onPress={() => selectSlashCommand(command)}
primary={`/${command.name}`}
@@ -6798,7 +6798,7 @@ export default function SessionScreen() {
{canUseComposer && composerTrigger.kind === 'at' ? (
<ComposerPaletteFrame
- emptyText={atResourcesTruncated ? '继续输入以缩小结果' : '没有匹配的资源'}
+ emptyText={atResourcesTruncated ? t('session.common.keepTypingToNarrow') : t('session.common.noMatchingResources')}
errorText={atPaletteError}
loading={atPaletteLoading}
maxHeight={nativeShellLayout.paletteMaxHeight}
@@ -6806,7 +6806,7 @@ export default function SessionScreen() {
>
{visibleAtResources.map((item) => (
<ComposerPaletteRow
- accessibilityLabel={`插入资源 ${item.name}`}
+ accessibilityLabel={t('session.common.insertResource', { name: item.name })}
key={`${item.type}:${item.relPath}`}
onPress={() => selectAtResource(item)}
primary={item.type === 'dir' ? `${item.name}/` : item.name}
@@ -6875,7 +6875,7 @@ export default function SessionScreen() {
</View>
) : sessionOperationLayout.composerSlot === 'read-only' ? (
<View style={styles.readOnlyComposer} testID="session.collaborationReadOnlyComposer">
- <Text style={styles.collaborationTitle}>只读模式</Text>
+ <Text style={styles.collaborationTitle}>{t('session.screen.readOnlyMode')}</Text>
<Text style={styles.collaborationText}>
{sessionOperationLayout.composerDisabledReason}
</Text>
@@ -6910,12 +6910,12 @@ export default function SessionScreen() {
{(() => {
const index = inputProjection.pendingQueue
.findIndex((item) => item.clientId === queueEditing.clientId);
- return index >= 0 ? `正在编辑第 ${index + 1} 条排队消息` : '正在编辑排队消息';
+ return index >= 0 ? t('session.screen.editingQueueMessageNumbered', { index: index + 1 }) : t('session.screen.editingQueueMessage');
})()}
</Text>
<RouteActionButton
- accessibilityLabel="放弃编辑排队消息"
- accessibilityHint={sending ? '正在保存修改,完成后再操作。' : undefined}
+ accessibilityLabel={t('session.screen.discardQueueEdit')}
+ accessibilityHint={sending ? t('session.screen.savingHint') : undefined}
// 保存(updateContent RPC)在途时禁用:此刻放弃会在编辑已派发的
// 同时恢复 stash + 解锁,桌面端仍会应用修改,状态与 UI 脱节(review P2)。
disabled={sending}
@@ -6960,7 +6960,7 @@ export default function SessionScreen() {
</Text>
{canOpenVoiceSettings ? (
<RouteActionButton
- accessibilityLabel="打开麦克风权限设置"
+ accessibilityLabel={t('session.common.openMicPermission')}
hitSlop={COMPOSER_CONTROL_HIT_SLOP}
onPress={openVoiceSettings}
style={styles.voiceCancelButton}
@@ -6992,7 +6992,7 @@ export default function SessionScreen() {
compactComposer && !composerCardActive && styles.composerSurfaceCompact,
]}>
<MobileComposerInputRow
- accessibilityLabel="输入远程消息"
+ accessibilityLabel={t('session.screen.composerPlaceholder')}
accessibilityHint={composerLayout.input.disabledReason ?? undefined}
accessoryAbove={attachments.length > 0 || pendingUploads.length > 0 || pastePlaceholderCount > 0 ? renderComposerAttachmentTray() : null}
autoFocus={visualFocusComposer}
@@ -7132,6 +7132,7 @@ function SessionHeaderBar({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const overview = currentSession
? summarizeSessionOverview({
diffCount,
@@ -7209,7 +7210,7 @@ function SessionHeaderBar({
/>
))}
<SessionHeaderIconButton
- accessibilityLabel="打开会话菜单"
+ accessibilityLabel={t('session.screen.openSessionMenu')}
active={false}
disabled={!currentSession}
icon={Ellipsis}
@@ -7287,17 +7288,17 @@ function compactSessionHeaderNotice({
readOnlyReason?: string | null;
session: RemoteSession | null;
}): string | null {
- if (isDeviceAccessRevoked) return '访问权限已被被控电脑撤销';
- if (!session) return syncing ? '正在同步会话' : null;
- if (syncing) return '正在同步';
- if (pendingCount > 0) return `待处理 ${pendingCount}`;
+ if (isDeviceAccessRevoked) return i18n.t('session.screen.accessRevoked');
+ if (!session) return syncing ? i18n.t('session.screen.syncingSession') : null;
+ if (syncing) return i18n.t('session.screen.syncing');
+ if (pendingCount > 0) return i18n.t('session.screen.pendingCount', { num: pendingCount });
// readOnlyReason 现在传入的是 composer 只读 reason:worker(只读)→「只读模式」;Lead(可聊天)→ 不显示。
- if (readOnlyReason) return '只读模式';
+ if (readOnlyReason) return i18n.t('session.screen.readOnlyMode');
// 协作角色会话(Lead 等可聊天的角色)显示协作标签而非「只读模式」,标明其协作身份。
const collaborationLabel = sessionCollaborationLabel(session);
if (collaborationLabel) return collaborationLabel;
- if (session.status === 'archived') return '已归档';
- if (queuePaused) return '队列已暂停';
+ if (session.status === 'archived') return i18n.t('session.screen.archived');
+ if (queuePaused) return i18n.t('session.screen.queuePausedNotice');
return null;
}
@@ -7332,6 +7333,7 @@ function SessionSearchSheet({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const normalizedQuery = query.trim();
const hasHits = hitCount > 0;
const loadEarlierAction = buildSearchLoadEarlierAction({
@@ -7358,17 +7360,17 @@ function SessionSearchSheet({
<SheetGrabber style={styles.adhocSheetGrabber} />
<View style={styles.adhocSheetHeader}>
<View style={styles.adhocSheetHeaderText}>
- <Text style={styles.adhocSheetTitle}>搜索当前会话</Text>
+ <Text style={styles.adhocSheetTitle}>{t('session.screen.searchTitle')}</Text>
</View>
</View>
<View style={styles.searchPanel} testID="session.searchPanel">
<TextInput
- accessibilityLabel="搜索当前会话消息"
+ accessibilityLabel={t('session.screen.searchPlaceholder')}
autoCapitalize="none"
autoCorrect={false}
autoFocus={MOBILE_VISUAL_MOCK_ENABLED && visible}
onChangeText={onChangeQuery}
- placeholder="搜索当前会话消息"
+ placeholder={t('session.screen.searchPlaceholder')}
placeholderTextColor={colors.textTertiary}
style={styles.searchInput}
testID="session.searchInput"
@@ -7378,11 +7380,11 @@ function SessionSearchSheet({
<Text style={styles.searchCounter} testID="session.searchCounter">
{normalizedQuery
? hasHits ? `${activeIndex + 1}/${hitCount}` : '0/0'
- : '输入关键词'}
+ : t('session.screen.searchEnterKeyword')}
</Text>
<View style={styles.searchButtons}>
<RouteActionButton
- accessibilityLabel="上一条搜索结果"
+ accessibilityLabel={t('session.screen.searchPrevious')}
disabled={!hasHits}
onPress={() => onMove('previous')}
style={styles.searchNavButton}
@@ -7391,7 +7393,7 @@ function SessionSearchSheet({
<ChevronUp color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />
</RouteActionButton>
<RouteActionButton
- accessibilityLabel="下一条搜索结果"
+ accessibilityLabel={t('session.screen.searchNext')}
disabled={!hasHits}
onPress={() => onMove('next')}
style={styles.searchNavButton}
@@ -7406,7 +7408,7 @@ function SessionSearchSheet({
{activeHit.label}: {activeHit.preview}
</Text>
) : normalizedQuery ? (
- <Text style={styles.searchPreview} testID="session.searchPreview">没有匹配的消息</Text>
+ <Text style={styles.searchPreview} testID="session.searchPreview">{t('session.screen.searchNoMatch')}</Text>
) : null}
{loadEarlierAction.visible ? (
<RouteActionButton
@@ -7434,12 +7436,13 @@ function SessionSyncPlaceholder({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
return (
<View style={styles.sessionSyncPlaceholder} testID="session.unsyncedState">
<View style={styles.sessionSyncRow}>
- <Text style={styles.sessionSyncTitle}>{loading ? '正在同步会话' : '等待会话同步'}</Text>
+ <Text style={styles.sessionSyncTitle}>{loading ? t('session.screen.syncingSession') : t('session.screen.awaitingSync')}</Text>
<RouteActionButton
- accessibilityLabel="重新同步远程会话"
+ accessibilityLabel={t('session.screen.resync')}
disabled={loading}
onPress={onSync}
style={styles.sessionSyncButton}
@@ -7464,14 +7467,15 @@ function MessageHistoryToggle({
onToggle(): void;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
return (
<RouteActionButton
- accessibilityLabel={expanded ? '收起历史消息' : '查看历史消息'}
+ accessibilityLabel={expanded ? t('session.screen.collapseHistory') : t('session.screen.expandHistory')}
onPress={onToggle}
style={styles.historyToggle}
testID="session.pendingHistoryToggle"
>
- <Text style={styles.historyToggleTitle}>{expanded ? '收起历史消息' : '查看历史消息'}</Text>
+ <Text style={styles.historyToggleTitle}>{expanded ? t('session.screen.collapseHistory') : t('session.screen.expandHistory')}</Text>
</RouteActionButton>
);
}
@@ -7783,13 +7787,14 @@ function ComposerPaletteFrame({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const hasRows = Array.isArray(children) ? children.length > 0 : !!children;
return (
<View style={[styles.palettePanel, { maxHeight }]} testID={testID}>
{loading ? (
<View style={styles.paletteStatusRow}>
<ActivityIndicator color={colors.textSecondary} />
- <Text style={styles.paletteStatusText}>读取中</Text>
+ <Text style={styles.paletteStatusText}>{t('session.common.paletteLoading')}</Text>
</View>
) : errorText ? (
<Text style={styles.paletteStatusText}>{errorText}</Text>
diff --git a/apps/mobile/app/sessions/new.tsx b/apps/mobile/app/sessions/new.tsx
index ba0c1eef10..bbd7e82d74 100644
--- a/apps/mobile/app/sessions/new.tsx
+++ b/apps/mobile/app/sessions/new.tsx
@@ -148,6 +148,8 @@ import {
type NewSessionStoredPreferences,
} from '@/session/newSession';
import { newSessionText } from '@/session/newSessionMessages';
+import { i18n } from '@/i18n';
+import { useTranslation } from 'react-i18next';
import {
createNewSessionId,
drainStashedNewSessionDraft,
@@ -183,9 +185,9 @@ import { useComposerCardTransition } from '@/session/useComposerCardTransition';
import { useComposerResize } from '@/session/useComposerResize';
import { useMobileKeyboardState } from '@/session/useMobileKeyboardState';
import {
- MOBILE_VOICE_MIC_PERMISSION_ERROR,
- MOBILE_VOICE_REALTIME_AUDIO_UNAVAILABLE_ERROR,
isMobileVoiceMicPermissionError,
+ mobileVoiceMicPermissionError,
+ mobileVoiceRealtimeAudioUnavailableError,
type MobileVoiceState,
} from '@/session/mobileVoiceInput';
import {
@@ -251,6 +253,7 @@ const NEW_SESSION_SCREEN_TOP_PADDING = Platform.OS === 'android' ? 0 : spacing.x
export default function NewRemoteSessionScreen() {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
// Dev-only:把构建信息从全局浮层挪到这里的顶部展示(试 Fast Refresh)。
const buildLabel = __DEV__
? formatMobileBuildLabel(normalizeBuildInfo({
@@ -309,7 +312,7 @@ export default function NewRemoteSessionScreen() {
() => deviceOptions.find((option) => option.deviceId === selectedDeviceId) ?? routeDeviceFallback,
[deviceOptions, routeDeviceFallback, selectedDeviceId],
);
- const selectedDeviceLabel = selectedDeviceOption?.name || selectedDeviceName || selectedDeviceId || '选择电脑';
+ const selectedDeviceLabel = selectedDeviceOption?.name || selectedDeviceName || selectedDeviceId || t('session.new.selectDevice');
const maker = useMobileMakerTransport(selectedDeviceId);
const sessions = useRemoteSessions();
const recentWorkspaces = useMemo(
@@ -717,11 +720,11 @@ export default function NewRemoteSessionScreen() {
// project 模式但没目录→「选择项目」(而非泛化的「选择工作区」)。
const workspaceLabel = useMemo(
() => draft.workspaceKind === 'dialogue'
- ? '对话'
+ ? t('session.new.workspaceDialogue')
: draft.workingDir.trim()
? formatWorkingDirLabel(draft.workingDir)
- : '选择项目',
- [draft.workspaceKind, draft.workingDir],
+ : t('session.new.selectProject'),
+ [draft.workspaceKind, draft.workingDir, t],
);
const WorkspaceIcon = draft.workspaceKind === 'dialogue' ? MessageCircle : Folder;
const agentLabel = draft.agentKind === 'codex' ? 'Codex' : 'Claude';
@@ -799,7 +802,7 @@ export default function NewRemoteSessionScreen() {
const composerInputScrollEnabled = composerResize.scrollEnabled;
const voiceDraftShowsListeningPrompt = voiceIsListening && draft.firstMessage.length === 0;
// 对齐桌面新建会话输入框默认占位(newChat.chatInput.defaultPlaceholder 的 zh-CN 值)。
- const composerPlaceholder = '今天我们做点什么呢~';
+ const composerPlaceholder = t('session.new.composerPlaceholder');
const composerListeningPlaceholder = buildSessionComposerLayout({
attachmentBusy: false,
attachmentCount: attachments.length + pendingUploads.length,
@@ -1010,11 +1013,11 @@ export default function NewRemoteSessionScreen() {
if (!isAgentCapabilitiesGenerationCurrent(selectedDeviceId, generation)) return;
if (!normalized && cachedCapabilities) {
// 缓存已画时保留旧能力表,只报错。
- setCapabilitiesError('远程能力返回格式不支持');
+ setCapabilitiesError(t('session.common.capabilitiesUnsupported'));
return;
}
setCapabilities(normalized);
- setCapabilitiesError(normalized ? null : '远程能力返回格式不支持');
+ setCapabilitiesError(normalized ? null : t('session.common.capabilitiesUnsupported'));
})
.catch((err) => {
if (capabilitiesSeqRef.current !== seq) return;
@@ -1362,12 +1365,12 @@ export default function NewRemoteSessionScreen() {
try {
if (!selectedDeviceId) {
setVoiceState('error');
- setVoiceError('请选择电脑后再使用语音输入。');
+ setVoiceError(t('session.new.voiceSelectDeviceFirst'));
return;
}
if (!isMobileRealtimeAudioAvailable()) {
setVoiceState('error');
- setVoiceError(MOBILE_VOICE_REALTIME_AUDIO_UNAVAILABLE_ERROR);
+ setVoiceError(mobileVoiceRealtimeAudioUnavailableError());
return;
}
startupSeq = voiceStartupSeqRef.current + 1;
@@ -1380,7 +1383,7 @@ export default function NewRemoteSessionScreen() {
voiceStopInFlightRef.current = false;
voiceRecordingActiveRef.current = false;
setVoiceState('error');
- setVoiceError(MOBILE_VOICE_MIC_PERMISSION_ERROR);
+ setVoiceError(mobileVoiceMicPermissionError());
return;
}
await setAudioModeAsync({
@@ -1602,7 +1605,7 @@ export default function NewRemoteSessionScreen() {
);
const renderAttachmentToggleButton = () => (
<Pressable
- accessibilityLabel="打开上下文面板"
+ accessibilityLabel={t('session.common.openContextPanel')}
accessibilityRole="button"
disabled={creating}
hitSlop={10}
@@ -1628,7 +1631,7 @@ export default function NewRemoteSessionScreen() {
);
const renderCreateButton = () => (
<Pressable
- accessibilityLabel={creating ? '正在创建会话' : '创建会话并发送首条消息'}
+ accessibilityLabel={creating ? t('session.new.creatingSession') : t('session.new.createAndSend')}
accessibilityHint={createValidation ?? undefined}
accessibilityRole="button"
accessibilityState={{ busy: creating || voiceIsProcessing || undefined, disabled: !canCreate || undefined }}
@@ -1665,7 +1668,7 @@ export default function NewRemoteSessionScreen() {
/>
) : null}
<Pressable
- accessibilityLabel={`模型:${runtimeSummary.modelSummary}`}
+ accessibilityLabel={t('session.new.modelAccessibility', { model: runtimeSummary.modelSummary })}
accessibilityRole="button"
accessibilityState={{ expanded: modelSheetOpen || undefined }}
hitSlop={10}
@@ -1746,7 +1749,7 @@ export default function NewRemoteSessionScreen() {
const renderComposerVoiceButton = (buttonStyle?: StyleProp<ViewStyle>) => (
<Pressable
- accessibilityLabel={voiceIsListening ? '停止录音' : '语音输入'}
+ accessibilityLabel={voiceIsListening ? t('session.common.voiceStopRecording') : t('session.new.voiceInput')}
accessibilityRole="button"
accessibilityState={{ busy: voiceIsProcessing || undefined, disabled: creating || undefined }}
disabled={creating || voiceIsProcessing}
@@ -1916,7 +1919,7 @@ export default function NewRemoteSessionScreen() {
// 窗口(原生还在读剪贴板)任务未入队也未进 pendingUploads state,不计入的话
// 这里会放行超额选图,占位兑现时轮到粘贴图自己撞上限被丢(review P2)。
if (attachments.length + pendingMediaAssets.length + getPendingUploadCount() >= MOBILE_MAX_ATTACHMENTS) {
- setAttachmentError(`最多添加 ${MOBILE_MAX_ATTACHMENTS} 个附件。`);
+ setAttachmentError(t('session.common.maxAttachments', { max: MOBILE_MAX_ATTACHMENTS }));
return;
}
setAttachmentError(null);
@@ -2064,7 +2067,7 @@ export default function NewRemoteSessionScreen() {
|| voiceIsProcessing
) return;
if (!selectedDeviceId) {
- setError('请选择电脑。');
+ setError(t('session.new.selectDeviceError'));
return;
}
creatingRef.current = true;
@@ -2205,15 +2208,15 @@ export default function NewRemoteSessionScreen() {
const createGoalSession = useCallback(async (input: { objective: string; limits?: MobileGoalLimitsInput }) => {
if (creatingRef.current || goalBusy) return;
if (!selectedDeviceId) {
- setGoalError('请选择电脑。');
+ setGoalError(t('session.new.selectDeviceError'));
return;
}
if (draft.workspaceKind === 'project' && !draft.workingDir.trim()) {
- setGoalError('请输入电脑端项目路径。');
+ setGoalError(t('session.new.enterProjectPath'));
return;
}
if (!draft.model.trim()) {
- setGoalError('请输入模型。');
+ setGoalError(t('session.new.enterModel'));
return;
}
creatingRef.current = true;
@@ -2254,7 +2257,7 @@ export default function NewRemoteSessionScreen() {
const created = await maker.createSession(createOpts);
const result = normalizeCreateSessionResult(created);
if (!result) {
- throw new Error('被控端没有返回新会话 id。');
+ throw new Error(t('session.new.noSessionIdReturned'));
}
await subscribe(`session:${result.sessionId}`, selectedDeviceId, ['sessions', `session:${result.sessionId}`]).catch(() => undefined);
let session: RemoteSession;
@@ -2289,7 +2292,7 @@ export default function NewRemoteSessionScreen() {
setCreating(false);
setGoalBusy(false);
}
- }, [agentAuthVerdict, auth, confirmAgentUnauthenticated, draft, goalBusy, maker, openLink, patchDraft, router, selectedDeviceId, selectedDeviceName, subscribe, waitForPendingUploads]);
+ }, [agentAuthVerdict, auth, confirmAgentUnauthenticated, draft, goalBusy, maker, openLink, patchDraft, router, selectedDeviceId, selectedDeviceName, subscribe, t, waitForPendingUploads]);
return (
<SafeAreaView style={styles.safeArea} testID="newSession.screen">
@@ -2317,7 +2320,7 @@ export default function NewRemoteSessionScreen() {
<View style={styles.selectorStack}>
<View style={styles.deviceSelectorWrap}>
<Pressable
- accessibilityLabel="选择被控电脑"
+ accessibilityLabel={t('session.new.selectControlledDevice')}
accessibilityRole="button"
accessibilityState={{
disabled: deviceSelectorDisabled || undefined,
@@ -2345,7 +2348,7 @@ export default function NewRemoteSessionScreen() {
const selected = option.deviceId === selectedDeviceId;
return (
<Pressable
- accessibilityLabel={`选择电脑 ${option.name || option.deviceId}`}
+ accessibilityLabel={t('session.new.selectDeviceNamed', { name: option.name || option.deviceId })}
accessibilityRole="button"
key={option.deviceId}
onPress={() => selectDevice(option)}
@@ -2371,7 +2374,7 @@ export default function NewRemoteSessionScreen() {
</View>
<View style={styles.agentSelectorWrap}>
<Pressable
- accessibilityLabel="选择 Agent"
+ accessibilityLabel={t('session.new.selectAgent')}
accessibilityRole="button"
accessibilityState={{ expanded: agentPickerOpen || undefined }}
disabled={creating}
@@ -2394,7 +2397,7 @@ export default function NewRemoteSessionScreen() {
const selected = draft.agentKind === option.kind;
return (
<Pressable
- accessibilityLabel={`切换到 ${option.label}`}
+ accessibilityLabel={t('session.new.switchToAgent', { label: option.label })}
accessibilityRole="button"
accessibilityState={{ selected }}
disabled={creating}
@@ -2419,7 +2422,7 @@ export default function NewRemoteSessionScreen() {
</View>
<View style={styles.workspaceSelectorWrap}>
<Pressable
- accessibilityLabel="选择工作区"
+ accessibilityLabel={t('session.new.selectWorkspace')}
accessibilityRole="button"
accessibilityState={{ expanded: workspacePickerOpen || undefined }}
disabled={creating}
@@ -2439,7 +2442,7 @@ export default function NewRemoteSessionScreen() {
{workspacePickerOpen ? (
<View style={styles.workspacePickerPanel} testID="newSession.workspacePickerPanel">
<Pressable
- accessibilityLabel="对话(不绑定项目)"
+ accessibilityLabel={t('session.new.dialogueNoProject')}
accessibilityRole="button"
accessibilityState={{ selected: draft.workspaceKind === 'dialogue' }}
onPress={selectDialogueWorkspace}
@@ -2447,7 +2450,7 @@ export default function NewRemoteSessionScreen() {
testID="newSession.workspaceDialogueOption"
>
<MessageCircle color={colors.textSecondary} size={iconSize.action} strokeWidth={iconStroke.regular} />
- <Text style={styles.workspaceOptionText} numberOfLines={1}>对话</Text>
+ <Text style={styles.workspaceOptionText} numberOfLines={1}>{t('session.new.workspaceDialogue')}</Text>
{draft.workspaceKind === 'dialogue' ? (
<Check color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.medium} />
) : null}
@@ -2464,7 +2467,7 @@ export default function NewRemoteSessionScreen() {
&& draft.workingDir.trim() === workspace.workingDir;
return (
<Pressable
- accessibilityLabel={`选择项目 ${workspace.title}`}
+ accessibilityLabel={t('session.new.selectProjectNamed', { title: workspace.title })}
accessibilityRole="button"
accessibilityState={{ selected }}
disabled={creating}
@@ -2486,11 +2489,11 @@ export default function NewRemoteSessionScreen() {
})}
</ScrollView>
) : (
- <Text style={styles.workspaceEmptyText}>暂无项目</Text>
+ <Text style={styles.workspaceEmptyText}>{t('session.new.noProjects')}</Text>
)}
<View style={styles.workspaceDivider} />
<Pressable
- accessibilityLabel="选择其他项目文件夹"
+ accessibilityLabel={t('session.new.chooseOtherFolder')}
accessibilityRole="button"
disabled={creating}
onPress={openProjectBrowse}
@@ -2498,7 +2501,7 @@ export default function NewRemoteSessionScreen() {
testID="newSession.workspaceBrowseOption"
>
<FolderPlus color={colors.textSecondary} size={iconSize.action} strokeWidth={iconStroke.regular} />
- <Text style={styles.workspaceOptionText} numberOfLines={1}>选择其他项目文件夹</Text>
+ <Text style={styles.workspaceOptionText} numberOfLines={1}>{t('session.new.chooseOtherFolder')}</Text>
</Pressable>
</View>
) : null}
@@ -2509,7 +2512,7 @@ export default function NewRemoteSessionScreen() {
<View style={styles.browsePanel} testID="newSession.remoteBrowsePanel">
<View style={styles.browseHeader}>
<Text style={styles.browsePath} numberOfLines={1} testID="newSession.remoteBrowseCurrentPath">
- {browsePath || '正在读取远程目录...'}
+ {browsePath || t('session.new.readingRemoteDir')}
</Text>
{browseLoading ? <ActivityIndicator color={colors.textSecondary} size="small" /> : null}
</View>
@@ -2522,7 +2525,7 @@ export default function NewRemoteSessionScreen() {
>
{recentWorkspaces.map((workspace) => (
<Pressable
- accessibilityLabel={`选择项目 ${workspace.title}`}
+ accessibilityLabel={t('session.new.selectProjectNamed', { title: workspace.title })}
accessibilityRole="button"
disabled={creating}
key={workspace.workingDir}
@@ -2537,7 +2540,7 @@ export default function NewRemoteSessionScreen() {
) : null}
<View style={styles.browseActions} testID="newSession.remoteBrowseActions">
<Pressable
- accessibilityLabel="返回上级目录"
+ accessibilityLabel={t('session.new.goParentDir')}
accessibilityRole="button"
disabled={!browseParent || browseLoading}
onPress={() => browseParent && void loadBrowsePath(browseParent)}
@@ -2548,10 +2551,10 @@ export default function NewRemoteSessionScreen() {
]}
testID="newSession.remoteBrowseParentButton"
>
- <Text style={styles.browseActionText}>上级</Text>
+ <Text style={styles.browseActionText}>{t('session.new.parentDir')}</Text>
</Pressable>
<Pressable
- accessibilityLabel="使用当前远程目录"
+ accessibilityLabel={t('session.new.useCurrentRemoteDir')}
accessibilityRole="button"
disabled={!browsePath || browseLoading}
onPress={() => browsePath && selectWorkingDir(browsePath)}
@@ -2562,7 +2565,7 @@ export default function NewRemoteSessionScreen() {
]}
testID="newSession.remoteBrowseSelectCurrent"
>
- <Text style={styles.browseActionText}>使用当前</Text>
+ <Text style={styles.browseActionText}>{t('session.new.useCurrent')}</Text>
</Pressable>
</View>
<Pressable
@@ -2626,14 +2629,14 @@ export default function NewRemoteSessionScreen() {
<View style={styles.composerCard} testID="newSession.composer">
{composerTrigger.kind === 'slash' ? (
<NewComposerPaletteFrame
- emptyText="没有匹配的命令"
+ emptyText={t('session.common.noMatchingCommands')}
errorText={slashPaletteError}
loading={slashPaletteLoading}
testID="newSession.slashPalette"
>
{visibleSlashCommands.map((command) => (
<NewComposerPaletteRow
- accessibilityLabel={`插入命令 ${command.name}`}
+ accessibilityLabel={t('session.common.insertCommand', { name: command.name })}
key={`${command.kind}:${command.name}`}
onPress={() => selectSlashCommand(command)}
primary={`/${command.name}`}
@@ -2645,14 +2648,14 @@ export default function NewRemoteSessionScreen() {
) : null}
{composerTrigger.kind === 'at' ? (
<NewComposerPaletteFrame
- emptyText={atResourcesTruncated ? '继续输入以缩小结果' : '没有匹配的资源'}
+ emptyText={atResourcesTruncated ? t('session.common.keepTypingToNarrow') : t('session.common.noMatchingResources')}
errorText={atPaletteError}
loading={atPaletteLoading}
testID="newSession.atPalette"
>
{visibleAtResources.map((item) => (
<NewComposerPaletteRow
- accessibilityLabel={`插入资源 ${item.name}`}
+ accessibilityLabel={t('session.common.insertResource', { name: item.name })}
key={`${item.type}:${item.relPath}`}
onPress={() => selectAtResource(item)}
primary={item.type === 'dir' ? `${item.name}/` : item.name}
@@ -2674,7 +2677,7 @@ export default function NewRemoteSessionScreen() {
</Text>
{canOpenVoiceSettings ? (
<Pressable
- accessibilityLabel="打开麦克风权限设置"
+ accessibilityLabel={t('session.common.openMicPermission')}
accessibilityRole="button"
hitSlop={10}
onPress={openVoiceSettings}
@@ -2688,7 +2691,7 @@ export default function NewRemoteSessionScreen() {
) : null}
<View style={styles.composerToolbarWrap}>
<MobileComposerInputRow
- accessibilityLabel="输入首条消息"
+ accessibilityLabel={t('session.new.firstMessagePlaceholder')}
accessoryAbove={attachments.length > 0 || pendingUploads.length > 0 || pastePlaceholderCount > 0 ? renderComposerAttachmentTray() : null}
autoFocus={visualFocusComposer}
cardActive={composerCardActive}
@@ -2737,7 +2740,7 @@ export default function NewRemoteSessionScreen() {
footer={contextSheetView !== 'goal' && pendingMediaAssets.length > 0 ? (
<ContextSheetFooterButton
disabled={creating}
- label={`加入对话(${pendingMediaAssets.length} 张)`}
+ label={t('session.common.joinConversation', { num: pendingMediaAssets.length })}
onPress={() => void commitPendingMediaAssets()}
testID="newSession.contextSheetCommitMedia"
/>
@@ -2746,7 +2749,7 @@ export default function NewRemoteSessionScreen() {
onBack={contextSheetView !== 'main' ? () => setContextSheetView('main') : undefined}
onClose={() => setContextSheetOpen(false)}
testID="newSession.contextSheet"
- title={contextSheetView === 'screenshots' ? '截图' : contextSheetView === 'goal' ? '目标模式' : '上下文'}
+ title={contextSheetView === 'screenshots' ? t('session.common.screenshot') : contextSheetView === 'goal' ? t('session.common.goalMode') : t('session.common.context')}
visible={contextSheetOpen}
>
{contextSheetView === 'main' ? (
@@ -2760,13 +2763,13 @@ export default function NewRemoteSessionScreen() {
selectedAssetIds={selectedMediaAssetIds}
testID="newSession.contextSheetPhotos"
/>
- <ContextSheetGroup label="模式">
+ <ContextSheetGroup label={t('session.common.groupMode')}>
{planModeSupported ? (
// 点击即切换计划模式并关面板(产品决策,不做开关);已开启时显示 ✓,再点退出。
<ContextSheetRow
disabled={creating}
icon={<ListTodo color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
- label="计划模式"
+ label={t('session.common.planMode')}
onPress={() => {
togglePlanMode(!planModeOn);
setContextSheetOpen(false);
@@ -2778,24 +2781,24 @@ export default function NewRemoteSessionScreen() {
<ContextSheetRow
disabled={creating}
icon={<Target color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
- label="目标模式"
+ label={t('session.common.goalMode')}
onPress={() => setContextSheetView('goal')}
testID="newSession.contextSheetGoalRow"
trailing="chevron"
/>
</ContextSheetGroup>
- <ContextSheetGroup label="添加">
+ <ContextSheetGroup label={t('session.common.groupAdd')}>
<ContextSheetRow
disabled={creating}
icon={<Image color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
- label="照片"
+ label={t('session.common.photo')}
onPress={() => void addLocalImageAttachments('library')}
testID="newSession.contextSheetPhotoRow"
/>
<ContextSheetRow
disabled={creating}
icon={<Scan color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
- label="截图"
+ label={t('session.common.screenshot')}
onPress={() => setContextSheetView('screenshots')}
testID="newSession.contextSheetScreenshotsRow"
trailing="chevron"
@@ -2803,14 +2806,14 @@ export default function NewRemoteSessionScreen() {
<ContextSheetRow
disabled={creating}
icon={<Camera color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
- label="拍照"
+ label={t('session.common.takePhoto')}
onPress={() => void addLocalImageAttachments('camera')}
testID="newSession.contextSheetCameraRow"
/>
<ContextSheetRow
disabled={creating}
icon={<Folder color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
- label="文件"
+ label={t('session.common.file')}
onPress={() => void addLocalFileAttachment()}
testID="newSession.contextSheetFileRow"
/>
@@ -2849,7 +2852,7 @@ export default function NewRemoteSessionScreen() {
apiKeyStatus={deviceApiKeyStatus}
capabilities={capabilities}
disabled={creating}
- emptyHint={selectedDeviceId ? '暂无可用模型' : '请先选择电脑'}
+ emptyHint={selectedDeviceId ? t('session.new.noModelsAvailable') : t('session.new.selectDeviceFirst')}
flatOptions={runtimeOptions.modelOptions}
modelVisibilityOverrides={deviceProviders.modelVisibilityOverrides}
keyboardAvoidingBehavior={Platform.OS === 'ios' ? 'padding' : 'height'}
@@ -2914,10 +2917,11 @@ function RemoteDirectoryRow({
onSelect(): void;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
return (
<View style={styles.browseRow} testID="newSession.remoteBrowseEntry">
<Pressable
- accessibilityLabel={`进入目录 ${entry.name}`}
+ accessibilityLabel={t('session.new.enterDir', { name: entry.name })}
accessibilityRole="button"
disabled={disabled}
onPress={onEnter}
@@ -2929,14 +2933,14 @@ function RemoteDirectoryRow({
</Text>
</Pressable>
<Pressable
- accessibilityLabel={`选择目录 ${entry.name}`}
+ accessibilityLabel={t('session.new.selectDir', { name: entry.name })}
accessibilityRole="button"
disabled={disabled}
onPress={onSelect}
style={({ pressed }) => [styles.browseSelectButton, disabled && styles.disabled, pressed && styles.pressed]}
testID="newSession.remoteBrowseSelectEntry"
>
- <Text style={styles.browseActionText}>选择</Text>
+ <Text style={styles.browseActionText}>{t('session.new.select')}</Text>
</Pressable>
</View>
);
@@ -2957,13 +2961,14 @@ function NewComposerPaletteFrame({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const hasRows = Array.isArray(children) ? children.length > 0 : !!children;
return (
<View style={styles.palettePanel} testID={testID}>
{loading ? (
<View style={styles.paletteStatusRow}>
<ActivityIndicator color={colors.textSecondary} />
- <Text style={styles.paletteStatusText}>读取中</Text>
+ <Text style={styles.paletteStatusText}>{t('session.common.paletteLoading')}</Text>
</View>
) : errorText ? (
<Text style={styles.paletteStatusText}>{errorText}</Text>
@@ -3029,7 +3034,7 @@ function choiceLabel(options: readonly { id: string; label: string }[], value: s
function formatWorkingDirLabel(workingDir: string): string {
const trimmed = workingDir.trim();
- if (!trimmed) return '选择工作区';
+ if (!trimmed) return i18n.t('session.new.selectWorkspace');
const normalized = stripTrailingPathSeparators(trimmed);
const segments = normalized.split(/[\\/]/).filter(Boolean);
return segments.at(-1) ?? normalized;
diff --git a/apps/mobile/app/settings.tsx b/apps/mobile/app/settings.tsx
index de2ab6cddd..8e6ce32b04 100644
--- a/apps/mobile/app/settings.tsx
+++ b/apps/mobile/app/settings.tsx
@@ -16,10 +16,13 @@ import {
} from 'react-native';
import { Text, TextInput } from '@/components/AppText';
import { SafeAreaView } from 'react-native-safe-area-context';
-import { ChevronDown, ChevronRight, X } from 'lucide-react-native';
+import { Check, ChevronDown, ChevronRight, X } from 'lucide-react-native';
+import { useTranslation } from 'react-i18next';
import type { DeviceView } from '@cindy/device-link';
import { useAuth } from '@/auth/AuthContext';
import { loginText } from '@/auth/loginMessages';
+import { SUPPORTED_LOCALES, type LocalePreference } from '@/i18n';
+import { useLocale } from '@/i18n/useLocale';
import { goBackGuarded } from '@/utils/backGuard';
import { configureCollapseAnimation } from '@/utils/collapseAnimation';
import {
@@ -56,6 +59,8 @@ type SelfDeviceNameQueuedWrite =
| { kind: 'rename'; name: string; options: SelfDeviceNameSaveOptions }
| { kind: 'reset' };
const SETTINGS_DEVICE_TIMEOUT_MS = 12_000;
+// 显示语言选项:「跟随系统」在前,4 种具体语言在后(与 desktop LanguageSection 同序)。
+const LANGUAGE_OPTIONS: readonly LocalePreference[] = ['system', ...SUPPORTED_LOCALES];
const PRIVACY_POLICY_URL = AUTH_REGION === 'cn'
? 'https://cindy.cn/privacy/'
: 'https://cindy.app/privacy/';
@@ -65,6 +70,8 @@ export default function SettingsScreen() {
const { colors } = useTheme();
const router = useRouter();
const auth = useAuth();
+ const { t } = useTranslation();
+ const { locale, setLocale } = useLocale();
const { status } = useDeviceLink();
const [copiedRowId, setCopiedRowId] = useState<string | null>(null);
const [loggingOut, setLoggingOut] = useState(false);
@@ -106,15 +113,17 @@ export default function SettingsScreen() {
userId: auth.user?.id,
userName: auth.user?.name,
}),
- [auth.deviceId, auth.user?.email, auth.user?.id, auth.user?.name, deviceName, status],
+ // t 依赖:buildMobileSettingsOverview 内部走 i18n.t,语言切换时(t 身份变化)重建展示模型。
+ [auth.deviceId, auth.user?.email, auth.user?.id, auth.user?.name, deviceName, status, t],
);
const appVersion = Constants.expoConfig?.version ?? '0.0.0';
const updatesEnabled = Updates.isEnabled;
// 当前运行的 OTA bundle 信息(只读),折进「调试」分组,用于核验热更是否生效。
const { currentlyRunning } = useUpdates();
- const updateInfoRows = useMemo(() => buildMobileUpdateInfoRows(currentlyRunning), [currentlyRunning]);
- const otaVersion = useMemo(() => currentMobileOtaVersion(currentlyRunning), [currentlyRunning]);
+ // t 依赖同 overview:行构造走 i18n.t,语言切换时重算。
+ const updateInfoRows = useMemo(() => buildMobileUpdateInfoRows(currentlyRunning), [currentlyRunning, t]);
+ const otaVersion = useMemo(() => currentMobileOtaVersion(currentlyRunning), [currentlyRunning, t]);
const canaryChannel = useCanaryChannelGate(IS_OTA_SELFHOST);
// 自建变体的统一入口先查整包;无整包时再由 checkForUpdate 继续查 JS OTA。
const { checkNow: checkBundleUpdate } = useBundleUpdatePrompt({
@@ -199,16 +208,16 @@ export default function SettingsScreen() {
});
if (outcome.kind === 'bundle-update-available') {
setUpdatePhase('idle');
- setUpdateMessage('发现整包更新');
+ setUpdateMessage(t('settings.version.bundleUpdateFound'));
} else if (outcome.kind === 'up-to-date') {
setUpdatePhase('uptodate');
- setUpdateMessage('已是最新版本');
+ setUpdateMessage(t('settings.version.upToDate'));
} else if (outcome.kind === 'ota-unavailable') {
setUpdatePhase('uptodate');
- setUpdateMessage('整包已是最新,当前版本不支持热更新');
+ setUpdateMessage(t('settings.version.bundleUpToDateNoOta'));
} else if (outcome.kind === 'reloading') {
setUpdatePhase('downloading');
- setUpdateMessage('更新已下载,正在重启');
+ setUpdateMessage(t('settings.version.downloadedRestarting'));
} else if (outcome.kind === 'busy') {
setUpdatePhase('idle');
} else {
@@ -218,7 +227,7 @@ export default function SettingsScreen() {
} finally {
updateCheckInFlightRef.current = false;
}
- }, [checkBundleUpdate, updateCheckEnabled, updatesEnabled]);
+ }, [checkBundleUpdate, t, updateCheckEnabled, updatesEnabled]);
const updateSelfDeviceNameDraft = useCallback((value: string) => {
selfDeviceNameDraftRef.current = value;
@@ -229,11 +238,11 @@ export default function SettingsScreen() {
const saveSelfDeviceNameDraft = useCallback(async (rawName: string, options: SelfDeviceNameSaveOptions = {}) => {
const name = rawName.trim();
if (name.length === 0) {
- setSelfDeviceNameMessage('设备名称不能为空。');
+ setSelfDeviceNameMessage(t('settings.deviceNameEditor.emptyError'));
return;
}
if (!auth.deviceId) {
- setSelfDeviceNameMessage('设备还在初始化,请稍后再试。');
+ setSelfDeviceNameMessage(t('settings.deviceNameEditor.deviceInitializing'));
return;
}
if (selfDeviceNameWriteInFlightRef.current) {
@@ -251,7 +260,7 @@ export default function SettingsScreen() {
return;
}
selfDeviceNameQueuedWriteRef.current = { kind: 'rename', name, options };
- setSelfDeviceNameMessage('保存中…');
+ setSelfDeviceNameMessage(t('settings.deviceNameEditor.saving'));
return;
}
if (name === deviceName.trim()) {
@@ -264,7 +273,7 @@ export default function SettingsScreen() {
selfDeviceNameWriteInFlightRef.current = true;
selfDeviceNameCurrentWriteRef.current = { kind: 'rename', name, options };
setSelfDeviceNameSaving(true);
- setSelfDeviceNameMessage('保存中…');
+ setSelfDeviceNameMessage(t('settings.deviceNameEditor.saving'));
try {
const res = await auth.apiFetch<{ deviceId: string; name: string }>(
`/api/device-link/devices/${encodeURIComponent(auth.deviceId)}`,
@@ -278,7 +287,7 @@ export default function SettingsScreen() {
const draftStillCurrent = options.acceptClosedDraft === true || selfDeviceNameDraftRef.current.trim() === name;
if (selfDeviceNameSaveSeqRef.current === seq && draftStillCurrent) {
setSelfDeviceName(res.name);
- setSelfDeviceNameMessage('已保存。');
+ setSelfDeviceNameMessage(t('settings.deviceNameEditor.saved'));
}
} catch (err) {
if (selfDeviceNameSaveSeqRef.current === seq) setSelfDeviceNameMessage(formatRemoteError(err));
@@ -290,16 +299,16 @@ export default function SettingsScreen() {
selfDeviceNameRunQueuedWriteRef.current();
}
}
- }, [auth, deviceName, systemDeviceName]);
+ }, [auth, deviceName, systemDeviceName, t]);
const resetSelfDeviceName = useCallback(async () => {
if (!auth.deviceId) {
- setSelfDeviceNameMessage('设备还在初始化,请稍后再试。');
+ setSelfDeviceNameMessage(t('settings.deviceNameEditor.deviceInitializing'));
return;
}
if (selfDeviceNameWriteInFlightRef.current) {
selfDeviceNameQueuedWriteRef.current = { kind: 'reset' };
- setSelfDeviceNameMessage('正在恢复默认名称…');
+ setSelfDeviceNameMessage(t('settings.deviceNameEditor.restoringDefault'));
return;
}
@@ -308,7 +317,7 @@ export default function SettingsScreen() {
selfDeviceNameWriteInFlightRef.current = true;
selfDeviceNameCurrentWriteRef.current = { kind: 'reset' };
setSelfDeviceNameSaving(true);
- setSelfDeviceNameMessage('正在恢复默认名称…');
+ setSelfDeviceNameMessage(t('settings.deviceNameEditor.restoringDefault'));
try {
const res = await auth.apiFetch<{ deviceId: string; name: string; manualName?: string | null }>(
`/api/device-link/devices/${encodeURIComponent(auth.deviceId)}`,
@@ -322,7 +331,7 @@ export default function SettingsScreen() {
if (selfDeviceNameSaveSeqRef.current === seq) {
setSelfDeviceName(res.name);
updateSelfDeviceNameDraft(res.name);
- setSelfDeviceNameMessage('已恢复默认名称。');
+ setSelfDeviceNameMessage(t('settings.deviceNameEditor.restoredDefault'));
}
} catch (err) {
if (selfDeviceNameSaveSeqRef.current === seq) setSelfDeviceNameMessage(formatRemoteError(err));
@@ -334,7 +343,7 @@ export default function SettingsScreen() {
selfDeviceNameRunQueuedWriteRef.current();
}
}
- }, [auth, updateSelfDeviceNameDraft]);
+ }, [auth, t, updateSelfDeviceNameDraft]);
selfDeviceNameRunQueuedWriteRef.current = () => {
const queued = selfDeviceNameQueuedWriteRef.current;
@@ -351,7 +360,7 @@ export default function SettingsScreen() {
if (!selfDeviceNameEditing) return;
const name = selfDeviceNameDraft.trim();
if (name.length === 0) {
- setSelfDeviceNameMessage('设备名称不能为空。');
+ setSelfDeviceNameMessage(t('settings.deviceNameEditor.emptyError'));
return;
}
if (name === deviceName.trim()) {
@@ -362,7 +371,7 @@ export default function SettingsScreen() {
void saveSelfDeviceNameDraft(name);
}, 650);
return () => clearTimeout(timer);
- }, [deviceName, saveSelfDeviceNameDraft, selfDeviceNameDraft, selfDeviceNameEditing, selfDeviceNameSaving]);
+ }, [deviceName, saveSelfDeviceNameDraft, selfDeviceNameDraft, selfDeviceNameEditing, selfDeviceNameSaving, t]);
const openSelfDeviceNameEditor = useCallback(() => {
updateSelfDeviceNameDraft(deviceName);
@@ -426,13 +435,13 @@ export default function SettingsScreen() {
await syncPushRegistration({ enabled: false, apiFetch: auth.apiFetch });
} catch {
await markPendingUnregister().catch(() => undefined);
- setPushMessage('已关闭。当前网络下注销未完成,将在下次联网时自动补上。');
+ setPushMessage(t('settings.notifications.unregisterQueued'));
}
return;
}
const result = await syncPushRegistration({ enabled: true, apiFetch: auth.apiFetch });
if (result === 'permission-denied') {
- setPushMessage('系统通知权限未开启。请到 iOS「设置 → 通知 → Cindy」允许通知后重试。');
+ setPushMessage(t('settings.notifications.permissionDenied'));
return; // 权限被拒:开关保持关闭,不落盘
}
await writePushEnabled(true);
@@ -442,7 +451,7 @@ export default function SettingsScreen() {
} finally {
setPushBusy(false);
}
- }, [auth.apiFetch, pushBusy, pushEnabled]);
+ }, [auth.apiFetch, pushBusy, pushEnabled, t]);
const toggleDebug = useCallback(() => {
configureCollapseAnimation();
@@ -451,9 +460,9 @@ export default function SettingsScreen() {
const avatarLabel = (overview.header.name.trim()[0] ?? '?').toUpperCase();
const updateBusy = updatePhase === 'checking' || updatePhase === 'downloading';
- const updateButtonLabel = updatePhase === 'checking' ? '检查中'
- : updatePhase === 'downloading' ? '更新中'
- : '检查更新';
+ const updateButtonLabel = updatePhase === 'checking' ? t('settings.version.checking')
+ : updatePhase === 'downloading' ? t('settings.version.updating')
+ : t('settings.version.checkAction');
if (selfDeviceNameEditing) {
return (
@@ -472,7 +481,7 @@ export default function SettingsScreen() {
<ScreenHeader
backTestID="settings.backButton"
onBack={() => goBackGuarded(router)}
- title="设置"
+ title={t('settings.title')}
titleTestID="settings.title"
/>
@@ -501,28 +510,28 @@ export default function SettingsScreen() {
</View>
{/* 版本:只保留统一检查入口,自建线严格先查整包、无整包再查热更。 */}
- <SettingsGroup title="版本">
+ <SettingsGroup title={t('settings.version.sectionTitle')}>
{[
<View key="version" style={styles.versionRow} testID="settings.version">
<View style={styles.versionTexts}>
- <Text style={styles.rowLabel}>当前版本</Text>
- <Text style={styles.versionValue} numberOfLines={1}>整包版本 {appVersion}</Text>
- <Text style={styles.rowDetail} numberOfLines={1} testID="settings.otaVersion">热更版本 {otaVersion}</Text>
+ <Text style={styles.rowLabel}>{t('settings.version.currentLabel')}</Text>
+ <Text style={styles.versionValue} numberOfLines={1}>{t('settings.version.bundleVersion', { version: appVersion })}</Text>
+ <Text style={styles.rowDetail} numberOfLines={1} testID="settings.otaVersion">{t('settings.version.otaVersion', { version: otaVersion })}</Text>
{/* 二级版本号:自建线打包所配对的桌面产品线版本(0.0.x);仅自建线且已注入时显示 */}
{IS_OTA_SELFHOST && DESKTOP_PACKAGE_VERSION ? (
- <Text style={styles.rowDetail} numberOfLines={1} testID="settings.desktopVersion">桌面版 {DESKTOP_PACKAGE_VERSION}</Text>
+ <Text style={styles.rowDetail} numberOfLines={1} testID="settings.desktopVersion">{t('settings.version.desktopVersion', { version: DESKTOP_PACKAGE_VERSION })}</Text>
) : null}
{updateMessage ? (
<Text style={styles.rowDetail} numberOfLines={2} testID="settings.updateMessage">{updateMessage}</Text>
) : !REVIEW_MODE && !updatesEnabled ? (
- <Text style={styles.rowDetail} numberOfLines={1}>开发版,热更不可用</Text>
+ <Text style={styles.rowDetail} numberOfLines={1}>{t('settings.version.devNoOta')}</Text>
) : null}
</View>
{/* 审核模式(清单 review 命中当前二进制版本):隐藏检查更新入口,版本号照常展示 */}
{!REVIEW_MODE ? (
<MainWindowActionButton
action={{
- accessibilityLabel: updateBusy ? '正在检查更新' : '检查更新',
+ accessibilityLabel: updateBusy ? t('settings.version.checkingAccessibility') : t('settings.version.checkAction'),
busy: updateBusy,
disabled: !updateCheckEnabled,
label: updateButtonLabel,
@@ -540,20 +549,20 @@ export default function SettingsScreen() {
{/* 通知:任务完成推送(仅 iOS;Android 待 FCM/厂商通道) */}
{isPushSupported() ? (
- <SettingsGroup title="通知">
+ <SettingsGroup title={t('settings.notifications.sectionTitle')}>
{[
<View key="push-toggle" style={styles.switchRow} testID="settings.pushToggleRow">
<View style={styles.switchTexts}>
- <Text style={styles.rowLabel}>任务完成通知</Text>
+ <Text style={styles.rowLabel}>{t('settings.notifications.taskDone')}</Text>
<Text style={styles.hint}>
- 电脑上的任务完成、出错或需要你回复时,推送到这台手机;完成或需要回复时附带最新回复内容。
+ {t('settings.notifications.taskDoneHint')}
</Text>
{pushMessage ? (
<Text style={styles.hint} testID="settings.pushMessage">{pushMessage}</Text>
) : null}
</View>
<Switch
- accessibilityLabel="任务完成通知"
+ accessibilityLabel={t('settings.notifications.taskDone')}
disabled={pushBusy}
onValueChange={() => void togglePushNotifications()}
testID="settings.pushToggle"
@@ -565,13 +574,29 @@ export default function SettingsScreen() {
</SettingsGroup>
) : null}
+ {/* 显示语言:默认跟随系统,手动选择即持久化 override(恢复跟随系统 = 清除 override) */}
+ <SettingsGroup
+ footer={t('settings.language.hint')}
+ title={t('settings.language.title')}
+ >
+ {LANGUAGE_OPTIONS.map((option) => (
+ <LanguageOptionRow
+ key={option}
+ label={t(`settings.language.options.${option}`)}
+ onPress={() => setLocale(option)}
+ selected={locale === option}
+ testID={`settings.language.${option}`}
+ />
+ ))}
+ </SettingsGroup>
+
{/* 关于这台手机 */}
{aboutSection ? (
<SettingsGroup title={aboutSection.title}>
{aboutSection.rows.map((row) => (
row.id === 'about.deviceName' ? (
<ActionInfoRow
- accessibilityLabel={`修改${row.label}`}
+ accessibilityLabel={t('settings.about.editAccessibility', { label: row.label })}
detail={selfDeviceNameMessage ?? row.detail}
key={row.id}
label={row.label}
@@ -611,20 +636,20 @@ export default function SettingsScreen() {
) : null}
{/* 法律信息:隐私政策始终显示;App 备案号仅国内版显示。 */}
- <SettingsGroup title="备案信息">
+ <SettingsGroup title={t('settings.legal.sectionTitle')}>
<ActionInfoRow
- accessibilityLabel="打开隐私政策"
+ accessibilityLabel={t('settings.legal.openPrivacyPolicy')}
accessibilityRole="link"
key="privacy-policy"
- label="隐私政策"
+ label={t('settings.legal.privacyPolicy')}
onPress={openPrivacyPolicy}
testID="settings.privacyPolicy"
- value="查看"
+ value={t('settings.legal.view')}
/>
{AUTH_REGION === 'cn' ? (
<InfoRow
key="app-filing-number"
- label="App 备案号"
+ label={t('settings.legal.appFilingNumber')}
testID="settings.appFilingNumber"
value="沪ICP备11033765号-89A"
/>
@@ -634,15 +659,15 @@ export default function SettingsScreen() {
{/* 账号操作:退出保持明确;注销账号仅保留低调的次要文字入口。 */}
<View style={styles.dangerArea} testID="settings.accountActions">
<Text style={styles.dangerHint}>
- 退出只会清除这台手机上的登录态和本地远程镜像,不会影响电脑端会话。
+ {t('settings.account.logoutHint')}
</Text>
<MainWindowActionGroup
dangerActions={[
{
- accessibilityLabel: loggingOut ? '正在退出登录' : '退出登录',
+ accessibilityLabel: loggingOut ? t('settings.account.loggingOutAccessibility') : t('settings.account.logout'),
busy: loggingOut,
disabled: loggingOut,
- label: loggingOut ? '退出中' : '退出登录',
+ label: loggingOut ? t('settings.account.loggingOut') : t('settings.account.logout'),
onPress: () => void logout(),
testID: 'settings.logoutButton',
tone: 'danger',
@@ -682,14 +707,17 @@ function groupChevron(expanded: boolean, colors: ThemeColors): ReactNode {
/**
* iOS 风格分组:组标题在外侧 gutter,组内一块统一卡片,行间用 inset 分隔线。
* 标题可点(onToggle)时承担折叠开关。rows 为空则不渲染卡片(折叠态)。
+ * footer 为卡片下方 gutter 里的弱说明文字(iOS 分组 footer 惯例)。
*/
function SettingsGroup({
children,
+ footer,
onToggle,
title,
titleAccessory,
}: {
children: ReactNode;
+ footer?: string;
onToggle?: () => void;
title: string;
titleAccessory?: ReactNode;
@@ -725,10 +753,46 @@ function SettingsGroup({
))}
</View>
) : null}
+ {footer && rows.length > 0 ? (
+ <Text style={styles.groupFooter}>{footer}</Text>
+ ) : null}
</View>
);
}
+/** 显示语言单选行:标签左、选中勾右;selected 即当前偏好(含「跟随系统」)。 */
+function LanguageOptionRow({
+ label,
+ onPress,
+ selected,
+ testID,
+}: {
+ label: string;
+ onPress(): void;
+ selected: boolean;
+ testID?: string;
+}) {
+ const styles = useThemedStyles(makeStyles);
+ const { colors } = useTheme();
+ return (
+ <Pressable
+ accessibilityLabel={label}
+ accessibilityRole="radio"
+ accessibilityState={{ checked: selected }}
+ onPress={onPress}
+ style={({ pressed }) => [styles.row, pressed && styles.pressed]}
+ testID={testID}
+ >
+ <View style={styles.rowLine}>
+ <Text style={styles.languageOptionLabel}>{label}</Text>
+ {selected ? (
+ <Check color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />
+ ) : null}
+ </View>
+ </Pressable>
+ );
+}
+
/** 单行信息:标签左、值右;可选 detail 另起一行(较弱)。 */
function InfoRow({
detail,
@@ -806,12 +870,13 @@ function RenameSelfDeviceScreen({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
return (
<SafeAreaView style={styles.safeArea} testID="settings.renameSelfDevice.screen">
<ScreenHeader
backTestID="settings.renameSelfDevice.backButton"
onBack={onDone}
- title="设备名称"
+ title={t('settings.deviceNameEditor.screenTitle')}
/>
<View style={styles.nameEditorContent}>
<View style={styles.nameEditorInputRow}>
@@ -820,7 +885,7 @@ function RenameSelfDeviceScreen({
maxLength={64}
onChangeText={onChangeDraft}
onSubmitEditing={onDone}
- placeholder="本机名称"
+ placeholder={t('settings.deviceNameEditor.placeholder')}
placeholderTextColor={colors.textTertiary}
returnKeyType="done"
selectTextOnFocus
@@ -830,7 +895,7 @@ function RenameSelfDeviceScreen({
/>
{draft.length > 0 ? (
<Pressable
- accessibilityLabel="恢复默认本机名称"
+ accessibilityLabel={t('settings.deviceNameEditor.resetAccessibility')}
accessibilityRole="button"
hitSlop={8}
onPress={onResetDefault}
@@ -858,6 +923,7 @@ function CopyRow({
row: MobileSettingsRow;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
return (
<View style={styles.copyRow} testID={`settings.row.${row.id}`}>
<View style={styles.copyText}>
@@ -869,8 +935,8 @@ function CopyRow({
// (调用方虽已先判断,但组件自身也要自洽)。
<MainWindowActionButton
action={{
- accessibilityLabel: `复制${row.label}`,
- label: copied ? '已复制' : '复制',
+ accessibilityLabel: t('settings.copyRow.accessibility', { label: row.label }),
+ label: copied ? t('settings.copyRow.done') : t('settings.copyRow.action'),
onPress: () => onCopy(row),
testID: `settings.copy.${row.id}`,
}}
@@ -926,6 +992,12 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({
paddingHorizontal: spacing.md,
},
groupTitle: { color: colors.textTertiary, flex: 1, fontSize: typeScale.footnote, fontWeight: fontWeight.medium },
+ groupFooter: {
+ color: colors.textTertiary,
+ fontSize: typeScale.caption,
+ lineHeight: lineHeight.caption,
+ paddingHorizontal: spacing.md,
+ },
card: {
backgroundColor: colors.surfaceElevated,
borderColor: colors.border,
@@ -940,6 +1012,7 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({
rowLabel: { color: colors.textSecondary, flexShrink: 0, fontSize: typeScale.code },
rowValue: { color: colors.textPrimary, flex: 1, fontSize: typeScale.code, textAlign: 'right' },
rowDetail: { color: colors.textTertiary, fontSize: typeScale.caption, lineHeight: lineHeight.caption },
+ languageOptionLabel: { color: colors.textPrimary, flex: 1, fontSize: typeScale.code },
switchRow: {
alignItems: 'center',
flexDirection: 'row',
diff --git a/apps/mobile/package.json b/apps/mobile/package.json
index ca63c392db..58732ccb88 100644
--- a/apps/mobile/package.json
+++ b/apps/mobile/package.json
@@ -44,10 +44,12 @@
"expo-status-bar": "~56.0.4",
"expo-updates": "~56.0.19",
"expo-web-browser": "^56.0.5",
+ "i18next": "^26.3.6",
"lucide-react-native": "0.468.0",
"pako": "^2.1.0",
"react": "19.2.3",
"react-dom": "19.2.3",
+ "react-i18next": "^17.0.10",
"react-native": "0.85.3",
"react-native-gesture-handler": "3.0.2",
"react-native-reanimated": "4.3.1",
diff --git a/apps/mobile/src/__tests__/agentAuthGate.test.ts b/apps/mobile/src/__tests__/agentAuthGate.test.ts
index 7262d2ef46..aa5256ac6e 100644
--- a/apps/mobile/src/__tests__/agentAuthGate.test.ts
+++ b/apps/mobile/src/__tests__/agentAuthGate.test.ts
@@ -1,7 +1,13 @@
-import { describe, expect, it } from 'vitest';
+import { beforeAll, describe, expect, it } from 'vitest';
import type { ProviderView } from '@cindy/model-providers/registry';
+import { i18n } from '@/i18n';
import { agentAuthGateHint, agentAuthGateVerdict } from '@/session/agentAuthGate';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
function provider(patch: Partial<ProviderView> & Pick<ProviderView, 'id' | 'agents' | 'connected'>): ProviderView {
return {
name: patch.id,
diff --git a/apps/mobile/src/__tests__/apiClient.test.ts b/apps/mobile/src/__tests__/apiClient.test.ts
index 2e4693e42c..1f092bb023 100644
--- a/apps/mobile/src/__tests__/apiClient.test.ts
+++ b/apps/mobile/src/__tests__/apiClient.test.ts
@@ -1,10 +1,16 @@
-import { afterEach, describe, expect, it, vi } from 'vitest';
+import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest';
+import { i18n } from '@/i18n';
import {
ApiError,
apiFetchRaw,
registerAccountUnavailableHandler,
} from '@/api/client';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
describe('apiFetchRaw', () => {
afterEach(() => {
vi.useRealTimers();
diff --git a/apps/mobile/src/__tests__/expo-localization.mock.ts b/apps/mobile/src/__tests__/expo-localization.mock.ts
new file mode 100644
index 0000000000..3e701979bf
--- /dev/null
+++ b/apps/mobile/src/__tests__/expo-localization.mock.ts
@@ -0,0 +1,6 @@
+// vitest 全局兜底 mock:expo-localization 真模块会拖 react-native 依赖链
+// (Flow 语法,node 环境解析失败)。需要控制语言的测试仍用 vi.mock 按用例覆盖,
+// vi.mock 优先于本 alias。默认给 en-US,与「未设置 override 兜底 en」语义一致。
+export function getLocales(): Array<{ languageTag: string; languageCode: string }> {
+ return [{ languageTag: 'en-US', languageCode: 'en' }];
+}
diff --git a/apps/mobile/src/__tests__/filesConnectionBanner.test.ts b/apps/mobile/src/__tests__/filesConnectionBanner.test.ts
index d845cb5cff..0abc048a36 100644
--- a/apps/mobile/src/__tests__/filesConnectionBanner.test.ts
+++ b/apps/mobile/src/__tests__/filesConnectionBanner.test.ts
@@ -19,6 +19,8 @@ describe('mobile files page connection banner noise budget', () => {
it('keeps the footer realtime-sync line as the only resident connection hint', () => {
const source = readFileSync(resolve(process.cwd(), 'app/files/[sessionId].tsx'), 'utf8');
- expect(source).toContain("已连接 · 实时同步");
+ // 文案已 i18n 化:常驻 footer 提示改由 catalog key 渲染(footerOnline / footerConnecting)。
+ expect(source).toContain("t('files.browser.footerOnline')");
+ expect(source).toContain("t('files.browser.footerConnecting')");
});
});
diff --git a/apps/mobile/src/__tests__/homeDesktopFirst.test.ts b/apps/mobile/src/__tests__/homeDesktopFirst.test.ts
index be7a99379e..b976607f01 100644
--- a/apps/mobile/src/__tests__/homeDesktopFirst.test.ts
+++ b/apps/mobile/src/__tests__/homeDesktopFirst.test.ts
@@ -1,6 +1,7 @@
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { describe, expect, it } from 'vitest';
+import { i18n } from '@/i18n';
function readSource(relativePath: string): string {
return readFileSync(resolve(process.cwd(), relativePath), 'utf8').replace(/\r\n/g, '\n');
@@ -51,14 +52,14 @@ describe('mobile home desktop-first surface', () => {
expect(source).not.toContain('width: 50');
expect(source).toContain('RefreshCw');
expect(source).toContain('homeConnectionTitle');
- expect(source).toContain("if (status === 'connecting') return '连接中';");
- expect(source).toContain("if (status === 'stopped') return '连接断开';");
+ expect(source).toContain("if (status === 'connecting') return t('devices.list.connection.connecting');");
+ expect(source).toContain("if (status === 'stopped') return t('devices.list.connection.disconnected');");
expect(source).toContain('styles.connectionIconButton');
expect(source).toContain('const [deviceMenuOpen, setDeviceMenuOpen]');
expect(source).toContain('const [groupByProject, setGroupByProject]');
expect(source).toContain('testID="home.deviceMenu"');
- expect(source).toContain('label="所有对话"');
- expect(source).toContain('label="按项目分组"');
+ expect(source).toContain("label={t('devices.list.allConversations')}");
+ expect(source).toContain("label={t('devices.list.menu.groupByProject')}");
// 注:首页分区构造逻辑(buildMixedHomeRows / buildGroupedHomeRows / buildHomeSections)
// 已抽到 @/session/homeSections,并由 homeSections.test.ts 做行为测试,这里不再做源码字符串断言。
expect(source).toContain('styles.sessionListRow');
@@ -354,10 +355,10 @@ describe('mobile home desktop-first surface', () => {
// 首次 loadHome 落地前(含失败态)FAB 只认 live 设备:首页列表缓存画出的会话会合成出
// 「可用」的 primaryDevice,但缓存设备不能当 live 设备开新会话(settle 后回归 primaryDevice 语义)。
expect(source).toContain('const newSessionDisabled = !home.primaryDevice || (!initialHomeSettled && !hasOpenableLiveDevice);');
- expect(source).toContain("const emptyStateTitle = initialHomeError ? '同步失败' : home.emptyTitle;");
+ expect(source).toContain("const emptyStateTitle = initialHomeError ? t('devices.list.syncFailed') : home.emptyTitle;");
expect(source).toContain("testID={initialHomeError ? 'home.syncError' : 'home.empty'}");
expect(source).toContain('testID="home.loading"');
- expect(source).toContain('正在读取可控制电脑');
+ expect(source).toContain("t('devices.list.loading')");
});
it('renders the remote-access onboarding guide for the no-device empty state', () => {
@@ -375,18 +376,20 @@ describe('mobile home desktop-first surface', () => {
expect(source).toContain('{showRemoteGuide ? null : (');
const guideSource = readSource('src/components/RemoteAccessGuide.tsx');
+ // 文案已 i18n 化,断言改查 zh-CN catalog(单一事实源);源码只保留结构/交互契约。
+ const t = i18n.getFixedT('zh-CN');
// 步骤三的路径和开关名必须与桌面端设置页一致,避免用户按指引找不到开关。
- expect(guideSource).toContain('在电脑上安装并打开 Cindy');
- expect(guideSource).toContain('用与手机相同的账号登录');
- expect(guideSource).toContain('「设置 → 远程连接」');
- expect(guideSource).toContain('允许同账号设备控制本机');
+ expect(t('deviceLink.connectStep1')).toBe('在电脑上安装并打开 Cindy');
+ expect(t('deviceLink.connectStep2')).toBe('用与手机相同的账号登录');
+ expect(t('deviceLink.connectStep3')).toContain('「设置 → 远程连接」');
+ expect(t('deviceLink.connectStep3')).toContain('允许同账号设备控制本机');
// 分场景交互:离线/开关未开可手动重新检查,被撤销访问有重试 CTA(Lock 图标对齐设备列表语义)。
expect(guideSource).toContain("reason === 'firstRun'");
expect(guideSource).toContain('home.remoteGuide.recheck');
expect(guideSource).toContain('home.remoteGuide.retryAccess');
expect(guideSource).toContain('<Lock');
// 未来形态预告:云端 Cindy 上线后手机版可脱离电脑直接使用。
- expect(guideSource).toContain('云端 Cindy 筹备中');
- expect(guideSource).toContain('上线后无需电脑,手机版即可直接使用。');
+ expect(t('deviceLink.cloudTeaserTitle')).toBe('云端 Cindy 筹备中');
+ expect(t('deviceLink.cloudTeaserCopy')).toBe('上线后无需电脑,手机版即可直接使用。');
});
});
diff --git a/apps/mobile/src/__tests__/homeSections.test.ts b/apps/mobile/src/__tests__/homeSections.test.ts
index f401aa5344..4e42e172cc 100644
--- a/apps/mobile/src/__tests__/homeSections.test.ts
+++ b/apps/mobile/src/__tests__/homeSections.test.ts
@@ -1,8 +1,14 @@
-import { describe, expect, it } from 'vitest';
+import { beforeAll, describe, expect, it } from 'vitest';
+import { i18n } from '@/i18n';
import { buildGroupedHomeRows, buildHomeSections, buildMixedHomeRows, homeRowBefore } from '@/session/homeSections';
import type { MobileHomePresentation, MobileHomeProjectGroup } from '@/session/mobileHome';
import type { RemoteSessionListItem } from '@/session/sessionList';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
// 最小 fixture:buildHomeSections / rows 只读取下面这几个字段,其余字段对本测试无关,
// 用 cast 避免构造完整 RemoteSessionListItem / MobileHomeProjectGroup。
function listItem(id: string, lastActivityAt: string): RemoteSessionListItem {
diff --git a/apps/mobile/src/__tests__/i18nCatalogParity.test.ts b/apps/mobile/src/__tests__/i18nCatalogParity.test.ts
new file mode 100644
index 0000000000..9e7dd26eb4
--- /dev/null
+++ b/apps/mobile/src/__tests__/i18nCatalogParity.test.ts
@@ -0,0 +1,69 @@
+/**
+ * i18next catalog 平价门:4 个 locale 的组装后 catalog(locales/<locale>/index.ts)
+ * key 结构必须完全一致,叶子非空,{{占位符}} 集合逐 key 一致。
+ * 与根 scripts/check-i18n.mjs(desktop 专用)对应的 mobile 侧强制门,
+ * 随 pnpm test:unit 阻断。直接从组装模块取数,新增区域文件自动纳入校验。
+ */
+
+import { describe, expect, it } from 'vitest';
+
+import enCommon from '@/i18n/locales/en';
+import zhCNCommon from '@/i18n/locales/zh-CN';
+import jaCommon from '@/i18n/locales/ja';
+import koCommon from '@/i18n/locales/ko';
+
+const CATALOGS: Record<string, unknown> = {
+ en: enCommon,
+ 'zh-CN': zhCNCommon,
+ ja: jaCommon,
+ ko: koCommon,
+};
+
+/** 展平嵌套 catalog 为 dot-path → 叶子字符串。遇到非 string 叶子直接失败。 */
+function flatten(node: unknown, prefix: string, out: Map<string, string>): void {
+ expect(node, `${prefix || '<root>'} 必须是对象或字符串`).toBeTruthy();
+ if (typeof node === 'string') {
+ out.set(prefix, node);
+ return;
+ }
+ expect(typeof node, `${prefix || '<root>'} 类型异常`).toBe('object');
+ for (const [key, value] of Object.entries(node as Record<string, unknown>)) {
+ flatten(value, prefix ? `${prefix}.${key}` : key, out);
+ }
+}
+
+function flatCatalog(locale: string): Map<string, string> {
+ const out = new Map<string, string>();
+ flatten(CATALOGS[locale], '', out);
+ return out;
+}
+
+function placeholdersOf(value: string): string[] {
+ return [...value.matchAll(/\{\{\s*([\w.]+)\s*\}\}/g)].map((m) => m[1]).sort();
+}
+
+describe('mobile i18n catalog parity', () => {
+ const locales = Object.keys(CATALOGS);
+ const flat = new Map(locales.map((locale) => [locale, flatCatalog(locale)]));
+ const enKeys = [...flat.get('en')!.keys()].sort();
+
+ it.each(locales)('%s 与 en 的 key 全集一致', (locale) => {
+ expect([...flat.get(locale)!.keys()].sort()).toEqual(enKeys);
+ });
+
+ it.each(locales)('%s 所有叶子非空且不是待翻译占位', (locale) => {
+ for (const [key, value] of flat.get(locale)!) {
+ expect(value.trim(), `${locale}:${key} 不能为空`).not.toBe('');
+ expect(value, `${locale}:${key} 不能残留 TODO 占位`).not.toMatch(/TODO|待翻译|待校对/);
+ }
+ });
+
+ it.each(locales)('%s 的 {{占位符}} 集合与 en 逐 key 一致', (locale) => {
+ const en = flat.get('en')!;
+ for (const [key, value] of flat.get(locale)!) {
+ expect(placeholdersOf(value), `${locale}:${key} 占位符不一致`).toEqual(
+ placeholdersOf(en.get(key)!),
+ );
+ }
+ });
+});
diff --git a/apps/mobile/src/__tests__/interactionModel.test.ts b/apps/mobile/src/__tests__/interactionModel.test.ts
index 8ecbc1205e..0eb327f0a8 100644
--- a/apps/mobile/src/__tests__/interactionModel.test.ts
+++ b/apps/mobile/src/__tests__/interactionModel.test.ts
@@ -1,6 +1,7 @@
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
-import { describe, expect, it } from 'vitest';
+import { beforeAll, describe, expect, it } from 'vitest';
+import { i18n } from '@/i18n';
import * as mobileInteractionModel from '@/session/interactionModel';
import {
buildAskQuestionProgressSummary,
@@ -33,6 +34,12 @@ import {
} from '@/session/interactionModel';
import type { PendingInteraction } from '@/session/types';
+// buildMobilePermissionCardState 已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦
+// (全局 mock 默认 en-US)。共享层(@cindy/maker-shared/interaction)的中文直出不受影响。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
describe('interactionModel', () => {
it('projects resolve button state for mobile pending interaction actions', () => {
expect(buildInteractionResolveActionPresentation({
@@ -193,7 +200,7 @@ describe('interactionModel', () => {
expect('buildIssueConfirmDecision' in mobileInteractionModel).toBe(false);
expect('normalizeIssueConfirm' in mobileInteractionModel).toBe(false);
expect(interactionPanelSource).toContain("if (kind === 'issue_confirm')");
- expect(interactionPanelSource).toContain('Issue 提交确认只在电脑端处理。请回到桌面端确认或取消提交。');
+ expect(interactionPanelSource).toContain("t('interaction.panel.issueConfirmUnsupported')");
expect(interactionPanelSource).not.toContain('buildIssueConfirmReviewPresentation');
});
@@ -203,7 +210,7 @@ describe('interactionModel', () => {
const readOnlyEnd = interactionPanelSource.indexOf('return (', interactionPanelSource.indexOf('}', readOnlyStart));
const readOnlySource = interactionPanelSource.slice(readOnlyStart, readOnlyEnd);
- expect(readOnlySource).toContain('电脑端正在等待确认');
+ expect(readOnlySource).toContain("t('interaction.panel.readOnlyTitle')");
expect(readOnlySource).toContain('{readOnlyReason}');
expect(readOnlySource).not.toContain('当前请求类型');
expect(readOnlySource).not.toContain('不会回传协作编排决定');
diff --git a/apps/mobile/src/__tests__/languagePreferenceStore.test.ts b/apps/mobile/src/__tests__/languagePreferenceStore.test.ts
new file mode 100644
index 0000000000..577a2f7f94
--- /dev/null
+++ b/apps/mobile/src/__tests__/languagePreferenceStore.test.ts
@@ -0,0 +1,50 @@
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+
+const store = vi.hoisted(() => new Map<string, string>());
+
+vi.mock('@react-native-async-storage/async-storage', () => ({
+ default: {
+ getItem: vi.fn(async (key: string) => store.get(key) ?? null),
+ setItem: vi.fn(async (key: string, value: string) => {
+ store.set(key, value);
+ }),
+ removeItem: vi.fn(async (key: string) => {
+ store.delete(key);
+ }),
+ },
+}));
+
+import {
+ __testing,
+ readLanguagePreference,
+ saveLanguagePreference,
+} from '@/i18n/languagePreferenceStore';
+
+describe('languagePreferenceStore', () => {
+ beforeEach(() => {
+ store.clear();
+ vi.clearAllMocks();
+ });
+
+ it('未存储任何值时读出 system(跟随系统)', async () => {
+ await expect(readLanguagePreference()).resolves.toBe('system');
+ });
+
+ it('保存具体语言后读出该语言', async () => {
+ await saveLanguagePreference('ja');
+ await expect(readLanguagePreference()).resolves.toBe('ja');
+ expect(store.get(__testing.storageKey)).toBe('ja');
+ });
+
+ it('保存 system 即删除 override(默认 + override 模型)', async () => {
+ await saveLanguagePreference('ko');
+ await saveLanguagePreference('system');
+ expect(store.has(__testing.storageKey)).toBe(false);
+ await expect(readLanguagePreference()).resolves.toBe('system');
+ });
+
+ it('存储里出现非法值时回退 system', async () => {
+ store.set(__testing.storageKey, 'fr');
+ await expect(readLanguagePreference()).resolves.toBe('system');
+ });
+});
diff --git a/apps/mobile/src/__tests__/messageActions.test.ts b/apps/mobile/src/__tests__/messageActions.test.ts
index 40a15820c7..95ae2ac398 100644
--- a/apps/mobile/src/__tests__/messageActions.test.ts
+++ b/apps/mobile/src/__tests__/messageActions.test.ts
@@ -1,4 +1,5 @@
-import { describe, expect, it } from 'vitest';
+import { beforeAll, describe, expect, it } from 'vitest';
+import { i18n } from '@/i18n';
import {
buildMobileMessageControlItems,
buildMobileMessageCopyText,
@@ -9,6 +10,11 @@ import {
} from '@/session/messageActions';
import type { NormalizedRemoteMessage } from '@/session/messageNormalize';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
describe('messageActions', () => {
it('builds completed-message controls in stable desktop-compatible order', () => {
expect(buildMobileMessageControlItems({
diff --git a/apps/mobile/src/__tests__/messageMarkdown.test.ts b/apps/mobile/src/__tests__/messageMarkdown.test.ts
index bfe0b5c7ff..bbc0afb55d 100644
--- a/apps/mobile/src/__tests__/messageMarkdown.test.ts
+++ b/apps/mobile/src/__tests__/messageMarkdown.test.ts
@@ -1,4 +1,5 @@
-import { describe, expect, it } from 'vitest';
+import { beforeAll, describe, expect, it } from 'vitest';
+import { i18n } from '@/i18n';
import { PR_WATCH_EXPANDED_BLANK_FIXTURE } from '@/__tests__/fixtures/prWatchExpandedBlank';
import {
collectMobileMarkdownImages,
@@ -11,6 +12,11 @@ import {
groupMobileMarkdownSelectableBlocks,
} from '@/session/messageMarkdown';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
describe('messageMarkdown', () => {
it('parses the reported PR-watch long message without creating an oversized inline image', () => {
const blocks = parseMobileMarkdown(PR_WATCH_EXPANDED_BLANK_FIXTURE);
diff --git a/apps/mobile/src/__tests__/messagePayload.test.ts b/apps/mobile/src/__tests__/messagePayload.test.ts
index aa4a4f930d..89f915aaa5 100644
--- a/apps/mobile/src/__tests__/messagePayload.test.ts
+++ b/apps/mobile/src/__tests__/messagePayload.test.ts
@@ -1,4 +1,5 @@
-import { describe, expect, it } from 'vitest';
+import { beforeAll, describe, expect, it } from 'vitest';
+import { i18n } from '@/i18n';
import {
buildAttachmentPayload,
buildDiffPayload,
@@ -17,6 +18,11 @@ import {
} from '@/session/messagePayload';
import type { NormalizedRemoteMessage } from '@/session/messageNormalize';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
describe('messagePayload', () => {
it('formats full diff payloads without losing later segments', () => {
const diff = {
diff --git a/apps/mobile/src/__tests__/mobileAttachmentSha256.test.ts b/apps/mobile/src/__tests__/mobileAttachmentSha256.test.ts
index 221749c213..462756fa84 100644
--- a/apps/mobile/src/__tests__/mobileAttachmentSha256.test.ts
+++ b/apps/mobile/src/__tests__/mobileAttachmentSha256.test.ts
@@ -1,10 +1,16 @@
-import { describe, expect, it, vi } from 'vitest';
+import { beforeAll, describe, expect, it, vi } from 'vitest';
+import { i18n } from '@/i18n';
import {
sha256MobileAttachmentBody,
sha256MobileAttachmentFile,
} from '@/session/mobileAttachmentSha256';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
const ABC_SHA256 = 'ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad';
describe('mobile attachment SHA-256', () => {
diff --git a/apps/mobile/src/__tests__/mobileAttachmentUpload.test.ts b/apps/mobile/src/__tests__/mobileAttachmentUpload.test.ts
index 03581075c0..3a893fdcf7 100644
--- a/apps/mobile/src/__tests__/mobileAttachmentUpload.test.ts
+++ b/apps/mobile/src/__tests__/mobileAttachmentUpload.test.ts
@@ -1,6 +1,7 @@
-import { describe, expect, it, vi } from 'vitest';
+import { beforeAll, describe, expect, it, vi } from 'vitest';
import { apiFetchRaw } from '@/api/client';
import { DEVICE_LINK_API_BASE_URL } from '@/config/env';
+import { i18n } from '@/i18n';
import { buildAttachmentOssRef, parseAttachmentOssRef } from '@/session/attachmentOssRef';
import {
discardMobileUploadedAttachment,
@@ -11,6 +12,11 @@ import {
uploadMobileAttachmentFromFile,
} from '@/session/mobileAttachmentUpload';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
const readFileChunk = vi.fn(async (_uri: string, _position: number, length: number) =>
Buffer.alloc(length, 0x78).toString('base64'),
);
diff --git a/apps/mobile/src/__tests__/mobileCindyVoiceSession.test.ts b/apps/mobile/src/__tests__/mobileCindyVoiceSession.test.ts
index 0dc2199daa..308d1d120c 100644
--- a/apps/mobile/src/__tests__/mobileCindyVoiceSession.test.ts
+++ b/apps/mobile/src/__tests__/mobileCindyVoiceSession.test.ts
@@ -1,4 +1,4 @@
-import { describe, expect, it, vi } from 'vitest';
+import { beforeAll, describe, expect, it, vi } from 'vitest';
vi.mock('expo-constants', () => ({
default: {
@@ -16,12 +16,18 @@ vi.mock('@/auth/secureStorage', () => ({
}));
import { ApiError } from '@/api/client';
+import { i18n } from '@/i18n';
import {
CINDY_MANAGED_REFINER_PROVIDER,
createMobileCindyVoiceCredential,
MobileCindyVoiceRunContext,
} from '@/session/mobileCindyVoiceSession';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
function sessionResponse(overrides: Partial<{
sessionId: string;
ticket: string;
diff --git a/apps/mobile/src/__tests__/mobileImageAttachment.test.ts b/apps/mobile/src/__tests__/mobileImageAttachment.test.ts
index bbb7e6e100..6d08ff0bf2 100644
--- a/apps/mobile/src/__tests__/mobileImageAttachment.test.ts
+++ b/apps/mobile/src/__tests__/mobileImageAttachment.test.ts
@@ -1,10 +1,16 @@
-import { describe, expect, it } from 'vitest';
+import { beforeAll, describe, expect, it } from 'vitest';
+import { i18n } from '@/i18n';
import { MOBILE_MAX_ATTACHMENT_BYTES } from '@/session/attachments';
import {
assertMobileImageSize,
buildMobileImageAttachmentCandidate,
} from '@/session/mobileImageAttachment';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
describe('mobileImageAttachment', () => {
it('uses the picker filename, mime type, and size when available', () => {
expect(buildMobileImageAttachmentCandidate({
diff --git a/apps/mobile/src/__tests__/mobileLocalAttachmentUpload.test.ts b/apps/mobile/src/__tests__/mobileLocalAttachmentUpload.test.ts
index 3c5a197bb6..c6c130de6a 100644
--- a/apps/mobile/src/__tests__/mobileLocalAttachmentUpload.test.ts
+++ b/apps/mobile/src/__tests__/mobileLocalAttachmentUpload.test.ts
@@ -1,4 +1,5 @@
-import { describe, expect, it, vi } from 'vitest';
+import { beforeAll, describe, expect, it, vi } from 'vitest';
+import { i18n } from '@/i18n';
import {
createMobileLocalAttachmentUploadController,
isCameraUnavailableOnSimulator,
@@ -8,6 +9,11 @@ import {
} from '@/session/mobileLocalAttachmentUpload';
import type { RemoteSerializedAttachment } from '@/session/types';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
function candidate(name: string, kind: 'image' | 'file' = 'image'): MobileLocalAttachmentUploadCandidate {
return {
kind,
diff --git a/apps/mobile/src/__tests__/mobileRealtimeAsrProvider.test.ts b/apps/mobile/src/__tests__/mobileRealtimeAsrProvider.test.ts
index b74fef3a34..0d1698e757 100644
--- a/apps/mobile/src/__tests__/mobileRealtimeAsrProvider.test.ts
+++ b/apps/mobile/src/__tests__/mobileRealtimeAsrProvider.test.ts
@@ -1,5 +1,6 @@
-import { describe, expect, it, vi } from 'vitest';
+import { beforeAll, describe, expect, it, vi } from 'vitest';
import { DEFAULT_MOBILE_VOICE_LITELLM_BASE_URL } from '@/config/env';
+import { i18n } from '@/i18n';
const GW_PROXY = `${DEFAULT_MOBILE_VOICE_LITELLM_BASE_URL}/proxy`;
const GW_PROXY_WSS = GW_PROXY.replace(/^https/, 'wss');
@@ -12,6 +13,11 @@ import {
createMobileAsrProvider,
} from '@/session/mobileRealtimeAsrProvider';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
class FakeSocket {
static instances: FakeSocket[] = [];
readyState = 0;
diff --git a/apps/mobile/src/__tests__/mobileSettings.test.ts b/apps/mobile/src/__tests__/mobileSettings.test.ts
index 8c5d7ac857..952ed44776 100644
--- a/apps/mobile/src/__tests__/mobileSettings.test.ts
+++ b/apps/mobile/src/__tests__/mobileSettings.test.ts
@@ -1,9 +1,15 @@
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
-import { describe, expect, it } from 'vitest';
+import { beforeAll, describe, expect, it } from 'vitest';
+import { i18n } from '@/i18n';
import { buildMobileDeviceName } from '@/device-link/mobileDeviceIdentity';
import { buildMobileSettingsOverview, relayStatusTone } from '@/settings/mobileSettings';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
// Windows checkout(core.autocrlf)下源码是 CRLF;统一归一成 LF,含 \n 的多行片段断言才跨平台成立。
const readTextLf = (...args: Parameters<typeof readFileSync>): string =>
String(readFileSync(...args)).replace(/\r\n/g, '\n');
@@ -138,7 +144,7 @@ describe('mobile settings overview', () => {
expect(source).toContain('updateSelfDeviceNameDraft(res.name);');
expect(source).not.toContain('updateSelfDeviceNameDraft(systemDeviceName);');
expect(source).not.toContain('setSelfDeviceName(systemDeviceName);');
- expect(source).toContain('title="设备名称"');
+ expect(source).toContain("title={t('settings.deviceNameEditor.screenTitle')}");
expect(source).toContain('const selfDeviceNameWriteInFlightRef = useRef(false);');
expect(source).toContain('const selfDeviceNameQueuedWriteRef = useRef<SelfDeviceNameQueuedWrite | null>(null);');
expect(source).toContain("selfDeviceNameQueuedWriteRef.current = { kind: 'rename', name, options };");
@@ -166,7 +172,7 @@ describe('mobile settings overview', () => {
it('always shows the regional privacy policy above the cn-only App filing number', () => {
const source = readTextLf(resolve(process.cwd(), 'app/settings.tsx'), 'utf8');
- const filingCardIndex = source.indexOf('<SettingsGroup title="备案信息">');
+ const filingCardIndex = source.indexOf("<SettingsGroup title={t('settings.legal.sectionTitle')}>");
const privacyRowIndex = source.indexOf('testID="settings.privacyPolicy"');
const regionGuardIndex = source.indexOf("{AUTH_REGION === 'cn' ? (", privacyRowIndex);
const filingNumberIndex = source.indexOf('testID="settings.appFilingNumber"');
@@ -176,10 +182,10 @@ describe('mobile settings overview', () => {
expect(source).toContain("'https://cindy.cn/privacy/'");
expect(source).toContain("'https://cindy.app/privacy/'");
expect(source).toContain('Linking.openURL(PRIVACY_POLICY_URL)');
- expect(source).toContain('accessibilityLabel="打开隐私政策"');
+ expect(source).toContain("accessibilityLabel={t('settings.legal.openPrivacyPolicy')}");
expect(source).toContain('accessibilityRole="link"');
- expect(source).toContain('label="隐私政策"');
- expect(source).toContain('label="App 备案号"');
+ expect(source).toContain("label={t('settings.legal.privacyPolicy')}");
+ expect(source).toContain("label={t('settings.legal.appFilingNumber')}");
expect(source).toContain('value="沪ICP备11033765号-89A"');
expect(filingCardIndex).toBeGreaterThan(-1);
expect(privacyRowIndex).toBeGreaterThan(filingCardIndex);
@@ -196,7 +202,9 @@ describe('mobile settings overview', () => {
expect(source).not.toContain('testID="settings.bundleUpdate"');
expect(source).toContain('runManualUpdateCheck({');
expect(source).toContain('checkBundleUpdate: IS_OTA_SELFHOST ? checkBundleUpdate : undefined');
- expect(source).toContain('整包版本 {appVersion}');
- expect(source).toContain('testID="settings.otaVersion">热更版本 {otaVersion}');
+ expect(source).toContain("{t('settings.version.bundleVersion', { version: appVersion })}");
+ expect(source).toContain(
+ "testID=\"settings.otaVersion\">{t('settings.version.otaVersion', { version: otaVersion })}",
+ );
});
});
diff --git a/apps/mobile/src/__tests__/mobileVoiceController.test.ts b/apps/mobile/src/__tests__/mobileVoiceController.test.ts
index ebb47d8d78..4ac3409996 100644
--- a/apps/mobile/src/__tests__/mobileVoiceController.test.ts
+++ b/apps/mobile/src/__tests__/mobileVoiceController.test.ts
@@ -14,7 +14,7 @@ import type {
} from '@cindy/voice-input-core';
import type { StoredMobileVoiceCredential } from '@/session/mobileVoiceCredentialStore';
import { createMobileVoiceControllerSession } from '@/session/mobileVoiceController';
-import { MOBILE_VOICE_EMPTY_TRANSCRIPT_ERROR } from '@/session/mobileVoiceInput';
+import { mobileVoiceEmptyTranscriptError } from '@/session/mobileVoiceInput';
vi.mock('@/session/mobileRealtimeAudio', () => ({
startMobileRealtimeAudio: vi.fn(),
@@ -171,8 +171,8 @@ describe('mobileVoiceController', () => {
trace: { capturedAt: 1, convertedAt: 2, chunkIndex: 0, sampleRate: 16_000, durationMs: 20 },
});
- await expect(session.stop()).rejects.toThrow(MOBILE_VOICE_EMPTY_TRANSCRIPT_ERROR);
- expect(errors).toEqual([MOBILE_VOICE_EMPTY_TRANSCRIPT_ERROR]);
+ await expect(session.stop()).rejects.toThrow(mobileVoiceEmptyTranscriptError());
+ expect(errors).toEqual([mobileVoiceEmptyTranscriptError()]);
expect(states).toContain('error');
expect(states).not.toContain('done');
});
diff --git a/apps/mobile/src/__tests__/mobileVoiceInput.test.ts b/apps/mobile/src/__tests__/mobileVoiceInput.test.ts
index 0ba6901da9..8b9b9bc1d3 100644
--- a/apps/mobile/src/__tests__/mobileVoiceInput.test.ts
+++ b/apps/mobile/src/__tests__/mobileVoiceInput.test.ts
@@ -1,6 +1,12 @@
-import { describe, expect, it, vi } from 'vitest';
+import { beforeAll, describe, expect, it, vi } from 'vitest';
import { apiFetchRaw } from '@/api/client';
import { DEFAULT_MOBILE_VOICE_LITELLM_BASE_URL, DEVICE_LINK_API_BASE_URL } from '@/config/env';
+import { i18n } from '@/i18n';
+
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
const GW_PROXY = `${DEFAULT_MOBILE_VOICE_LITELLM_BASE_URL}/proxy`;
import {
@@ -9,8 +15,8 @@ import {
buildMobileVoiceRefinementContext,
canCancelMobileVoiceRecording,
makeMobileRefinerPromptCacheKey,
- MOBILE_VOICE_MIC_PERMISSION_ERROR,
- MOBILE_VOICE_REALTIME_AUDIO_UNAVAILABLE_ERROR,
+ mobileVoiceMicPermissionError,
+ mobileVoiceRealtimeAudioUnavailableError,
MOBILE_MAX_VOICE_AUDIO_BYTES,
isMobileVoiceMicPermissionError,
mobileVoiceStateLabel,
@@ -92,8 +98,8 @@ describe('mobileVoiceInput', () => {
});
it('detects microphone permission errors for the settings shortcut', () => {
- expect(isMobileVoiceMicPermissionError(MOBILE_VOICE_MIC_PERMISSION_ERROR)).toBe(true);
- expect(MOBILE_VOICE_REALTIME_AUDIO_UNAVAILABLE_ERROR).toContain('原生录音模块');
+ expect(isMobileVoiceMicPermissionError(mobileVoiceMicPermissionError())).toBe(true);
+ expect(mobileVoiceRealtimeAudioUnavailableError()).toContain('原生录音模块');
expect(isMobileVoiceMicPermissionError('麦克风权限未开启')).toBe(false);
expect(isMobileVoiceMicPermissionError(null)).toBe(false);
});
diff --git a/apps/mobile/src/__tests__/modelPickerRows.test.ts b/apps/mobile/src/__tests__/modelPickerRows.test.ts
index 34dca57cec..9921249c40 100644
--- a/apps/mobile/src/__tests__/modelPickerRows.test.ts
+++ b/apps/mobile/src/__tests__/modelPickerRows.test.ts
@@ -3,9 +3,10 @@
* 元信息行拼接 / effort 标签三级优先 / rowEffortOf 选中 live vs 记忆 / rowFastOn 门控 /
* budgetRowDisabled 三态)。纯逻辑,node env。
*/
-import { describe, expect, it } from 'vitest';
+import { beforeAll, describe, expect, it } from 'vitest';
import type { ProviderView } from '@cindy/model-providers/registry';
+import { i18n } from '@/i18n';
import type { MobileAgentCapabilities } from '@/session/agentCapabilities';
import type { MobileModelMemoryAccessors } from '@/session/draftModelMemory';
import {
@@ -20,6 +21,11 @@ import {
rowFastOn,
} from '@/session/modelPickerRows';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
const capabilities: MobileAgentCapabilities = {
availableModels: [],
effortLevels: [
diff --git a/apps/mobile/src/__tests__/modelPickerSheetModel.test.ts b/apps/mobile/src/__tests__/modelPickerSheetModel.test.ts
index 59f49f4781..93bc657f6a 100644
--- a/apps/mobile/src/__tests__/modelPickerSheetModel.test.ts
+++ b/apps/mobile/src/__tests__/modelPickerSheetModel.test.ts
@@ -2,10 +2,11 @@
* modelPickerSheetModel 单测:back 两段式结算、二级标题派生、options 目标行现查与失效回退、
* flat query 过滤。纯逻辑,node env。
*/
-import { describe, expect, it } from 'vitest';
+import { beforeAll, describe, expect, it } from 'vitest';
import type { MobileModelOption } from '@cindy/maker-shared/agent-capabilities';
import type { ProviderView } from '@cindy/model-providers/registry';
+import { i18n } from '@/i18n';
import type { ProviderModelRow } from '@/session/providerModelSections';
import {
filterFlatModelOptions,
@@ -14,6 +15,11 @@ import {
settleModelPickerSheetBack,
} from '@/session/modelPickerSheetModel';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
const provider = { id: 'xd', name: 'XD Gateway' } as unknown as ProviderView;
const row = (providerId: string, modelId: string, displayName: string): ProviderModelRow => ({
diff --git a/apps/mobile/src/__tests__/newSession.test.ts b/apps/mobile/src/__tests__/newSession.test.ts
index 3022ae8749..4cd833af70 100644
--- a/apps/mobile/src/__tests__/newSession.test.ts
+++ b/apps/mobile/src/__tests__/newSession.test.ts
@@ -1,6 +1,7 @@
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
-import { describe, expect, it } from 'vitest';
+import { beforeAll, describe, expect, it } from 'vitest';
+import { i18n } from '@/i18n';
import {
DEFAULT_NEW_SESSION_DRAFT,
buildNewSessionCreatePreview,
@@ -25,6 +26,11 @@ import {
import type { ProviderModelRow } from '@/session/providerModelSections';
import type { RemoteSession } from '@/session/types';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
function modelRow(
id: string,
efforts: readonly string[] = [],
diff --git a/apps/mobile/src/__tests__/orcaCollab.test.ts b/apps/mobile/src/__tests__/orcaCollab.test.ts
index 3451660c1d..0eb593732f 100644
--- a/apps/mobile/src/__tests__/orcaCollab.test.ts
+++ b/apps/mobile/src/__tests__/orcaCollab.test.ts
@@ -1,6 +1,7 @@
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
-import { describe, expect, it } from 'vitest';
+import { beforeAll, describe, expect, it } from 'vitest';
+import { i18n } from '@/i18n';
import {
buildOrcaDispatchCard,
classifyOrcaDispatchTool,
@@ -10,6 +11,12 @@ import { excludeOrcaWorkerSessions } from '@/session/mobileHome';
import { normalizeRemoteMessages } from '@/session/messageNormalize';
import type { RemoteMessage, RemoteSession } from '@/session/types';
+// orcaCollab 卡片文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦
+// (全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
function message(patch: Partial<RemoteMessage> & Pick<RemoteMessage, 'id' | 'role' | 'content'>): RemoteMessage {
return {
clientId: patch.id,
diff --git a/apps/mobile/src/__tests__/remoteAbsFileFetch.test.ts b/apps/mobile/src/__tests__/remoteAbsFileFetch.test.ts
index 64a638e46c..c7372252e2 100644
--- a/apps/mobile/src/__tests__/remoteAbsFileFetch.test.ts
+++ b/apps/mobile/src/__tests__/remoteAbsFileFetch.test.ts
@@ -1,5 +1,6 @@
-import { describe, expect, it, vi } from 'vitest';
+import { beforeAll, describe, expect, it, vi } from 'vitest';
+import { i18n } from '@/i18n';
import {
adaptTextFilePreviewResult,
fetchRemoteAbsFileToUrl,
@@ -7,6 +8,11 @@ import {
} from '@/session/remoteAbsFileFetch';
import type { RemoteTextFilePreviewResult } from '@/device-link/mobileMakerTransport';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
function makeDeps(overrides: Partial<{
ossKey: string;
getUrl: string;
diff --git a/apps/mobile/src/__tests__/remoteMediaResolveQueue.test.ts b/apps/mobile/src/__tests__/remoteMediaResolveQueue.test.ts
index aa81c69511..0d2b6501ae 100644
--- a/apps/mobile/src/__tests__/remoteMediaResolveQueue.test.ts
+++ b/apps/mobile/src/__tests__/remoteMediaResolveQueue.test.ts
@@ -1,7 +1,13 @@
-import { describe, expect, it, vi } from 'vitest';
+import { beforeAll, describe, expect, it, vi } from 'vitest';
+import { i18n } from '@/i18n';
import { createRemoteMediaResolveQueue, type RemoteMediaRequest } from '@/session/remoteMediaResolveQueue';
import type { MobileResolvedRemoteMedia } from '@/session/remoteMedia';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
function resolvedMedia(url: string, overrides: Partial<MobileResolvedRemoteMedia> = {}): MobileResolvedRemoteMedia {
return {
url: `https://oss.example/${url}?sig=1`,
diff --git a/apps/mobile/src/__tests__/sessionAgentSwitchConfirmation.test.ts b/apps/mobile/src/__tests__/sessionAgentSwitchConfirmation.test.ts
index f66e151383..3ee9c2e276 100644
--- a/apps/mobile/src/__tests__/sessionAgentSwitchConfirmation.test.ts
+++ b/apps/mobile/src/__tests__/sessionAgentSwitchConfirmation.test.ts
@@ -1,9 +1,15 @@
-import { describe, expect, it, vi } from 'vitest';
+import { beforeAll, describe, expect, it, vi } from 'vitest';
vi.mock('react-native', () => ({ Alert: { alert: vi.fn() } }));
+import { i18n } from '@/i18n';
import { confirmMobileSessionAgentSwitch } from '@/session/sessionAgentSwitchConfirmation';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
describe('confirmMobileSessionAgentSwitch', () => {
it('skips repeated confirmation when a pending intent already exists', async () => {
const showAlert = vi.fn();
diff --git a/apps/mobile/src/__tests__/sessionComposerDesktopFirst.test.ts b/apps/mobile/src/__tests__/sessionComposerDesktopFirst.test.ts
index 4e1a7a45ca..249e6c4b96 100644
--- a/apps/mobile/src/__tests__/sessionComposerDesktopFirst.test.ts
+++ b/apps/mobile/src/__tests__/sessionComposerDesktopFirst.test.ts
@@ -120,8 +120,8 @@ describe('mobile session composer desktop-first surface', () => {
// + 号打开可拖动 Context 面板(附件 / 计划模式 / 目标模式收在面板内)。
expect(source).toContain('testID="session.contextSheet"');
expect(attachmentButtonSource).toContain('setContextSheetOpen(true)');
- expect(source).toContain('<ContextSheetGroup label="模式">');
- expect(source).toContain('<ContextSheetGroup label="添加">');
+ expect(source).toContain("<ContextSheetGroup label={t('session.common.groupMode')}>");
+ expect(source).toContain("<ContextSheetGroup label={t('session.common.groupAdd')}>");
expect(source).not.toContain('testID="session.attachmentPathPanel"');
expect(source).not.toContain('被控电脑上的文件路径');
expect(source).toContain('testID="session.composerActivityStatus"');
@@ -561,7 +561,7 @@ describe('mobile session composer desktop-first surface', () => {
expect(voiceSource.indexOf('isMobileRealtimeAudioAvailable()')).toBeLessThan(
voiceSource.indexOf('requestRecordingPermissionsAsync()'),
);
- expect(voiceSource).toContain('MOBILE_VOICE_REALTIME_AUDIO_UNAVAILABLE_ERROR');
+ expect(voiceSource).toContain('mobileVoiceRealtimeAudioUnavailableError()');
expect(voiceSource).toContain('const documentBeforeStop = composerDocumentRef.current;');
expect(voiceSource).toContain('const latestDraft = await controller.stop();');
expect(voiceSource).toContain('await sendLatest({ documentOverride: latestDocument });');
diff --git a/apps/mobile/src/__tests__/sessionExtraDirs.test.ts b/apps/mobile/src/__tests__/sessionExtraDirs.test.ts
index 678a523b6c..7e5561f567 100644
--- a/apps/mobile/src/__tests__/sessionExtraDirs.test.ts
+++ b/apps/mobile/src/__tests__/sessionExtraDirs.test.ts
@@ -1,4 +1,5 @@
-import { describe, expect, it } from 'vitest';
+import { beforeAll, describe, expect, it } from 'vitest';
+import { i18n } from '@/i18n';
import {
appendSessionExtraDirDraft,
formatExtraDirsText,
@@ -7,6 +8,11 @@ import {
summarizeExtraDirs,
} from '@/session/sessionExtraDirs';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
describe('session extraDirs controls', () => {
it('formats mirrored session extraDirs for the mobile text area', () => {
expect(formatExtraDirsText([' /repo/docs ', '/repo/docs', '', '/repo/tools'])).toBe('/repo/docs\n/repo/tools');
diff --git a/apps/mobile/src/__tests__/sessionHeaderDesktopFirst.test.ts b/apps/mobile/src/__tests__/sessionHeaderDesktopFirst.test.ts
index 93f6ca7ffd..aef5b3d3b6 100644
--- a/apps/mobile/src/__tests__/sessionHeaderDesktopFirst.test.ts
+++ b/apps/mobile/src/__tests__/sessionHeaderDesktopFirst.test.ts
@@ -23,11 +23,11 @@ describe('mobile session header desktop-first surface', () => {
expect(source).not.toContain('sessionHeaderIconBadgeText');
expect(source).not.toContain('badge={');
expect(source).not.toContain("if (queueCount > 0) return `队列 ${queueCount}`;");
- expect(source).toContain("if (!session) return syncing ? '正在同步会话' : null;\n if (syncing) return '正在同步';");
+ expect(source).toContain("if (!session) return syncing ? i18n.t('session.screen.syncingSession') : null;\n if (syncing) return i18n.t('session.screen.syncing');");
// 后台静默刷新:同步提示由 showSyncingIndicator gate —— 仅首次加载、还没有任何内容时显示,
// 已有 messages(重开已看过的会话)时后台对账静默,不再弹"正在同步"。
expect(source).toContain('const showSyncingIndicator = loading && messages.length === 0;');
- expect(source).toContain("if (queuePaused) return '队列已暂停';\n return null;");
+ expect(source).toContain("if (queuePaused) return i18n.t('session.screen.queuePausedNotice');\n return null;");
expect(source).toContain('attention ? (');
});
@@ -74,7 +74,7 @@ describe('mobile session header desktop-first surface', () => {
const end = source.indexOf('function readRouteParam', start);
const toggleSource = source.slice(start, end);
- expect(toggleSource).toContain("expanded ? '收起历史消息' : '查看历史消息'");
+ expect(toggleSource).toContain("expanded ? t('session.screen.collapseHistory') : t('session.screen.expandHistory')");
expect(source).toContain('borderRadius: radius.pill');
expect(toggleSource).not.toContain('messageCount');
expect(toggleSource).not.toContain('历史消息已展开');
diff --git a/apps/mobile/src/__tests__/sessionMainLayerDesktopFirst.test.ts b/apps/mobile/src/__tests__/sessionMainLayerDesktopFirst.test.ts
index 2a1890b0ef..1ab5485b68 100644
--- a/apps/mobile/src/__tests__/sessionMainLayerDesktopFirst.test.ts
+++ b/apps/mobile/src/__tests__/sessionMainLayerDesktopFirst.test.ts
@@ -9,7 +9,7 @@ describe('mobile session main layer desktop-first noise budget', () => {
const emptyEnd = source.indexOf('function MessageListActionButton', emptyStart);
const emptySource = source.slice(emptyStart, emptyEnd);
- expect(emptySource).toContain('暂无消息');
+ expect(emptySource).toContain('message.renderer.emptyMessages');
expect(emptySource).not.toContain('这台电脑暂无活动消息');
expect(emptySource).not.toContain('先在桌面端创建或继续一个会话');
expect(emptySource).not.toContain('emptyText');
@@ -25,7 +25,7 @@ describe('mobile session main layer desktop-first noise budget', () => {
expect(syncingStart).toBeGreaterThan(-1);
const syncingEnd = rendererSource.indexOf('function MessageListActionButton', syncingStart);
const syncingSource = rendererSource.slice(syncingStart, syncingEnd);
- expect(syncingSource).toContain('正在同步');
+ expect(syncingSource).toContain('message.renderer.syncing');
expect(syncingSource).toContain('ActivityIndicator');
expect(rendererSource).toContain('SYNCING_PLACEHOLDER_DELAY_MS');
expect(rendererSource).toContain('ListEmptyComponent={syncingWhileEmpty');
@@ -47,8 +47,8 @@ describe('mobile session main layer desktop-first noise budget', () => {
expect(routeSource).toContain('{showConnectionBanner ? (');
expect(source).toContain('useShowConnectionBanner(status, connectionError, connectionIssue)');
expect(routeSource).not.toContain('connectionError || (loading && !currentSession)');
- expect(syncSource).toContain('等待会话同步');
- expect(syncSource).toContain('重新同步');
+ expect(syncSource).toContain("t('session.screen.awaitingSync')");
+ expect(syncSource).toContain("t('session.screen.resync')");
expect(syncSource).toContain('RefreshCw');
expect(syncSource).toContain('sessionSyncRow');
expect(syncSource).not.toContain('上方同步成功后');
@@ -115,7 +115,7 @@ describe('mobile session main layer desktop-first noise budget', () => {
'if (contextUsageSessionRef.current !== sessionId) return;',
refresh,
);
- const alert = resetSource.indexOf("Alert.alert('请重新确认', '重置凭证已过期", refresh);
+ const alert = resetSource.indexOf("Alert.alert(t('session.screen.resetReconfirmTitle'), t('session.screen.resetOfferExpired'))", refresh);
expect(refresh).toBeGreaterThan(-1);
expect(sessionGuard).toBeGreaterThan(refresh);
@@ -127,7 +127,7 @@ describe('mobile session main layer desktop-first noise budget', () => {
// 消息队列已从独立弹层退役,inline 到消息流(InlineQueueSection),不再有 sheet 标题。
expect(source).not.toContain('消息队列');
- expect(source).toContain('搜索当前会话');
+ expect(source).toContain("t('session.screen.searchTitle')");
expect(source).not.toContain('REMOTE QUEUE');
expect(source).not.toContain('MESSAGE SEARCH');
expect(source).not.toContain('queueSheetEyebrow');
@@ -140,8 +140,8 @@ describe('mobile session main layer desktop-first noise budget', () => {
const deleteEnd = source.indexOf('const confirmRewind', deleteStart);
const deleteSource = source.slice(deleteStart, deleteEnd);
- expect(deleteSource).toContain("Alert.alert('删除本条对话?'");
- expect(deleteSource).toContain('用户消息只删除本条;AI 消息会删除上一次用户输入之后产生的整轮输出。');
+ expect(deleteSource).toContain("Alert.alert(t('session.screen.deleteMessageTitle')");
+ expect(deleteSource).toContain("t('session.screen.deleteMessageBody')");
expect(deleteSource).toContain('const result = await maker.deleteMessage(sessionId, clientId);');
expect(deleteSource).toContain('Array.isArray(result.clientIds)');
expect(deleteSource).toContain('remoteSessionStore.removeMessages(');
diff --git a/apps/mobile/src/__tests__/sessionMenu.test.ts b/apps/mobile/src/__tests__/sessionMenu.test.ts
index 788191e939..cf2f29fa5c 100644
--- a/apps/mobile/src/__tests__/sessionMenu.test.ts
+++ b/apps/mobile/src/__tests__/sessionMenu.test.ts
@@ -1,4 +1,5 @@
-import { describe, expect, it } from 'vitest';
+import { beforeAll, describe, expect, it } from 'vitest';
+import { i18n } from '@/i18n';
import {
addSessionExtraDir,
aiRenameFailureText,
@@ -12,6 +13,11 @@ import {
} from '@/session/sessionMenu';
import type { RemoteSession } from '@/session/types';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
function session(patch: Partial<RemoteSession> = {}): RemoteSession {
return {
id: '83639512-9c1f-4b6e-b1de-0a1b2c3d7ed0',
diff --git a/apps/mobile/src/__tests__/sessionOutbox.test.ts b/apps/mobile/src/__tests__/sessionOutbox.test.ts
index ddc12fa2e8..d17b6adc21 100644
--- a/apps/mobile/src/__tests__/sessionOutbox.test.ts
+++ b/apps/mobile/src/__tests__/sessionOutbox.test.ts
@@ -1,4 +1,5 @@
-import { describe, expect, it } from 'vitest';
+import { beforeAll, describe, expect, it } from 'vitest';
+import { i18n } from '@/i18n';
import {
buildOutboxItem,
createOutboxClientId,
@@ -17,6 +18,11 @@ import {
import type { RemoteSerializedAttachment } from '@/session/types';
import { serializeComposerDocument } from '@/session/composerDocument';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
function attachmentFor(name: string): RemoteSerializedAttachment {
return {
id: `mobile-upload:key/${name}`,
diff --git a/apps/mobile/src/__tests__/sessionReferences.test.ts b/apps/mobile/src/__tests__/sessionReferences.test.ts
index 782e61bdca..7df03b10d5 100644
--- a/apps/mobile/src/__tests__/sessionReferences.test.ts
+++ b/apps/mobile/src/__tests__/sessionReferences.test.ts
@@ -1,9 +1,10 @@
-import { describe, expect, it, vi } from 'vitest';
+import { beforeAll, describe, expect, it, vi } from 'vitest';
import {
DeviceLinkError,
DL_HISTORY_MESSAGES_CHANNEL,
DL_SESSION_REFERENCE_CAPABILITY_CHANNEL,
} from '@cindy/device-link';
+import { i18n } from '@/i18n';
import type { RemoteInvoke } from '@/device-link/mobileMakerTransport';
import {
estimateMobileReferenceTokens,
@@ -20,6 +21,11 @@ import {
type MobileSessionReferenceContext,
} from '@/session/sessionReferences';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
function message(
sessionId: string,
id: string,
diff --git a/apps/mobile/src/__tests__/sessionSwipe.test.ts b/apps/mobile/src/__tests__/sessionSwipe.test.ts
index beec816e92..2b4e1443d3 100644
--- a/apps/mobile/src/__tests__/sessionSwipe.test.ts
+++ b/apps/mobile/src/__tests__/sessionSwipe.test.ts
@@ -1,4 +1,5 @@
-import { describe, expect, it, vi } from 'vitest';
+import { beforeAll, describe, expect, it, vi } from 'vitest';
+import { i18n } from '@/i18n';
import {
buildSessionActionMenu,
createLatestWriteGuard,
@@ -12,6 +13,11 @@ import {
writeGuardFields,
} from '@/session/swipeRowRegistry';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
describe('createSwipeRowRegistry', () => {
it('打开新行时自动关掉上一行', () => {
const registry = createSwipeRowRegistry();
diff --git a/apps/mobile/src/__tests__/sessionTailBannerModel.test.ts b/apps/mobile/src/__tests__/sessionTailBannerModel.test.ts
index 840c84f5c8..16cef97f99 100644
--- a/apps/mobile/src/__tests__/sessionTailBannerModel.test.ts
+++ b/apps/mobile/src/__tests__/sessionTailBannerModel.test.ts
@@ -1,8 +1,9 @@
-import { describe, expect, it } from 'vitest';
+import { beforeAll, describe, expect, it } from 'vitest';
import {
APP_EXIT_INTERRUPTED_REASON,
CONTINUE_AFTER_ERROR_PROMPT,
} from '@cindy/maker-shared/synthetic-trigger';
+import { i18n } from '@/i18n';
import {
isContinuationQueueItem,
resolveSessionTailBanner,
@@ -10,6 +11,11 @@ import {
} from '@/session/sessionTailBannerModel';
import type { RemoteMessage } from '@/session/types';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
function message(patch: Partial<RemoteMessage> & Pick<RemoteMessage, 'id' | 'role' | 'content' | 'createdAt'>): RemoteMessage {
return {
clientId: patch.id,
diff --git a/apps/mobile/src/__tests__/updateInfo.test.ts b/apps/mobile/src/__tests__/updateInfo.test.ts
index 5f2d262cfd..9662c22fa9 100644
--- a/apps/mobile/src/__tests__/updateInfo.test.ts
+++ b/apps/mobile/src/__tests__/updateInfo.test.ts
@@ -1,6 +1,12 @@
-import { describe, expect, it } from 'vitest';
+import { beforeAll, describe, expect, it } from 'vitest';
+import { i18n } from '@/i18n';
import { buildMobileUpdateInfoRows, currentMobileOtaVersion, OTA_VERIFY_MARKER } from '@/settings/updateInfo';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
describe('buildMobileUpdateInfoRows', () => {
it('shows OTA launch info (short id, local time, channel, runtime)', () => {
const rows = buildMobileUpdateInfoRows({
diff --git a/apps/mobile/src/api/client.ts b/apps/mobile/src/api/client.ts
index cc6e03ce08..7b2caa3bfb 100644
--- a/apps/mobile/src/api/client.ts
+++ b/apps/mobile/src/api/client.ts
@@ -1,3 +1,5 @@
+import { i18n } from '@/i18n';
+
export class ApiError extends Error {
constructor(
public readonly code: string,
@@ -70,7 +72,7 @@ export async function apiFetchRaw<T>(
new Promise<never>((_, reject) => {
timeoutId = setTimeout(() => {
void requestPromise.catch(() => undefined);
- reject(new ApiError('REQUEST_TIMEOUT', 0, '请求超时,请稍后重试'));
+ reject(new ApiError('REQUEST_TIMEOUT', 0, i18n.t('apiErrors.requestTimeout')));
controller?.abort();
}, timeoutMs);
}),
@@ -81,16 +83,16 @@ export async function apiFetchRaw<T>(
} catch (err) {
if (err instanceof ApiError) throw err;
if (isAbortError(err)) {
- throw new ApiError('REQUEST_TIMEOUT', 0, '请求超时,请稍后重试');
+ throw new ApiError('REQUEST_TIMEOUT', 0, i18n.t('apiErrors.requestTimeout'));
}
if (err instanceof TypeError) {
// fetch 的网络层失败统一走类型化离线错误:RN 离线抛 "Network request failed"
// (不含 "fetch" 子串,旧分支匹配不到,英文原文会一路透传到 UI);浏览器
// (Web 预览)抛 "Failed to fetch",还可能是 CORS——只在 web 环境附加提示。
const webHint = typeof document !== 'undefined'
- ? '。Web 预览可能被浏览器 CORS 拦截,请用 Expo Go/模拟器测试'
+ ? i18n.t('apiErrors.networkUnavailableWebHint')
: '';
- throw new ApiError('NETWORK_UNAVAILABLE', 0, `网络连接不可用,请检查网络后重试${webHint}`);
+ throw new ApiError('NETWORK_UNAVAILABLE', 0, i18n.t('apiErrors.networkUnavailable', { webHint }));
}
throw err;
} finally {
@@ -107,7 +109,7 @@ export async function apiFetchRaw<T>(
// Preserve the original typed API error even if local cleanup fails.
}
}
- throw new ApiError(code, response.status, error.message ?? '请求失败');
+ throw new ApiError(code, response.status, error.message ?? i18n.t('apiErrors.requestFailed'));
}
return data as T;
diff --git a/apps/mobile/src/auth/loginMessages.ts b/apps/mobile/src/auth/loginMessages.ts
index c1890b0d03..c3425adc5c 100644
--- a/apps/mobile/src/auth/loginMessages.ts
+++ b/apps/mobile/src/auth/loginMessages.ts
@@ -1,8 +1,11 @@
import { getLocales } from 'expo-localization';
+import { getManualLocaleOverride } from '@/i18n/appLanguage';
+
/**
* 登录域 4 语文案 catalog(zh-CN/en/ja/ko,中文全并进 zh-CN)。
- * 系统 locale 解析规则:zh 系(含 Hans/Hant/TW/HK/MO)一律 → zh-CN;
+ * 生效语言 = 设置里手动选择的语言(appLanguage override)优先,否则按系统
+ * locale 解析:zh 系(含 Hans/Hant/TW/HK/MO)一律 → zh-CN;
* ja → ja,ko → ko,兜底 en。
* catalog 必须保持单一 messages 常量、locale 块内联的普通对象字面量形态——
* check-login-i18n-parity.mjs 靠结构化 tokenizer 静态提取 locale/key 集合,
@@ -446,9 +449,9 @@ export function resolveLoginLocale(
return 'en';
}
-/** Login follows the system language across the 4 supported locales. */
+/** 生效语言:设置里的手动选择优先,未选择时跟随系统语言(4 语主干)。 */
export function getLoginLanguage(): LoginLocale {
- return resolveLoginLocale(getLocales()[0]?.languageTag);
+ return getManualLocaleOverride() ?? resolveLoginLocale(getLocales()[0]?.languageTag);
}
/**
diff --git a/apps/mobile/src/components/ConnectionBanner.tsx b/apps/mobile/src/components/ConnectionBanner.tsx
index eb921c91c7..d7384f0f45 100644
--- a/apps/mobile/src/components/ConnectionBanner.tsx
+++ b/apps/mobile/src/components/ConnectionBanner.tsx
@@ -1,5 +1,6 @@
import { useEffect, useState } from 'react';
import { StyleSheet, View } from 'react-native';
+import { useTranslation } from 'react-i18next';
import { Text } from '@/components/AppText';
import type { DeviceLinkConnectionIssue, DeviceLinkStatus } from '@cindy/device-link';
import {
@@ -62,6 +63,7 @@ export function ConnectionBanner({
variant?: 'bar' | 'inline';
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
// 链路已 online 说明 issue 已过期(client 侧 online 会清除,这里兜底不展示)。
// issue 优先于请求级 error:链路断因明确时,invoke 失败都是它的下游症状(NOT_CONNECTED)。
const activeIssue = status !== 'online' ? issue : null;
@@ -72,7 +74,7 @@ export function ConnectionBanner({
const compact = density === 'compact';
const title = activeIssue
? connectionIssueTitle(activeIssue.kind)
- : friendlyError ? '同步失败' : relayStatusLabel(status);
+ : friendlyError ? t('deviceLink.syncFailed') : relayStatusLabel(status);
const copy = activeIssue
? connectionIssueHint(activeIssue.kind)
: friendlyError ?? relayStatusHint(status, lastSyncedAt);
@@ -129,13 +131,14 @@ function ConnectionSyncButton({
testID?: string;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
return (
<MainWindowActionButton
action={{
- accessibilityLabel: loading ? '正在重新同步' : '重新同步',
+ accessibilityLabel: loading ? t('deviceLink.resyncing') : t('deviceLink.resync'),
busy: loading,
disabled: loading,
- label: compact ? '同步' : '重新同步',
+ label: compact ? t('deviceLink.syncShort') : t('deviceLink.resync'),
onPress,
testID,
}}
diff --git a/apps/mobile/src/components/MobilePrimitives.tsx b/apps/mobile/src/components/MobilePrimitives.tsx
index e5f6708203..eaaff5533f 100644
--- a/apps/mobile/src/components/MobilePrimitives.tsx
+++ b/apps/mobile/src/components/MobilePrimitives.tsx
@@ -1,4 +1,5 @@
import { useEffect, useRef, useState, type ReactNode } from 'react';
+import { useTranslation } from 'react-i18next';
import { ChevronLeft } from 'lucide-react-native';
import {
ActivityIndicator,
@@ -388,10 +389,11 @@ export function ScreenBackButton({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const interactionDisabled = !onPress;
return (
<Pressable
- accessibilityLabel="返回"
+ accessibilityLabel={t('shared.back')}
accessibilityRole="button"
accessibilityState={{ disabled: interactionDisabled }}
disabled={interactionDisabled}
@@ -558,6 +560,7 @@ const REMOTE_LIST_SYNCING_DELAY_MS = 800;
export function RemoteListSyncingPlaceholder({ testID }: { testID?: string }) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const [visible, setVisible] = useState(false);
useEffect(() => {
const timer = setTimeout(() => setVisible(true), REMOTE_LIST_SYNCING_DELAY_MS);
@@ -567,7 +570,7 @@ export function RemoteListSyncingPlaceholder({ testID }: { testID?: string }) {
return (
<View style={styles.remoteSyncingPlaceholder} testID={testID}>
<ActivityIndicator color={colors.textTertiary} size="small" />
- <Text style={styles.remoteSyncingText}>正在同步</Text>
+ <Text style={styles.remoteSyncingText}>{t('shared.syncing')}</Text>
</View>
);
}
diff --git a/apps/mobile/src/components/RemoteAccessGuide.tsx b/apps/mobile/src/components/RemoteAccessGuide.tsx
index 6fc2398b3c..acf09f79e1 100644
--- a/apps/mobile/src/components/RemoteAccessGuide.tsx
+++ b/apps/mobile/src/components/RemoteAccessGuide.tsx
@@ -1,4 +1,5 @@
import { StyleSheet, View, type StyleProp, type ViewStyle } from 'react-native';
+import { useTranslation } from 'react-i18next';
import { Cloud, Lock } from 'lucide-react-native';
import { Text } from '@/components/AppText';
import { MainWindowActionButton, StatusDot } from '@/components/MobilePrimitives';
@@ -30,24 +31,6 @@ import {
* eyebrow、步骤、卡片与云端预告属于引导态自身的展示细节,收在本组件内。
*/
-/** 连接步骤文案。桌面端开关名称必须与 apps/desktop 设置页 devices.allowControl 保持一致。 */
-const CONNECT_STEPS = [
- '在电脑上安装并打开 Cindy',
- '用与手机相同的账号登录',
- '在「设置 → 远程连接」中开启「允许同账号设备控制本机」',
-] as const;
-
-const BRAND_EYEBROW = 'CINDY 手机版';
-const CLOUD_TEASER_TITLE = '云端 Cindy 筹备中';
-const CLOUD_TEASER_COPY = '上线后无需电脑,手机版即可直接使用。';
-
-const SECTION_LABELS: Record<MobileHomeNoDeviceContext['reason'], string | null> = {
- firstRun: '开始使用',
- offline: '连接过的电脑',
- remoteDisabled: '在电脑上操作',
- accessRevoked: '需要重新允许',
-};
-
export function RemoteAccessGuide({
context,
copy,
@@ -73,12 +56,25 @@ export function RemoteAccessGuide({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const { reason } = context;
- const sectionLabel = SECTION_LABELS[reason];
+ // 连接步骤文案。桌面端开关名称必须与 apps/desktop 设置页 devices.allowControl 保持一致。
+ const connectSteps = [
+ t('deviceLink.connectStep1'),
+ t('deviceLink.connectStep2'),
+ t('deviceLink.connectStep3'),
+ ];
+ const sectionLabels: Record<MobileHomeNoDeviceContext['reason'], string | null> = {
+ firstRun: t('deviceLink.sectionFirstRun'),
+ offline: t('deviceLink.sectionOffline'),
+ remoteDisabled: t('deviceLink.sectionRemoteDisabled'),
+ accessRevoked: t('deviceLink.sectionAccessRevoked'),
+ };
+ const sectionLabel = sectionLabels[reason];
return (
<View style={[styles.root, style]} testID={testID}>
<View style={styles.heroBlock}>
- <Text style={styles.eyebrow}>{BRAND_EYEBROW}</Text>
+ <Text style={styles.eyebrow}>{t('deviceLink.brandEyebrow')}</Text>
<Text style={styles.heroTitle}>{title}</Text>
<Text style={styles.lede}>{copy}</Text>
</View>
@@ -88,7 +84,7 @@ export function RemoteAccessGuide({
{reason === 'firstRun' ? (
<View style={styles.card}>
- {CONNECT_STEPS.map((step, index) => (
+ {connectSteps.map((step, index) => (
<View key={step} style={styles.stepRow}>
<View style={styles.stepBadge}>
<Text style={styles.stepBadgeText}>{index + 1}</Text>
@@ -120,7 +116,7 @@ export function RemoteAccessGuide({
{reason === 'remoteDisabled' ? (
<View style={styles.card}>
- <Text style={styles.instructionText}>{CONNECT_STEPS[2]}</Text>
+ <Text style={styles.instructionText}>{connectSteps[2]}</Text>
</View>
) : null}
@@ -128,7 +124,7 @@ export function RemoteAccessGuide({
<MainWindowActionButton
action={{
busy: retrying,
- label: '重试访问',
+ label: t('deviceLink.retryAccess'),
onPress: onRetryAccess,
testID: 'home.remoteGuide.retryAccess',
tone: 'primary',
@@ -141,7 +137,7 @@ export function RemoteAccessGuide({
<MainWindowActionButton
action={{
busy: rechecking,
- label: '重新检查',
+ label: t('deviceLink.recheck'),
onPress: onRecheck,
testID: 'home.remoteGuide.recheck',
}}
@@ -153,8 +149,8 @@ export function RemoteAccessGuide({
<View style={styles.teaserCard}>
<Cloud color={colors.textSecondary} size={iconSize.lg} strokeWidth={iconStroke.thin} />
<View style={styles.teaserBody}>
- <Text style={styles.teaserTitle}>{CLOUD_TEASER_TITLE}</Text>
- <Text style={styles.teaserCopy}>{CLOUD_TEASER_COPY}</Text>
+ <Text style={styles.teaserTitle}>{t('deviceLink.cloudTeaserTitle')}</Text>
+ <Text style={styles.teaserCopy}>{t('deviceLink.cloudTeaserCopy')}</Text>
</View>
</View>
</View>
diff --git a/apps/mobile/src/i18n/appLanguage.ts b/apps/mobile/src/i18n/appLanguage.ts
new file mode 100644
index 0000000000..64ff7ca065
--- /dev/null
+++ b/apps/mobile/src/i18n/appLanguage.ts
@@ -0,0 +1,23 @@
+/**
+ * 手动语言 override 桥。
+ *
+ * i18next 之外还有一批手写 4 语 catalog(loginMessages / newSessionMessages /
+ * fullAccessConfirmation),它们以同步函数形式在渲染期取文案,原本只读系统语言。
+ * LocaleProvider 在用户显式选择语言时把 override 写到这里,catalog 侧优先取
+ * override、无 override 时照旧读系统语言——保证「设置里切语言」对全部文案面生效。
+ *
+ * 独立成最小模块(不 import i18next / React)是为了让 catalog 及其测试保持零依赖。
+ */
+
+import type { SupportedLocale } from './locale';
+
+let manualLocaleOverride: SupportedLocale | null = null;
+
+/** LocaleProvider 专用:偏好为 'system' 时传 null。 */
+export function setManualLocaleOverride(locale: SupportedLocale | null): void {
+ manualLocaleOverride = locale;
+}
+
+export function getManualLocaleOverride(): SupportedLocale | null {
+ return manualLocaleOverride;
+}
diff --git a/apps/mobile/src/i18n/index.ts b/apps/mobile/src/i18n/index.ts
new file mode 100644
index 0000000000..cbe041654d
--- /dev/null
+++ b/apps/mobile/src/i18n/index.ts
@@ -0,0 +1,58 @@
+/**
+ * 移动端 i18n 入口 —— 同步 init i18next,导出常量与类型(镜像 desktop renderer/i18n)。
+ *
+ * 设计要点:
+ * - 资源同步 import(零网络/零 IO),i18n.init 同步完成 → 首屏不闪 key。
+ * - 首选语言取系统语言(而非 DEFAULT_LOCALE):用户未设置 override 时首帧即正确;
+ * 持久化的 override 由 LocaleProvider 挂载后异步读出再切换,切换发生在启动
+ * splash 覆盖层之下,不产生可见闪变。
+ * - 单 namespace 'common';fallbackLng = en,缺 key 不显示 key 本身。
+ * - 不接 LanguageDetector backend,偏好全部走 languagePreferenceStore(AsyncStorage)。
+ */
+
+import i18n from 'i18next';
+import { initReactI18next } from 'react-i18next';
+import { BRAND_NAME } from '@cindy/maker-shared/branding';
+
+import enCommon from './locales/en';
+import zhCNCommon from './locales/zh-CN';
+import jaCommon from './locales/ja';
+import koCommon from './locales/ko';
+import { DEFAULT_LOCALE } from './locale';
+import { detectSystemLocale } from './systemLocale';
+
+export {
+ DEFAULT_LOCALE,
+ isLocalePreference,
+ isSupportedLocale,
+ resolveSystemLocale,
+ SUPPORTED_LOCALES,
+} from './locale';
+export type { LocalePreference, SupportedLocale } from './locale';
+export { detectSystemLocale } from './systemLocale';
+
+const resources = {
+ en: { common: enCommon },
+ 'zh-CN': { common: zhCNCommon },
+ ja: { common: jaCommon },
+ ko: { common: koCommon },
+} as const;
+
+// 同步 init —— 没有 backend / detector / suspense,i18n.init 立即返回。
+void i18n.use(initReactI18next).init({
+ resources,
+ lng: detectSystemLocale(),
+ // 缺 key 回退英文(主干 4 语,无繁体 catalog)。
+ fallbackLng: { default: [DEFAULT_LOCALE] },
+ defaultNS: 'common',
+ ns: ['common'],
+ interpolation: {
+ escapeValue: false, // React 已转义
+ // 品牌名单一事实源:文案里的 {{appName}} 全部由此注入(与 desktop 同约定)。
+ defaultVariables: { appName: BRAND_NAME },
+ },
+ returnNull: false,
+});
+
+export { i18n };
+export default i18n;
diff --git a/apps/mobile/src/i18n/languagePreferenceStore.ts b/apps/mobile/src/i18n/languagePreferenceStore.ts
new file mode 100644
index 0000000000..c5d78e253d
--- /dev/null
+++ b/apps/mobile/src/i18n/languagePreferenceStore.ts
@@ -0,0 +1,32 @@
+/**
+ * 显示语言偏好存储(AsyncStorage,版本化 key)。
+ *
+ * 遵循「默认 + override」模型(docs/dev-rules/configuration-and-overrides.md):
+ * 只持久化用户显式选择的具体语言;「跟随系统」不是一条被写死的值,而是
+ * 「没有 override」这个状态本身——恢复跟随系统 = 删除存储项。
+ */
+
+import AsyncStorage from '@react-native-async-storage/async-storage';
+
+import { isSupportedLocale, type LocalePreference } from './locale';
+
+const STORAGE_KEY = 'xdt-maker.mobile.language-preference.v1';
+
+export async function readLanguagePreference(): Promise<LocalePreference> {
+ const raw = await AsyncStorage.getItem(STORAGE_KEY).catch(() => null);
+ return isSupportedLocale(raw) ? raw : 'system';
+}
+
+export async function saveLanguagePreference(
+ preference: LocalePreference,
+): Promise<void> {
+ if (preference === 'system') {
+ await AsyncStorage.removeItem(STORAGE_KEY).catch(() => undefined);
+ return;
+ }
+ await AsyncStorage.setItem(STORAGE_KEY, preference).catch(() => undefined);
+}
+
+export const __testing = {
+ storageKey: STORAGE_KEY,
+};
diff --git a/apps/mobile/src/i18n/locale.ts b/apps/mobile/src/i18n/locale.ts
new file mode 100644
index 0000000000..2b336412ed
--- /dev/null
+++ b/apps/mobile/src/i18n/locale.ts
@@ -0,0 +1,42 @@
+/**
+ * 移动端 locale 常量与解析纯函数(与 desktop shared/locale.ts 同一 4 语主干)。
+ *
+ * 本模块保持零依赖(不 import expo / RN):偏好存储及其测试直接消费,
+ * 读系统语言的 detectSystemLocale 在 systemLocale.ts。
+ * 解析规则与 loginMessages.resolveLoginLocale 保持一致:中文(含 Hans/Hant/TW/HK/MO)
+ * 一律并进 zh-CN(无繁体 catalog),ja / ko 前缀直取,其余兜底 en。
+ * 刻意用字符串前缀而非 Intl.Locale——Hermes 的 Intl 子集在各版本间能力不齐,
+ * 前缀匹配对 4 语主干足够且行为可预期。
+ */
+
+/** UI 支持的具体语言。 */
+export const SUPPORTED_LOCALES = ['zh-CN', 'en', 'ja', 'ko'] as const;
+export type SupportedLocale = (typeof SUPPORTED_LOCALES)[number];
+
+/** 用户偏好:'system' = 跟随系统语言,由本模块在运行时解析。 */
+export type LocalePreference = SupportedLocale | 'system';
+
+/** 缺 key / 无法解析系统语言时的回退语言(与 desktop 一致)。 */
+export const DEFAULT_LOCALE: SupportedLocale = 'en';
+
+export function isSupportedLocale(value: unknown): value is SupportedLocale {
+ return (
+ typeof value === 'string' &&
+ (SUPPORTED_LOCALES as readonly string[]).includes(value)
+ );
+}
+
+export function isLocalePreference(value: unknown): value is LocalePreference {
+ return value === 'system' || isSupportedLocale(value);
+}
+
+/** BCP 47 languageTag → 支持的 locale。大小写不敏感,null/undefined 兜底 en。 */
+export function resolveSystemLocale(
+ languageTag: string | null | undefined,
+): SupportedLocale {
+ const tag = languageTag?.toLowerCase() ?? '';
+ if (tag.startsWith('zh')) return 'zh-CN';
+ if (tag.startsWith('ja')) return 'ja';
+ if (tag.startsWith('ko')) return 'ko';
+ return DEFAULT_LOCALE;
+}
diff --git a/apps/mobile/src/i18n/locales/en/apiErrors.json b/apps/mobile/src/i18n/locales/en/apiErrors.json
new file mode 100644
index 0000000000..550fef7b5e
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/en/apiErrors.json
@@ -0,0 +1,6 @@
+{
+ "requestTimeout": "The request timed out. Try again later.",
+ "networkUnavailable": "Network connection unavailable. Check your connection and try again.{{webHint}}",
+ "networkUnavailableWebHint": " The web preview may be blocked by the browser's CORS policy; test with Expo Go or a simulator.",
+ "requestFailed": "Request failed"
+}
diff --git a/apps/mobile/src/i18n/locales/en/composer.json b/apps/mobile/src/i18n/locales/en/composer.json
new file mode 100644
index 0000000000..810bbbc0ef
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/en/composer.json
@@ -0,0 +1,103 @@
+{
+ "input": {
+ "resize": {
+ "increaseHeight": "Increase input height",
+ "decreaseHeight": "Decrease input height",
+ "hint": "Drag up or down to adjust the input height",
+ "label": "Input height adjuster"
+ }
+ },
+ "attachments": {
+ "viewImage": "View image {{name}}",
+ "removeAttachment": "Remove attachment {{name}}",
+ "retryUpload": "Retry uploading {{name}}",
+ "retry": "Retry",
+ "removeFailed": "Remove failed attachment {{name}}",
+ "cancelUpload": "Cancel uploading {{name}}",
+ "uploadFailed": "{{name}} · Upload failed",
+ "collapsedBadge": "{{count}} attachments, tap to expand",
+ "imageNotAnnotatable": "This image can't be annotated or forwarded.",
+ "downloadOriginalFailed": "Could not download the original image (HTTP {{status}}).",
+ "annotationSaveFailed": "Could not save annotation",
+ "tryAgain": "Try again.",
+ "sendToChat": "Send to Chat",
+ "save": "Save",
+ "fileNotFound": "File not found",
+ "pathNotReadable": "This path can't be read",
+ "readFailed": "Read failed",
+ "notFetchableMedia": "Not a fetchable desktop media",
+ "mediaResultInvalid": "Invalid remote media fetch result",
+ "mediaUrlInvalid": "Invalid remote media download URL",
+ "mediaCacheMiss": "Remote media cache miss (cachedOnly)",
+ "mediaFetchCancelled": "Remote media fetch cancelled",
+ "fileMenu": {
+ "openBrowser": "Open File Browser",
+ "sendToSession": "Send to Session",
+ "copyPath": "Copy Path",
+ "quickPreview": "Quick Preview",
+ "revealInBrowser": "Reveal in File Browser",
+ "share": "Export / Share",
+ "folder": "Folder",
+ "file": "File"
+ }
+ },
+ "upload": {
+ "emptyFile": "This file is empty and can't be sent as an attachment.",
+ "fileTooLarge": "The file exceeds {{size}} MB and can't be sent as an attachment for now.",
+ "cancelled": "Attachment upload cancelled.",
+ "incompleteRead": "Incomplete file read: expected {{expected}} bytes, got {{actual}} bytes.",
+ "integrityUnavailable": "This attachment upload body can't be integrity-checked.",
+ "sizeChanged": "Attachment size changed: expected {{expected}} bytes, got {{actual}} bytes.",
+ "invalidSize": "Invalid attachment size; can't compute the integrity digest.",
+ "invalidBase64": "The attachment chunk is not valid base64.",
+ "failedHttp": "Attachment upload failed: HTTP {{status}}{{code}}",
+ "failedNetwork": "Attachment upload failed: network transfer error, check your connection and try again. ({{detail}})",
+ "timeout": "Attachment upload timed out; check your connection and try again.",
+ "fileTypeUnsupported": "This local file type can't be sent as an attachment yet.",
+ "snapshotFailedNoCacheDir": "Could not create attachment snapshot: cache directory unavailable",
+ "snapshotFailed": "Could not create attachment snapshot",
+ "invalidUploadUrl": "The server did not return a valid attachment upload URL.",
+ "noImageRead": "No uploadable image was read.",
+ "emptyImage": "This image is empty and can't be sent as an attachment.",
+ "imageTooLarge": "The image exceeds {{size}} MB and can't be sent as an attachment for now.",
+ "imageTooLargeSend": "The image exceeds {{size}} MB and can't be sent for now.",
+ "sessionExpiredImage": "Your session has expired. Sign in again to upload the image.",
+ "sessionExpiredFile": "Your session has expired. Sign in again to upload the attachment.",
+ "pasteTimeout": "Pasting the image timed out. Try again.",
+ "clipboardReadFailed": "Could not read the clipboard image. Copy it again and paste.",
+ "maxAttachments": "Add up to {{count}} attachments.",
+ "simulatorNoCamera": "The simulator has no camera. Use \"Photos\" to pick from the library.",
+ "cameraPermission": "Camera access is off. Allow {{appName}} to use the camera in system settings.",
+ "photoPermission": "Photo access is off. Allow {{appName}} to access photos in system settings.",
+ "noFileRead": "No uploadable file was read."
+ },
+ "voice": {
+ "recordingEmpty": "The recording is empty and can't be transcribed.",
+ "recordingTooLarge": "The recording exceeds the {{size}}MB limit.",
+ "invalidUploadUrl": "The server did not return a valid voice upload URL.",
+ "uploadFailed": "Voice upload failed: HTTP {{status}} {{statusText}}",
+ "refineFailed": "Voice refinement failed",
+ "refineResponseTooLarge": "The voice refinement response exceeds the {{max}}-character limit.",
+ "refineStreamFailed": "Voice refinement streaming response failed.",
+ "refineNoContent": "Voice refinement returned no valid content.",
+ "refineInvalidJson": "Voice refinement returned invalid JSON: {{snippet}}",
+ "invalidSession": "The voice service returned an invalid session.",
+ "managedRefineUnsupported": "The current {{appName}} voice service does not support managed refinement.",
+ "sessionNotConnected": "The speech recognition session is not connected yet.",
+ "loginRequired": "Sign in to {{appName}} before using voice input.",
+ "serviceUnavailable": "The {{appName}} voice service is not configured for this region.",
+ "realtimeUnsupported": "Mobile realtime voice does not support {{detail}} ASR yet.",
+ "realtimeAuthUnsupported": "Mobile realtime voice does not support {{auth}} ASR authentication yet.",
+ "realtimeProtocolUnsupported": "Mobile realtime voice does not support the {{detail}} ASR protocol yet.",
+ "missingConnectionProvider": "Mobile voice input needs a {{appName}} voice session ticket (connectionProvider is missing).",
+ "realtimeAsrFailed": "Realtime speech recognition failed.",
+ "volcengineAuthUnsupported": "Mobile Volcengine voice does not support {{auth}} authentication yet.",
+ "volcengineMissingResourceId": "The Volcengine ASR configuration is missing resourceId.",
+ "sessionExpiredOrForbidden": "The {{appName}} voice session has expired or lacks permission (WebSocket {{status}}). Confirm your sign-in status and try again.",
+ "incomplete": "Voice input didn't finish. Try again.",
+ "missingRefinerTargetProvider": "Mobile voice refinement needs a {{appName}} voice session (refinerTargetProvider is missing).",
+ "emptyTranscript": "Speech was detected but no text was recognized. Try again.",
+ "micPermission": "Microphone access is turned off. Allow {{appName}} to use the microphone in system settings.",
+ "realtimeAudioUnavailable": "This build does not support realtime voice input. Install a test build that includes the native recording module."
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/en/deviceLink.json b/apps/mobile/src/i18n/locales/en/deviceLink.json
new file mode 100644
index 0000000000..d96883c43e
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/en/deviceLink.json
@@ -0,0 +1,18 @@
+{
+ "syncFailed": "Sync failed",
+ "resync": "Resync",
+ "resyncing": "Resyncing",
+ "syncShort": "Sync",
+ "connectStep1": "Install and open {{appName}} on your computer",
+ "connectStep2": "Sign in with the same account as your phone",
+ "connectStep3": "Under Settings → Remote Access, turn on \"Allow same-account devices to control this computer\"",
+ "brandEyebrow": "Cindy Mobile",
+ "cloudTeaserTitle": "{{appName}} in the Cloud, Coming Soon",
+ "cloudTeaserCopy": "Once it launches, the mobile app works on its own, no computer needed.",
+ "sectionFirstRun": "Get Started",
+ "sectionOffline": "Connected Computers",
+ "sectionRemoteDisabled": "On Your Computer",
+ "sectionAccessRevoked": "Approve Access Again",
+ "retryAccess": "Retry Access",
+ "recheck": "Check Again"
+}
diff --git a/apps/mobile/src/i18n/locales/en/devices.json b/apps/mobile/src/i18n/locales/en/devices.json
new file mode 100644
index 0000000000..3d75306df1
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/en/devices.json
@@ -0,0 +1,328 @@
+{
+ "common": {
+ "cancel": "Cancel",
+ "save": "Save",
+ "saving": "Saving",
+ "delete": "Delete",
+ "deleting": "Deleting",
+ "create": "New"
+ },
+ "list": {
+ "thisComputer": "This computer",
+ "allConversations": "All Conversations",
+ "syncFailed": "Sync failed",
+ "requestFailed": "Request failed",
+ "loading": "Loading available computers",
+ "untitled": "Untitled conversation",
+ "connection": {
+ "connecting": "Connecting",
+ "disconnected": "Disconnected"
+ },
+ "error": {
+ "sessionDeviceNotFound": "Can't find the computer this conversation belongs to. Sync again and retry.",
+ "taskDeviceNotFound": "Can't find the computer this task belongs to. Sync again and retry.",
+ "noDevice": "No computer available. Turn on remote control on the desktop, then sync again."
+ },
+ "alert": {
+ "actionFailed": "Action failed",
+ "renameFailed": "Rename failed",
+ "deleteTitle": "Delete conversation?",
+ "deleteMessage": "This deletes \"{{title}}\" and can't be undone."
+ },
+ "a11y": {
+ "selectScope": "Select conversation scope",
+ "openSettings": "Open settings",
+ "syncing": "Syncing",
+ "sync": "Sync again",
+ "pinnedConversations": "{{count}} pinned conversations",
+ "newRemoteConversation": "New remote conversation",
+ "renameDevice": "Rename {{label}}",
+ "project": "Project {{title}}",
+ "openAutomationLatest": "Open the latest session of automation {{title}}",
+ "automationTask": "Automation {{title}}",
+ "openConversation": "Open conversation {{title}}",
+ "collapse": "Collapse {{title}}",
+ "expand": "Expand {{title}}",
+ "taskError": "Task failed",
+ "awaitingYou": "Waiting for you",
+ "doneUnread": "Completed, unread",
+ "running": "Running",
+ "close": "Close",
+ "cancelRename": "Cancel rename"
+ },
+ "menu": {
+ "groupByProject": "Group by Project"
+ },
+ "renameDevice": {
+ "title": "Rename Device",
+ "placeholder": "Device name",
+ "savingA11y": "Saving device name",
+ "saveA11y": "Save device name"
+ },
+ "renameSession": {
+ "title": "Rename Conversation",
+ "placeholder": "Conversation title",
+ "savingA11y": "Saving conversation title",
+ "saveA11y": "Save conversation title"
+ },
+ "revoked": {
+ "title": "Access revoked",
+ "body": "\"{{deviceName}}\" revoked this device's remote access. Re-authorize this device in {{appName}} settings on that computer, then tap \"Retry Access.\"",
+ "retry": "Retry Access"
+ },
+ "viewAllConversations": "View all {{count}} conversations",
+ "viewAllRuns": "View all {{count}} runs",
+ "preview": {
+ "needAttention": "{{count}} need attention",
+ "waiting": "{{count}} waiting",
+ "automationRunning": "Automation running",
+ "totalRuns": "{{count}} runs total"
+ }
+ },
+ "detail": {
+ "filter": {
+ "active": "Active",
+ "waiting": "Pending",
+ "automation": "Automation",
+ "archived": "Archived",
+ "all": "All",
+ "a11y": "Filter {{label}} conversations"
+ },
+ "group": {
+ "project": "Project",
+ "date": "Date",
+ "label": "Group",
+ "a11y": "Group by {{label}}"
+ },
+ "metric": {
+ "active": "Active",
+ "waiting": "Pending",
+ "automation": "Automation",
+ "activeA11y": "Filter active conversations",
+ "waitingA11y": "Filter pending conversations",
+ "automationA11y": "Filter automation conversations"
+ },
+ "plan": "Schedule",
+ "automationsButtonA11y": "Open remote automations",
+ "search": {
+ "openA11y": "Search remote conversations",
+ "closeA11y": "Close remote conversation search",
+ "label": "Search",
+ "placeholder": "Search titles, projects, models, messages",
+ "clearA11y": "Clear search",
+ "closeInputA11y": "Close search",
+ "clear": "Clear",
+ "close": "Close"
+ },
+ "filters": {
+ "collapseA11y": "Collapse conversation filters",
+ "expandA11y": "Expand conversation filters",
+ "label": "Filter"
+ },
+ "selection": {
+ "count": "{{count}} conversations selected",
+ "canAct": "Actions available",
+ "cannotAct": "No actions available",
+ "clearA11y": "Clear conversation selection"
+ },
+ "bulk": {
+ "pinning": "Pinning",
+ "unpinning": "Unpinning",
+ "archiving": "Archiving",
+ "restoring": "Restoring",
+ "deleting": "Deleting",
+ "pinA11y": "Pin selected conversations",
+ "unpinA11y": "Unpin selected conversations",
+ "archiveA11y": "Archive selected conversations",
+ "restoreA11y": "Restore selected conversations",
+ "deleteA11y": "Delete selected conversations",
+ "cancelA11y": "Cancel bulk action",
+ "partialFailure": "Processed {{done}}, {{failed}} failed (restored, you can retry).",
+ "noArchivable": "No archivable active conversations in the selection.",
+ "noPinnable": "No pinnable active conversations in the selection.",
+ "noRestorable": "No restorable archived conversations in the selection.",
+ "noUnpinnable": "No pinned conversations in the selection.",
+ "noDeletable": "No deletable conversations in the selection.",
+ "noneModifiable": "None of the selected conversations can be changed."
+ },
+ "automationScope": {
+ "eyebrow": "Automation",
+ "title": "Automation",
+ "emptyCopy": "After the task runs, each run's session shows up here.",
+ "emptyTitle": "This task has no run history yet"
+ },
+ "projectScope": {
+ "eyebrow": "Project",
+ "emptyCopy": "Start a new conversation in this project.",
+ "emptyTitle": "This project has no conversations yet"
+ },
+ "subtitle": {
+ "deviceActive": "{{deviceName}} · {{count}} active conversations",
+ "activeAndProjects": "{{count}} active conversations · {{projects}} projects"
+ },
+ "row": {
+ "a11yAutomationGroup": "Automation group {{title}}",
+ "a11ySession": "Conversation {{title}}",
+ "a11yCollapse": "Collapse {{title}}",
+ "a11yExpand": "Expand {{title}}",
+ "collapse": "Collapse",
+ "expand": "Expand"
+ },
+ "badge": {
+ "waiting": "Pending {{count}}",
+ "automationPrefix": "Automation",
+ "sessionCount": "{{count}} conversations",
+ "aggregate": "Grouped",
+ "running": "Running",
+ "unread": "Unread {{count}}"
+ },
+ "child": {
+ "openA11y": "Open automation conversation {{title}}"
+ },
+ "viewAllRuns": "View all {{count}} runs"
+ },
+ "automations": {
+ "error": {
+ "projectMissingConfig": "This project automation is missing projectConfigId. Delete it on the desktop.",
+ "deletePartial": "Automation deleted, but {{count}} generated conversations couldn't be updated. Check them on the desktop."
+ },
+ "subtitle": "{{active}} running · {{total}} tasks",
+ "metric": {
+ "running": "Running",
+ "unreadResults": "Unread Results",
+ "executing": "In Progress"
+ },
+ "summary": {
+ "paused": "{{count}} tasks paused. Select a task to run, pause, edit, or open its latest session.",
+ "default": "Select a task to run, pause, edit, or open its latest session."
+ },
+ "empty": {
+ "copy": "Create your first automation right from your phone, or create one on the desktop and sync it here.",
+ "title": "No automations on this computer"
+ },
+ "createAutomation": "New Automation",
+ "recentRuns": "Recent Runs",
+ "runs": {
+ "emptyCopy": "After you tap Run now, new runs show up here.",
+ "emptyTitle": "No runs yet"
+ },
+ "form": {
+ "title": {
+ "create": "New Automation",
+ "edit": "Edit Automation"
+ },
+ "sessionMode": {
+ "bound": "Once bound to an existing session, the directory, worktree, Agent, and Fast mode follow that session.",
+ "persistent": "The first trigger creates a persistent session; later triggers continue in the same one.",
+ "fresh": "Each trigger creates a new session."
+ },
+ "field": {
+ "name": "Name",
+ "prompt": "Prompt",
+ "trigger": "Trigger",
+ "runSession": "Run Session",
+ "boundSession": "Bound Session",
+ "intervalMinutes": "Interval (minutes)",
+ "workspace": "Workspace",
+ "projectDir": "Project Directory",
+ "model": "Model",
+ "effort": "Reasoning Effort",
+ "timezone": "Time Zone"
+ },
+ "namePlaceholder": "e.g. Daily project check",
+ "scriptHint": "This is a script-only task; its script config can only be edited on the desktop. Here you can change the name, trigger, notifications, and other fields.",
+ "promptPlaceholder": "Describe clearly what {{appName}} should do on each run",
+ "trigger": {
+ "recurring": "Recurring",
+ "manual": "Manual"
+ },
+ "session": {
+ "fresh": "New Session",
+ "persistent": "Persistent",
+ "bound": "Bound"
+ },
+ "boundSessionA11y": "Bind session {{name}}",
+ "intervalPlaceholder": "Leave empty to use cron",
+ "workspace": {
+ "project": "Project",
+ "dialogue": "Conversation"
+ },
+ "useWorktree": "Use worktree",
+ "modelPlaceholderBound": "Follow session",
+ "fastMode": "Fast Mode",
+ "notifyDesktop": "Desktop Notifications",
+ "notifyFeishu": "Feishu Notifications",
+ "savingA11y": "Saving automation",
+ "saveA11y": "Save automation",
+ "cancelA11y": "Cancel editing automation"
+ },
+ "delete": {
+ "counting": "Counting the conversations this automation generated...",
+ "confirmDeleteBoth": "Delete Task and Conversations",
+ "confirmArchive": "Delete Task and Archive Conversations",
+ "confirmTaskOnly": "Delete Task Only",
+ "title": "Delete {{name}}",
+ "copy": "Deleting an automation task doesn't interrupt runs already in progress. Generated conversations are handled by the option below, matching the desktop.",
+ "optionsA11y": "Choose how to handle generated conversations",
+ "keepDesc": "Delete only this automation task; past conversations stay in their original list.",
+ "keepLabel": "Keep Generated Conversations",
+ "archiveDesc": "After deleting the task, move its generated conversations to the archive, still searchable later.",
+ "archiveLabel": "Archive Generated Conversations",
+ "deleteDesc": "After deleting the task, also mark its generated conversations as deleted. This can't be undone from your phone.",
+ "deleteLabel": "Delete Generated Conversations",
+ "cancelA11y": "Cancel deleting automation",
+ "confirmA11y": "Confirm deleting automation"
+ },
+ "pause": {
+ "title": "Pause {{name}}",
+ "detailFallback": "Pausing stops this automation from triggering.",
+ "previewFallback": "No runs in progress",
+ "confirmA11y": "Confirm pausing automation",
+ "pausing": "Pausing",
+ "confirm": "Confirm Pause",
+ "cancelA11y": "Cancel pausing automation"
+ },
+ "runDelete": {
+ "title": "Delete this run record",
+ "copy": "This deletes only this automation run record. It won't delete the conversations it opened, and it won't affect future automatic triggers.",
+ "confirmA11y": "Confirm deleting run record",
+ "confirm": "Delete Record",
+ "cancelA11y": "Cancel deleting run record"
+ },
+ "template": {
+ "label": "Template",
+ "loadingA11y": "Loading templates",
+ "refreshA11y": "Refresh automation templates",
+ "loading": "Loading",
+ "refresh": "Refresh",
+ "cardA11y": "Automation template {{name}}",
+ "manualConfig": "Manual config"
+ },
+ "scheduleRowA11y": "Automation task {{title}}",
+ "detail": {
+ "promptScriptFallback": "Script-only task; config can only be edited on the desktop",
+ "promptEmpty": "No task prompt saved",
+ "deleteA11y": "Delete automation",
+ "runNowA11y": "Run automation now",
+ "running": "Running",
+ "resumeA11y": "Resume automation",
+ "pauseA11y": "Pause automation",
+ "resume": "Resume",
+ "pause": "Pause",
+ "editA11y": "Edit automation",
+ "edit": "Edit"
+ },
+ "run": {
+ "openSessionA11y": "Open automation session",
+ "opening": "Opening",
+ "session": "Session",
+ "restartA11y": "Re-run automation",
+ "restarting": "Re-running",
+ "restart": "Re-run",
+ "markReadA11y": "Mark run record as read",
+ "marking": "Marking",
+ "markRead": "Read",
+ "deleteA11y": "Delete run record"
+ }
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/en/files.json b/apps/mobile/src/i18n/locales/en/files.json
new file mode 100644
index 0000000000..7769caa5b7
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/en/files.json
@@ -0,0 +1,90 @@
+{
+ "browser": {
+ "titleFallback": "Remote Files",
+ "workdirSuffix": " · Working directory",
+ "footerOnline": "Connected · Live sync",
+ "footerConnecting": "Connecting…",
+ "folderEmpty": "This folder is empty.",
+ "noWorkdir": "This session has no working directory, so files can't be browsed.",
+ "rootDir": "(Root)",
+ "copyPath": "Copy Path",
+ "sendToSession": "Send to Session",
+ "exportShare": "Export / Share",
+ "preview": "Quick Look",
+ "copiedPath": "Path copied",
+ "shareFailed": "Sharing failed. Try again.",
+ "exporting": "Exporting from your computer…",
+ "downloadFailed": "Download failed",
+ "searchPlaceholder": "Search",
+ "cancel": "Cancel",
+ "searchModeName": "File name",
+ "searchModeContent": "Content",
+ "searchModeA11y": "Search by {{mode}}",
+ "searchScope": "In {{workdir}}",
+ "searching": " · Searching…",
+ "searchingContent": "Searching file contents…",
+ "noContentMatch": "No matching content.",
+ "contentSearchMinChars": "Enter at least 2 characters to search file contents.",
+ "contentSummary": "{{matches}} matches · {{files}} files",
+ "contentSummaryTruncated": " · Truncated at limit",
+ "indexing": "Building file index…",
+ "noNameMatch": "No matching file names.",
+ "nameSearchPrompt": "Enter a keyword to search by file name.",
+ "nameResultSummary": "{{n}} results · matched by name",
+ "viewGrid": "Grid View",
+ "viewList": "List View",
+ "sortName": "Sort by Name",
+ "sortMtime": "Sort by Date Modified",
+ "sortSize": "Sort by Size",
+ "a11yTitleMenu": "Path and view menu",
+ "a11ySearch": "Search file names",
+ "a11yMore": "More",
+ "a11yOpenFolder": "Open folder {{name}}",
+ "a11yPreviewFile": "Preview file {{name}}",
+ "a11yClear": "Clear",
+ "a11yCancelSearch": "Cancel search",
+ "a11yPreviewName": "Preview {{name}}",
+ "a11yPreviewNameLine": "Preview {{name}} line {{line}}"
+ },
+ "preview": {
+ "done": "Done",
+ "a11yShare": "Export and share",
+ "copyPath": "Copy Path",
+ "sendToSession": "Send to Session",
+ "copiedPath": "Path copied",
+ "exporting": "Exporting from your computer…",
+ "downloadFailed": "Download failed",
+ "fetchingVideo": "Fetching video from your computer…",
+ "fetchingAudio": "Fetching audio from your computer…",
+ "fetchAvFailed": "Fetch failed: {{detail}}",
+ "fetchPdfFailed": "PDF fetch failed: {{detail}}",
+ "fetchingPdf": "Fetching PDF from your computer…",
+ "unsupportedType": "This type can't be previewed on your phone yet",
+ "oversize": "File exceeds the preview limit ({{size}}); download the original to view it",
+ "oversizeUnknown": "too large",
+ "binaryFile": "Binary file, can't be previewed as text",
+ "readFailed": "Read failed",
+ "truncated2mb": "File exceeds 2 MB; showing the first 2 MB only",
+ "truncatedLines": "Showing the first {{lines}} lines only",
+ "mdRendered": "Rendered",
+ "mdSource": "Source",
+ "mdViewA11y": "{{view}} view",
+ "a11yViewImage": "View full image {{name}}",
+ "fetchOriginalFailed": "Failed to fetch original: {{detail}}",
+ "a11yRetryOriginal": "Retry fetching the original image",
+ "retry": "Retry",
+ "fetchingOriginal": "Fetching the original image from your computer…",
+ "originalFailedThumb": "Couldn't fetch the original; showing the thumbnail",
+ "fetchingOriginalHint": "Thumbnail · fetching the original…",
+ "a11yExportShareFile": "Export and share the original file",
+ "exportShare": "Export / Share"
+ },
+ "export": {
+ "exportFailed": "Export failed",
+ "leftPage": "Left the page; export aborted",
+ "exportTimeout": "Export timed out. Try again."
+ },
+ "gallery": {
+ "cacheMiss": "Remote media cache miss (cachedOnly)"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/en/home.json b/apps/mobile/src/i18n/locales/en/home.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/en/home.json
@@ -0,0 +1 @@
+{}
diff --git a/apps/mobile/src/i18n/locales/en/index.ts b/apps/mobile/src/i18n/locales/en/index.ts
new file mode 100644
index 0000000000..82fba68991
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/en/index.ts
@@ -0,0 +1,38 @@
+/**
+ * 本 locale 的 catalog 组装:每个区域一个 JSON 文件、一个顶级 key,
+ * 组装成单一 'common' namespace 的资源对象。
+ * 区域清单四语必须一致(与其余 locale 的 index.ts 逐行同构);新增区域时
+ * 四个 locales/<locale>/index.ts 一起加,平价测试会拦截漏改。
+ */
+
+import apiErrors from './apiErrors.json';
+import composer from './composer.json';
+import deviceLink from './deviceLink.json';
+import devices from './devices.json';
+import files from './files.json';
+import home from './home.json';
+import interaction from './interaction.json';
+import message from './message.json';
+import models from './models.json';
+import session from './session.json';
+import settings from './settings.json';
+import shared from './shared.json';
+import startup from './startup.json';
+import update from './update.json';
+
+export default {
+ apiErrors,
+ composer,
+ deviceLink,
+ devices,
+ files,
+ home,
+ interaction,
+ message,
+ models,
+ session,
+ settings,
+ shared,
+ startup,
+ update,
+} as const;
diff --git a/apps/mobile/src/i18n/locales/en/interaction.json b/apps/mobile/src/i18n/locales/en/interaction.json
new file mode 100644
index 0000000000..7f941b2e8e
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/en/interaction.json
@@ -0,0 +1,149 @@
+{
+ "permission": {
+ "mode": {
+ "default": "Default permissions",
+ "acceptEdits": "Allow edits",
+ "plan": "Plan mode",
+ "auto": "Auto approve",
+ "bypass": "Full access"
+ },
+ "pickerSelect": "Select permission mode {{mode}}",
+ "armedRiskWarning": "The decision is sent to your computer only after you confirm.",
+ "armedHighRiskTitle": "Confirm high-risk action",
+ "kind": "Permission",
+ "deny": "Deny",
+ "denyAccessibility": "Deny permission request",
+ "alwaysAllow": "Always allow this session",
+ "alwaysAllowAccessibility": "Always allow permission requests this session",
+ "alwaysAllowConfirm": "Confirm allow this session",
+ "allowOnce": "Allow once",
+ "allowOnceAccessibility": "Allow permission request once",
+ "allowOnceConfirm": "Confirm allow once",
+ "highRisk": "High risk"
+ },
+ "planMode": {
+ "label": "Plan mode",
+ "exit": "Exit plan mode"
+ },
+ "panel": {
+ "readOnlyKind": "Pending",
+ "readOnlyTitle": "Waiting for confirmation on your computer",
+ "pendingRequests": "Pending requests",
+ "queueSwitchTo": "Switch to {{position}} pending request: {{label}}",
+ "queueSwitchGeneric": "Switch pending request",
+ "missingRequestId": "This remote interaction has no requestId, so the decision can't be sent back.",
+ "issueConfirmUnsupported": "Issue submission is confirmed only on your computer. Go back to the desktop app to confirm or cancel.",
+ "unsupportedType": "This remote interaction type isn't supported on mobile yet.",
+ "unsupportedKind": "Unsupported",
+ "awaitingAnswer": "Awaiting answer",
+ "continueAccessibility": "Continue the remote question",
+ "continue": "Continue",
+ "askOptionCount": "{{count}} options",
+ "askFreeInput": "Free text",
+ "askModeMulti": "Multi-select",
+ "askModeSingle": "Single select",
+ "askMetaCaption": "{{options}} · {{mode}} · Other answers allowed",
+ "expandQuestionCard": "Expand question card",
+ "collapseQuestionCard": "Collapse question card",
+ "selectAnswer": "Select answer {{label}}",
+ "submittingHint": "Sending the decision to your computer. Don't submit again.",
+ "customAnswerInputAccessibility": "Enter a custom answer",
+ "customAnswerPlaceholder": "Enter another answer",
+ "customAnswerButtonText": "Enter another answer...",
+ "answerInput": "Enter an answer",
+ "previous": "Back",
+ "skipAccessibility": "Skip question",
+ "skip": "Skip",
+ "submitAnswerAccessibility": "Submit answer",
+ "next": "Next",
+ "answerRequired": "Select or enter an answer to continue.",
+ "submit": "Submit",
+ "planReviewTitle": "Review Claude's plan",
+ "planExpand": "Expand plan",
+ "planEditHint": "Use edit mode to adjust the plan",
+ "planBrowseHint": "Tap a section to jump to it",
+ "planEditToggle": "Edit plan",
+ "planEditExit": "Exit plan editing",
+ "planCollapse": "Collapse plan",
+ "planExpandArea": "Expand plan browser",
+ "planHalf": "Switch to half-screen plan",
+ "planEditorAccessibility": "Plan editor",
+ "planEditorPlaceholder": "Edit the plan",
+ "planOutline": "Outline",
+ "planJumpTo": "Jump to plan section {{title}}",
+ "planEmpty": "The plan is empty.",
+ "planApproveAccessibility": "Approve and run the plan",
+ "planApprove": "Approve Claude's plan and start coding",
+ "planFeedbackLabel": "Plan feedback",
+ "planFeedbackPlaceholder": "Tell Claude what to do",
+ "planFeedbackRequired": "Enter feedback before submitting.",
+ "planFeedbackSubmit": "Submit plan feedback",
+ "planFeedbackAccessibility": "Give feedback to change the plan"
+ },
+ "rewind": {
+ "readError": "Couldn't read the rewind preview. Sync again and retry.",
+ "noFilesNote": "No files to roll back; only the conversation after this message will be truncated.",
+ "moreFiles": "{{count}} more files",
+ "stats": "{{count}} files · +{{insertions}} / -{{deletions}} lines",
+ "gotIt": "Got it",
+ "cancel": "Cancel",
+ "cancelAccessibility": "Cancel rewind",
+ "confirm": "Confirm rewind",
+ "confirming": "Rewinding",
+ "titleLoading": "Checking rewind impact",
+ "titleDefault": "Rewind to this message?",
+ "titleEmpty": "Rewind conversation only",
+ "titleError": "Can't rewind",
+ "detailLoading": "Reading the file rewind preview from your computer.",
+ "detailDefault": "This rolls back the files below and truncates the conversation after this message.",
+ "detailEmpty": "No files to roll back; confirming truncates only the conversation after this message.",
+ "detailError": "Your computer declined this rewind."
+ },
+ "collab": {
+ "dispatchSummaryItem": "{{label}}: {{task}}",
+ "batchTitle": "Dispatched to {{count}} workers",
+ "batchTitleGeneric": "Dispatched to multiple workers",
+ "batchBodyFallback": "Create workers",
+ "dispatchTitle": "Dispatched to worker {{who}}",
+ "dispatchRole": "Role {{meta}}",
+ "dispatchBodyFallback": "Create worker",
+ "sendTitle": "Message to worker",
+ "sendBodyFallback": "Send message",
+ "reportTitle": "Worker report",
+ "reportBodyFallback": "(empty report)"
+ },
+ "contextSheet": {
+ "backAccessibility": "Back to the context panel",
+ "goalStatus": {
+ "active": "In progress",
+ "paused": "Paused",
+ "blocked": "Pending",
+ "complete": "Completed",
+ "budgetLimited": "Limit reached",
+ "usageLimited": "Usage limited"
+ },
+ "goalLabel": "Goal",
+ "goalObjectiveAccessibility": "Goal content",
+ "goalPlaceholder": "What do you want to achieve? The agent keeps working toward this goal until it's done or hits a limit.",
+ "advancedSettings": "Advanced settings",
+ "limitsHint": "When unchanged, follows the controlled computer's default limits; the goal stops automatically when any limit is reached and can be stopped manually anytime; \"Unlimited\" means no limit is set.",
+ "maxTurns": "Max turns",
+ "tokenBudget": "Token budget",
+ "noProgressLimit": "No-progress limit",
+ "startGoal": "Start goal",
+ "goalMeta": "{{turns}} turns · {{tokens}} tokens",
+ "pause": "Pause",
+ "resume": "Resume",
+ "clearGoal": "Stop goal",
+ "unlimited": "Unlimited",
+ "noScreenshots": "No screenshots found.",
+ "mediaRemove": "Remove photo attachment {{name}}",
+ "mediaDeselect": "Deselect photo {{name}}",
+ "mediaSelect": "Select photo {{name}}",
+ "photoPermissionHint": "Photo access is off. Turn it on to quickly add recent photos.",
+ "enablePhotoPermission": "Turn on photo access",
+ "enable": "Turn on",
+ "icloudTimeout": "The photo is still downloading from iCloud and timed out. Check your network and retry.",
+ "photoNotReadable": "This photo can't be read right now (it may not have finished downloading from iCloud). Try again later."
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/en/message.json b/apps/mobile/src/i18n/locales/en/message.json
new file mode 100644
index 0000000000..57dcd96d74
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/en/message.json
@@ -0,0 +1,191 @@
+{
+ "renderer": {
+ "previousQuestionJump": "Jump to previous question: {{preview}}",
+ "noPreview": "No preview",
+ "newMessagesToBottom": "New messages, jump to bottom",
+ "jumpToBottom": "Jump to bottom",
+ "openForkOrigin": "Open fork source message",
+ "viewForkOrigin": "View fork source",
+ "emptyMessages": "No messages yet",
+ "syncing": "Syncing",
+ "copyLinkHint": "Tap to copy message link",
+ "sentTime": "Sent at {{time}}",
+ "linkCopied": "Link copied",
+ "turnCostEstimate": "This turn {{cost}}",
+ "turnCost": "This turn cost {{cost}}",
+ "messageGenerating": "Message is generating",
+ "generating": "Generating",
+ "collapseMessage": "Collapse message",
+ "expandMessage": "Expand message",
+ "collapse": "Collapse",
+ "expand": "Expand",
+ "automationOriginNamed": "Sent by automation task “{{name}}”",
+ "automationOrigin": "Sent by an automation task",
+ "modelMismatch": "This turn was answered by {{actual}} instead of the selected {{selected}} (temporary server-side downgrade)",
+ "copyStateCopying": "Copying",
+ "copyStateCopied": "Copied",
+ "copyStateFailed": "Copy failed",
+ "copyStateCopy": "Copy",
+ "thinkingHidden": "Thinking hidden",
+ "thinkingDone": "Thought for {{duration}}",
+ "thinkingActive": "Thinking {{elapsed}}",
+ "thinkingProcess": "Thinking",
+ "thinkingEmpty": "The model returned no thinking to display.",
+ "thinkingNoContent": "No thinking yet",
+ "collapseRow": "Collapse {{label}}",
+ "expandRow": "Expand {{label}}",
+ "statusRunning": "Running",
+ "statusCompleted": "Completed",
+ "statusFailed": "Failed",
+ "statusStopped": "Stopped",
+ "toolUseCount": "{{n}} tool calls",
+ "subagentTaskTitle": "Subagent task",
+ "recentTool": "Latest tool: {{name}}",
+ "outputFile": "Output: {{file}}",
+ "noMoreDetail": "No more details",
+ "filesRead": "Read {{n}} files",
+ "searchCount": "Searched {{n}} times",
+ "listCount": "Listed {{n}} times",
+ "collapseThinking": "Collapse thinking",
+ "expandThinking": "Expand thinking",
+ "subagentTyped": "Subagent · {{type}}",
+ "subagent": "Subagent",
+ "workedDuration": "Worked {{duration}}",
+ "subagentSummary": "Subagent summary",
+ "agentSwitchLabel": "Switched from {{from}} to {{to}}",
+ "agentSwitchViewHandoff": "{{label}}, view handoff",
+ "sessionResumedPill": "Resumed original session",
+ "handoffContentDesc": "Handoff — context summary sent to the new engine when switching (not shown in your messages)",
+ "openDiagramDetail": "Open diagram detail",
+ "sessionChipFallback": "Session {{id}}",
+ "imageFallbackTitle": "Image",
+ "mermaidExportFailedTitle": "Export failed",
+ "mermaidRenderIncompleteBody": "The diagram isn't fully rendered yet or the export failed. Try again later.",
+ "mermaidDiagramTitle": "Mermaid diagram",
+ "mermaidAnnotateFailedTitle": "Annotation failed",
+ "annotateSendToChat": "Annotate and send to chat",
+ "exportDiagramImage": "Export diagram as image",
+ "closeDetail": "Close detail",
+ "copyDetailContent": "Copy detail content",
+ "openDetailLink": "Open detail link",
+ "mediaNotPreviewable": "This media can't be previewed directly right now.",
+ "retryRemoteMediaFetch": "Retry remote media fetch",
+ "retryFetch": "Retry Fetch",
+ "openMedia": "Open Media",
+ "readCurrentRemoteFile": "Read current remote file",
+ "reading": "Reading",
+ "retryFilePreview": "Retry File Preview",
+ "readCurrentFile": "Read Current File",
+ "currentFilePreview": "Current file preview",
+ "diffNoOldContent": "No old content",
+ "diffOldTitle": "Old",
+ "diffNoNewContent": "No new content",
+ "diffNewTitle": "New",
+ "fileKind": "File",
+ "loadRemoteTextPreview": "Load remote text preview",
+ "loading": "Loading",
+ "retryPreview": "Retry Preview",
+ "loadPreview": "Load Preview",
+ "copyRemoteFilePath": "Copy remote file path",
+ "copyPath": "Copy Path",
+ "copiedPath": "Path copied",
+ "copyPathFailed": "Failed to copy path",
+ "remoteMediaIdle": "Preparing remote media fetch",
+ "remoteMediaLoading": "Fetching from the remote computer",
+ "remoteMediaReady": "Remote media fetched",
+ "remoteMediaFetchFailed": "Fetch failed: {{message}}",
+ "mediaPending": "{{label}} ready to play",
+ "mediaLoaded": "{{label}} loaded{{progress}}",
+ "mediaPlaying": "{{label}} playing{{progress}}",
+ "mediaPaused": "{{label}} paused{{progress}}",
+ "mediaBuffering": "{{label}} buffering{{progress}}",
+ "mediaEnded": "{{label}} ended{{progress}}",
+ "mediaError": "{{label}} playback error{{error}}",
+ "mediaSourceUrl": "Source URL: {{url}}",
+ "mediaDownloadUrl": "Download URL: {{url}}",
+ "mediaSize": "Size: {{size}}",
+ "mediaExpiresAt": "Expires at: {{time}}",
+ "mediaErrorLine": "Error: {{message}}",
+ "mediaDeviceLinkHint": "The mobile app will request the remote computer to upload the media via device-link before opening it.",
+ "controlDelete": "Delete message",
+ "controlRewind": "Rewind to here",
+ "controlFork": "Fork conversation",
+ "markdownDocAriaLabel": "Message body",
+ "toolOutputTitle": "{{label}} output",
+ "mermaidEmpty": "Empty Mermaid diagram.",
+ "diffEditCount": "{{n}} edits"
+ },
+ "actions": {
+ "attachmentsPrefix": "Attachments: {{names}}",
+ "justNow": "Just now",
+ "minutesAgo": "{{n}} min ago",
+ "hoursAgo": "{{n}} h ago",
+ "turnCostValue": "Est. {{value}}"
+ },
+ "lightbox": {
+ "cancelAnnotation": "Cancel annotation",
+ "cancel": "Cancel",
+ "undoLastStroke": "Undo last stroke",
+ "undo": "Undo",
+ "done": "Done",
+ "shareImage": "Share image",
+ "annotateImage": "Annotate image",
+ "annotate": "Annotate",
+ "exportShare": "Export / Share",
+ "sendToChat": "Send to chat",
+ "loadFailed": "Image failed to load",
+ "retryLoadImage": "Retry loading image",
+ "retry": "Retry",
+ "closeImage": "Close image"
+ },
+ "queue": {
+ "continueSystemInstruction": "Continue the unfinished task (system instruction)",
+ "systemInstruction": "System instruction",
+ "retrySend": "Retry Send",
+ "clearError": "Clear Error",
+ "credentialSwitchWait": "Waiting for another Codex task to finish; it will send automatically once done",
+ "aborting": "Stopping; queued messages will stay here",
+ "paused": "Queue paused; queued messages won't send automatically",
+ "resumeSendQueue": "Resume sending the queue",
+ "resume": "Resume",
+ "attachmentCount": "{{n}} attachments",
+ "attachmentMessage": "Attachment message",
+ "steeringLabel": "Interjecting: {{text}}",
+ "queuedMessageLabel": "Queued message {{index}}: {{text}}",
+ "editingInComposer": "Editing in the input box below…",
+ "cancel": "Cancel",
+ "edit": "Edit",
+ "steer": "Interject",
+ "collapseQueued": "Collapse queued messages",
+ "expandRemainingQueued": "Expand {{n}} more queued messages",
+ "collapse": "Collapse",
+ "expandRemaining": "Show {{n}} more",
+ "sendFailedMessage": "Failed message: {{text}}",
+ "sendingMessage": "Sending message: {{text}}",
+ "uploadingAttachments": "Uploading attachments {{uploaded}}/{{total}}",
+ "delete": "Delete",
+ "retry": "Retry"
+ },
+ "systemCard": {
+ "goalComplete": "Goal reached · {{turns}} turns · took {{duration}}",
+ "goalResumed": "Usage restored, continuing the goal",
+ "autoResume": "Connection dropped, resumed automatically",
+ "modelLabel": "Model",
+ "sessionLabel": "Session",
+ "sessionResumed": "Resumed",
+ "agentSwitch": "Switched from {{from}} to {{to}}",
+ "learnStarted": "Skill learning started",
+ "learnStartedBody": "Distillation runs in the background on desktop. When it's done, review the skill draft on desktop.",
+ "learnFailed": "Skill learning couldn't start",
+ "learnBusyBody": "A learning task is already running. Try again after it finishes.",
+ "learnFailedBody": "Failed to start: {{detail}}",
+ "unknownError": "Unknown error"
+ },
+ "quote": {
+ "count": "{{n}} quotes",
+ "countPreviewHint": "{{n}} quotes, tap to preview",
+ "remove": "Remove quote",
+ "closePreview": "Close quote preview",
+ "menuLabel": "Add to chat"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/en/models.json b/apps/mobile/src/i18n/locales/en/models.json
new file mode 100644
index 0000000000..9b774ba5eb
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/en/models.json
@@ -0,0 +1,36 @@
+{
+ "picker": {
+ "title": "Model",
+ "permissionTitle": "Permissions",
+ "searchAccessibility": "Search models",
+ "searchPlaceholder": "Search models...",
+ "noResults": "No matching models",
+ "emptyDefault": "No models available",
+ "loadingDefault": "Loading models…",
+ "subscriptionBadge": "Subscription",
+ "backToModels": "Back to model list",
+ "agentSwitchHint": "After you pick a model, the next message switches to {{agent}}",
+ "crossAgentEmptyHint": "Connect a {{agent}} model source on the controlled computer first",
+ "permissionModeAccessibility": "Permission mode: {{mode}}",
+ "selectProviderModelAccessibility": "Select {{model}} from {{provider}}",
+ "selectModelAccessibility": "Select {{model}}",
+ "configureAccessibility": "Configure {{model}}",
+ "budgetDisabledHint": "This model needs an API key configured on the controlled computer first",
+ "priceLine": "Input {{input}} · Output {{output}} / million tokens",
+ "contextSuffix": "{{size}} context",
+ "fastTag": "Fast"
+ },
+ "options": {
+ "fastMode": "Fast Mode",
+ "fastModeAccessibility": "Fast mode {{model}}",
+ "reasoningEffort": "Reasoning Effort",
+ "reasoningEffortAccessibility": "Reasoning effort {{label}}"
+ },
+ "agentSwitch": {
+ "browseAccessibility": "Browse {{agent}} models",
+ "confirmTitle": "Switch to {{agent}}?",
+ "confirmMessage": "When you send the next message, {{appName}} hands the current session over to {{agent}}. The two agents may interpret context and tools differently, so confirm before choosing the target model.",
+ "cancel": "Cancel",
+ "confirm": "Continue"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/en/session.json b/apps/mobile/src/i18n/locales/en/session.json
new file mode 100644
index 0000000000..44e0cb028f
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/en/session.json
@@ -0,0 +1,237 @@
+{
+ "common": {
+ "cancel": "Cancel",
+ "delete": "Delete",
+ "openContextPanel": "Open context panel",
+ "groupMode": "Mode",
+ "groupAdd": "Add",
+ "planMode": "Plan Mode",
+ "goalMode": "Goal Mode",
+ "context": "Context",
+ "screenshot": "Screenshot",
+ "photo": "Photos",
+ "takePhoto": "Take Photo",
+ "file": "File",
+ "joinConversation": "Add to chat ({{num}})",
+ "paletteLoading": "Loading",
+ "noMatchingCommands": "No matching commands",
+ "noMatchingResources": "No matching resources",
+ "keepTypingToNarrow": "Keep typing to narrow results",
+ "insertCommand": "Insert command {{name}}",
+ "insertResource": "Insert resource {{name}}",
+ "openMicPermission": "Open microphone settings",
+ "maxAttachments": "You can add up to {{max}} attachments.",
+ "voiceStopRecording": "Stop Recording",
+ "capabilitiesUnsupported": "Unsupported remote capability format"
+ },
+ "screen": {
+ "composerSyncing": "Syncing session data; you can send once it finishes.",
+ "composerCreating": "Creating the session; you can keep sending after the first message goes out.",
+ "nextAgentSwitch": "Next switches to {{agent}} · {{model}}",
+ "createFailedTitle": "Session Creation Failed",
+ "createFailedDefault": "Session creation failed.",
+ "createFailedNotice": "Session creation failed: {{message}}",
+ "backToEdit": "Back to Edit",
+ "retry": "Retry",
+ "firstMessageNotSent": "The first message wasn't sent; its content has been restored to the input box.",
+ "locateMessageNotFound": "Couldn't find the message to jump to.",
+ "shareNoLocalImage": "Couldn't get the local image file",
+ "shareFailedTitle": "Share Failed",
+ "shareUnsupported": "This app version doesn't support sharing yet; update to the latest version and try again.",
+ "downloadFailed": "Download failed",
+ "voiceNoRemoteDevice": "No remote device available; can't start voice input.",
+ "voiceSenderNotReady": "The message sender isn't ready.",
+ "voiceStopAndSend": "End voice input and send",
+ "sendMessage": "Send remote message",
+ "voiceStartInput": "Start voice input",
+ "stopSession": "Stop remote session",
+ "sessionNotFoundResync": "Couldn't find the current remote session; sync again before sending.",
+ "missingWorkingDir": "This session has no working directory; can't send messages.",
+ "queueMessageGone": "This queued message is no longer in the queue; your changes weren't saved.",
+ "editQueueUnsupported": "The computer's version is too old to safely edit queued references, attachments, or clear text. Update the computer, or edit plain text only.",
+ "sessionNotSyncedRetry": "The session hasn't finished syncing; try again shortly.",
+ "savingPreviousQueueEdit": "Saving the previous queued message edit; edit again once it finishes.",
+ "attachmentsUploadingBeforeEdit": "Attachments are still uploading; edit the queued message after they finish.",
+ "goalAlreadyActive": "This session already has an active goal; handle it here first.",
+ "resetReconfirmTitle": "Confirm Again",
+ "resetOfferExpired": "The reset credential has expired; review the refreshed quota info.",
+ "resetOutcomeReset": "The Codex usage window has been reset.",
+ "resetOutcomeNothing": "There's no usage window that needs resetting right now.",
+ "resetOutcomeNoCredit": "You have no reset credits available.",
+ "resetOutcomeAlready": "This reset request was already processed; usage has been refreshed.",
+ "resetDoneTitle": "Reset Complete",
+ "resetResultTitle": "Reset Result",
+ "resetFailedTitle": "Reset Failed",
+ "operationFailed": "Operation Failed",
+ "sessionDeviceNotFound": "Couldn't find the computer this session belongs to; make sure the device is connected and try again.",
+ "deleteMessageTitle": "Delete this message?",
+ "deleteMessageBody": "Deleting a user message removes only that message; deleting an AI message removes the entire turn generated after the previous user input. Later messages are kept. On your next send, the AI context is rebuilt from the remaining records.",
+ "deleteMessageAction": "Delete this message",
+ "readingCapabilities": "Reading {{agent}} capabilities…",
+ "editingQueueMessageNumbered": "Editing queued message #{{index}}",
+ "editingQueueMessage": "Editing queued message",
+ "discardQueueEdit": "Discard queued message edit",
+ "savingHint": "Saving changes; wait until it finishes.",
+ "composerPlaceholder": "Type a remote message",
+ "openSessionMenu": "Open session menu",
+ "searchTitle": "Search this session",
+ "searchPlaceholder": "Search messages in this session",
+ "searchEnterKeyword": "Enter a keyword",
+ "searchNoMatch": "No matching messages",
+ "searchPrevious": "Previous result",
+ "searchNext": "Next result",
+ "syncingSession": "Syncing session",
+ "awaitingSync": "Waiting for session sync",
+ "resync": "Resync remote session",
+ "collapseHistory": "Collapse history",
+ "expandHistory": "View history",
+ "readOnlyMode": "Read-only",
+ "accessRevokedShort": "Access revoked",
+ "sessionNotSynced": "Session not synced",
+ "conversationFallback": "Conversation",
+ "accessRevoked": "The computer has revoked access",
+ "syncing": "Syncing",
+ "pendingCount": "{{num}} pending",
+ "archived": "Archived",
+ "queuePausedNotice": "Queue paused"
+ },
+ "new": {
+ "selectDevice": "Select a computer",
+ "workspaceDialogue": "Chat",
+ "workspaceProject": "Project",
+ "selectProject": "Select a project",
+ "composerPlaceholder": "What should we work on today?",
+ "voiceSelectDeviceFirst": "Select a computer before using voice input.",
+ "creatingSession": "Creating session",
+ "createAndSend": "Create session and send first message",
+ "modelAccessibility": "Model: {{model}}",
+ "voiceInput": "Voice input",
+ "selectDeviceError": "Select a computer.",
+ "enterProjectPath": "Enter the project path on the computer.",
+ "enterModel": "Enter a model.",
+ "enterFirstMessageOrAttachment": "Enter a first message or add an attachment.",
+ "noSessionIdReturned": "The computer didn't return a new session ID.",
+ "sessionIdNotAdopted": "The computer didn't use the pre-generated session ID (its version is out of date). Update the computer and try again.",
+ "firstMessageMissingConfirm": "The first message wasn't sent; its content has been restored to the input box. Before sending, make sure this message isn't already in the session.",
+ "firstMessageUnconfirmed": "The first message's send status is unconfirmed; its content has been restored to the input box. Check whether it's already in the session before sending.",
+ "selectControlledDevice": "Select the controlled computer",
+ "selectDeviceNamed": "Select computer {{name}}",
+ "selectAgent": "Select agent",
+ "switchToAgent": "Switch to {{label}}",
+ "selectWorkspace": "Select workspace",
+ "dialogueNoProject": "Chat (no project)",
+ "selectProjectNamed": "Select project {{title}}",
+ "noProjects": "No projects yet",
+ "chooseOtherFolder": "Choose another project folder",
+ "readingRemoteDir": "Reading remote directory...",
+ "goParentDir": "Go to parent directory",
+ "parentDir": "Parent",
+ "useCurrentRemoteDir": "Use current remote directory",
+ "useCurrent": "Use Current",
+ "firstMessagePlaceholder": "Enter the first message",
+ "noModelsAvailable": "No models available",
+ "selectDeviceFirst": "Select a computer first",
+ "enterDir": "Open directory {{name}}",
+ "selectDir": "Select directory {{name}}",
+ "select": "Select",
+ "noModelSelected": "No model selected",
+ "assignedDialogueDir": "Directory assigned by the computer",
+ "extraDirsSuffix": "+{{num}} extra dirs",
+ "noProjectPath": "No project path selected",
+ "dialogueWorkspace": "Chat workspace",
+ "previewDevice": "Computer: {{name}}",
+ "unknownDevice": "Unknown device",
+ "previewLocation": "Location: {{target}}",
+ "previewRuntime": "Runtime: {{runtime}}",
+ "previewFirstMessage": "First: {{preview}}",
+ "previewFirstAttachmentOnly": "First: attachments only",
+ "previewFirstEmpty": "First: empty",
+ "previewAttachments": "Attachments: {{num}}",
+ "previewReadyTitle": "Ready to create and send",
+ "previewNotReadyTitle": "Not ready to create yet",
+ "previewReadySubtitle": "Confirming creates the session on the controlled computer and queues the first message."
+ },
+ "menu": {
+ "chipPinned": "Pinned",
+ "chipArchived": "Archived",
+ "chipReadOnly": "Read-only",
+ "titleFallback": "Remote session",
+ "renameAction": "Rename Chat",
+ "copyLinkAction": "Copy Chat Link",
+ "unpin": "Unpin",
+ "pin": "Pin",
+ "restore": "Restore",
+ "archive": "Archive",
+ "deleteAction": "Delete Session",
+ "deleteConversation": "Delete Chat",
+ "workingDir": "Working directory",
+ "aiRenameUnsupported": "The computer's version is too old to support auto-naming yet.",
+ "aiRenameOffline": "The computer is offline; try again later.",
+ "aiRenameFailed": "Auto-naming failed; try again.",
+ "contextUsageSummary": "Context {{percent}}%",
+ "copied": "Copied",
+ "copyFailed": "Copy failed",
+ "deleteConfirmTitle": "Delete session?",
+ "deleteConfirmBody": "This can't be undone.",
+ "dirAlreadyAdded": "This directory is already in the list.",
+ "resetCodexTitle": "Reset Codex usage?",
+ "resetCodexBody": "This uses 1 reset for {{account}}. The quota window reopens immediately and this can't be undone.",
+ "currentCodexAccount": "the current Codex account",
+ "resetConsumeOnce": "Use 1 reset",
+ "titlePlaceholder": "Session title",
+ "aiRenameLabel": "Auto-name with AI",
+ "viewUsageDetail": "View session usage details",
+ "linkCopied": "Link copied",
+ "sessionInfo": "Session Info",
+ "usageSection": "Usage",
+ "refreshContextUsage": "Refresh context usage",
+ "currentSessionSpend": "This session",
+ "noSessionSpend": "No session usage yet",
+ "contextLabel": "Context",
+ "accountLimits": "Account limits",
+ "quotaExhaustedResettable": "Your quota is used up. Resetting uses 1 reset immediately and can't be undone.",
+ "resetting": "Resetting…",
+ "resetCodexUsage": "Reset Codex usage",
+ "quotaExhaustedNoCredit": "Your quota is used up, but you have no reset credits available.",
+ "openDir": "Open Directory",
+ "copyPath": "Copy Path",
+ "extraDirsSection": "Additional reference directories",
+ "noExtraDirs": "No additional directories yet. They're provided as extra context to the agent on the controlled computer.",
+ "remove": "Remove",
+ "collapseRemoteDir": "Collapse remote directory",
+ "browseRemoteDir": "Browse remote directory",
+ "reading": "Reading…",
+ "parentDir": "Parent",
+ "addCurrentDir": "Add current directory",
+ "enterRemoteDir": "Open remote directory {{name}}",
+ "add": "Add",
+ "noSubDirs": "This directory has no subdirectories to open.",
+ "dirLimitNotice": "Showing the first 30 directories only; open a more specific directory to keep choosing.",
+ "confirmRename": "Confirm rename",
+ "confirm": "Confirm",
+ "cancelRename": "Cancel rename",
+ "backToMenu": "Back to session menu"
+ },
+ "tail": {
+ "interrupted": "The app exited mid-task, so it was interrupted.",
+ "continueTask": "Continue Task",
+ "retry": "Retry",
+ "ignore": "Ignore",
+ "codexThreadLost": "The Codex auth mode changed, so this session can't continue — start a new session to apply it.",
+ "encryptedContentInvalid": "Switching providers made the encryption unavailable, so this session works only under the original provider. Handle it on the computer (you can Fork to drop the encrypted protocol content and continue in a new session)."
+ },
+ "row": {
+ "moreOptions": "More options",
+ "archiveConversation": "Archive chat",
+ "closeActionMenu": "Close session actions menu",
+ "referenceAroundAnchor": "Around the link",
+ "referenceRecent": "Recent messages",
+ "referenceCount": "{{num}} messages",
+ "referenceTruncated": "Truncated",
+ "pinnedSection": "Pinned",
+ "extraDirsSummary": "{{num}} additional directories",
+ "noExtraDirsSummary": "No additional directories",
+ "attachmentUploadFailed": "Attachment upload failed; retry or delete this message.",
+ "authGateHint": "{{agent}} has no connected model provider on this computer, so sending will fail. Set it up in {{appName}} on the computer under Settings → Model Providers."
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/en/settings.json b/apps/mobile/src/i18n/locales/en/settings.json
new file mode 100644
index 0000000000..e542cdc400
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/en/settings.json
@@ -0,0 +1,113 @@
+{
+ "title": "Settings",
+ "language": {
+ "title": "Language",
+ "hint": "Affects the app UI only. Agent replies follow the agent's own language settings.",
+ "options": {
+ "system": "Auto (follow system)",
+ "zh-CN": "简体中文",
+ "en": "English",
+ "ja": "日本語",
+ "ko": "한국어"
+ }
+ },
+ "version": {
+ "sectionTitle": "Version",
+ "currentLabel": "Current Version",
+ "bundleVersion": "App package {{version}}",
+ "otaVersion": "OTA version {{version}}",
+ "desktopVersion": "Desktop {{version}}",
+ "devNoOta": "Development build; OTA updates unavailable",
+ "checkAction": "Check for Updates",
+ "checking": "Checking",
+ "updating": "Updating",
+ "checkingAccessibility": "Checking for updates",
+ "bundleUpdateFound": "App package update available",
+ "upToDate": "Already up to date",
+ "bundleUpToDateNoOta": "App package is up to date; this version does not support OTA updates",
+ "downloadedRestarting": "Update downloaded, restarting",
+ "bundleCheckFailed": "Could not check for app package updates. Try again later.",
+ "checkFailedDetail": "Update check failed: {{detail}}",
+ "checkFailed": "Update check failed. Try again later."
+ },
+ "notifications": {
+ "sectionTitle": "Notifications",
+ "taskDone": "Task Completion Notifications",
+ "taskDoneHint": "Get a push on this phone when a task on your computer finishes, fails, or needs your reply. Completion and reply alerts include the latest response.",
+ "permissionDenied": "Notifications are turned off in system settings. Allow notifications in iOS Settings → Notifications → {{appName}}, then try again.",
+ "unregisterQueued": "Turned off. Could not unregister on the current network; it will finish automatically next time you're online."
+ },
+ "about": {
+ "sectionTitle": "About This Phone",
+ "deviceName": "Device Name",
+ "deviceNameDetail": "This name appears in the authorization list on your computer.",
+ "platform": "Platform",
+ "remoteControl": "Remote Control",
+ "remoteControlValue": "Managed on desktop",
+ "remoteControlDetail": "This phone acts only as a controller. Granting, revoking, and restoring control permissions is done in desktop settings.",
+ "editAccessibility": "Edit {{label}}"
+ },
+ "relay": {
+ "online": "Relay connected",
+ "connecting": "Connecting to Relay",
+ "stopped": "Relay not connected",
+ "lastSynced": "Last synced {{time}}",
+ "canSync": "Remote sessions can sync.",
+ "reconnectHint": "Remote sessions will resubscribe automatically when the network recovers.",
+ "resumeHint": "The connection resumes when you return to the app or sign in again."
+ },
+ "header": {
+ "notSignedIn": "Not signed in",
+ "thisPhone": "This phone"
+ },
+ "debug": {
+ "sectionTitle": "Debug / Developer",
+ "userId": "User ID",
+ "notSynced": "Not synced",
+ "deviceId": "Device ID",
+ "initializing": "Initializing",
+ "authServer": "Auth Server",
+ "authRegion": "Sign-in Region"
+ },
+ "updateInfo": {
+ "embedded": "With app package",
+ "unknown": "Unknown",
+ "source": "Running Source",
+ "sourceEmbedded": "Embedded (with app package)",
+ "sourceOta": "OTA update",
+ "updateId": "Update ID",
+ "updatedAt": "Updated At",
+ "channel": "Channel",
+ "runtime": "Runtime",
+ "otaMarker": "OTA Marker"
+ },
+ "legal": {
+ "sectionTitle": "Legal",
+ "privacyPolicy": "Privacy Policy",
+ "view": "View",
+ "openPrivacyPolicy": "Open the privacy policy",
+ "appFilingNumber": "App Filing Number"
+ },
+ "account": {
+ "logoutHint": "Signing out only clears the sign-in state and local remote mirror on this phone. Sessions on your computer are not affected.",
+ "logout": "Sign Out",
+ "loggingOut": "Signing out",
+ "loggingOutAccessibility": "Signing out"
+ },
+ "copyRow": {
+ "action": "Copy",
+ "done": "Copied",
+ "accessibility": "Copy {{label}}"
+ },
+ "deviceNameEditor": {
+ "screenTitle": "Device Name",
+ "placeholder": "Phone name",
+ "resetAccessibility": "Restore the default phone name",
+ "emptyError": "Device name cannot be empty.",
+ "deviceInitializing": "The device is still initializing. Try again later.",
+ "saving": "Saving…",
+ "saved": "Saved.",
+ "restoringDefault": "Restoring the default name…",
+ "restoredDefault": "Restored the default name."
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/en/shared.json b/apps/mobile/src/i18n/locales/en/shared.json
new file mode 100644
index 0000000000..7d2c32c2fa
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/en/shared.json
@@ -0,0 +1,6 @@
+{
+ "back": "Back",
+ "syncing": "Syncing",
+ "selectOption": "Select {{label}}",
+ "closePanel": "Close panel"
+}
diff --git a/apps/mobile/src/i18n/locales/en/startup.json b/apps/mobile/src/i18n/locales/en/startup.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/en/startup.json
@@ -0,0 +1 @@
+{}
diff --git a/apps/mobile/src/i18n/locales/en/update.json b/apps/mobile/src/i18n/locales/en/update.json
new file mode 100644
index 0000000000..65b1a6e947
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/en/update.json
@@ -0,0 +1,17 @@
+{
+ "installHintTitle": "Installing Update",
+ "installHintBody": "After tapping Install in the system dialog, return to the home screen to watch the download progress. The system replaces the current version automatically once the download finishes.",
+ "openInstallFailedTitle": "Couldn't Open the Install Link",
+ "openInstallFailedBody": "Copy the install address manually and open it in Safari.",
+ "bundleAvailableBody": "A new version is available. Download and install the full app package to update.",
+ "releaseNotes": "\nWhat's new:\n{{notes}}",
+ "forcedTitle": "Update Required",
+ "goUpdate": "Update",
+ "newVersionTitle": "New Version Available",
+ "later": "Later",
+ "upToDateTitle": "You're Up to Date",
+ "upToDateBody": "You already have the latest app package.",
+ "checkFailedTitle": "Check Failed",
+ "checkFailedBody": "Couldn't reach the update server. Try again later.",
+ "latestRequestFailed": "latest request failed: HTTP {{status}}"
+}
diff --git a/apps/mobile/src/i18n/locales/ja/apiErrors.json b/apps/mobile/src/i18n/locales/ja/apiErrors.json
new file mode 100644
index 0000000000..c97df6cf4a
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ja/apiErrors.json
@@ -0,0 +1,6 @@
+{
+ "requestTimeout": "リクエストがタイムアウトしました。しばらくしてからもう一度お試しください。",
+ "networkUnavailable": "ネットワークに接続できません。接続を確認してからもう一度お試しください。{{webHint}}",
+ "networkUnavailableWebHint": "Web プレビューはブラウザーの CORS により遮断される場合があります。Expo Go またはシミュレーターでお試しください。",
+ "requestFailed": "リクエストに失敗しました"
+}
diff --git a/apps/mobile/src/i18n/locales/ja/composer.json b/apps/mobile/src/i18n/locales/ja/composer.json
new file mode 100644
index 0000000000..82bf3651b9
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ja/composer.json
@@ -0,0 +1,103 @@
+{
+ "input": {
+ "resize": {
+ "increaseHeight": "入力欄の高さを広げる",
+ "decreaseHeight": "入力欄の高さを狭める",
+ "hint": "上下にドラッグして入力欄の高さを調整",
+ "label": "入力欄の高さ調整"
+ }
+ },
+ "attachments": {
+ "viewImage": "画像 {{name}} を表示",
+ "removeAttachment": "添付ファイル {{name}} を削除",
+ "retryUpload": "{{name}} のアップロードを再試行",
+ "retry": "再試行",
+ "removeFailed": "失敗した添付ファイル {{name}} を削除",
+ "cancelUpload": "{{name}} のアップロードをキャンセル",
+ "uploadFailed": "{{name}} · アップロード失敗",
+ "collapsedBadge": "添付ファイル {{count}} 件、タップして展開",
+ "imageNotAnnotatable": "この画像は注釈や転送に対応していません。",
+ "downloadOriginalFailed": "元の画像をダウンロードできませんでした(HTTP {{status}})。",
+ "annotationSaveFailed": "注釈を保存できませんでした",
+ "tryAgain": "もう一度お試しください。",
+ "sendToChat": "チャットに送信",
+ "save": "保存",
+ "fileNotFound": "ファイルが見つかりません",
+ "pathNotReadable": "このパスは読み取りが許可されていません",
+ "readFailed": "読み取りに失敗しました",
+ "notFetchableMedia": "取得できるデスクトップメディアではありません",
+ "mediaResultInvalid": "リモートメディアの取得結果が無効です",
+ "mediaUrlInvalid": "リモートメディアのダウンロードURLが無効です",
+ "mediaCacheMiss": "リモートメディアのキャッシュにありません(cachedOnly)",
+ "mediaFetchCancelled": "リモートメディアの取得をキャンセルしました",
+ "fileMenu": {
+ "openBrowser": "ファイルブラウザーを開く",
+ "sendToSession": "セッションに送信",
+ "copyPath": "パスをコピー",
+ "quickPreview": "クイックプレビュー",
+ "revealInBrowser": "ファイルブラウザーで表示",
+ "share": "エクスポート / 共有",
+ "folder": "フォルダー",
+ "file": "ファイル"
+ }
+ },
+ "upload": {
+ "emptyFile": "このファイルは空のため、添付ファイルとして送信できません。",
+ "fileTooLarge": "ファイルが {{size}} MB を超えているため、現在は添付ファイルとして送信できません。",
+ "cancelled": "添付ファイルのアップロードをキャンセルしました。",
+ "incompleteRead": "ファイルの読み取りが不完全です。予期: {{expected}} バイト、実際: {{actual}} バイト。",
+ "integrityUnavailable": "この添付ファイルのアップロード本文は整合性チェックができません。",
+ "sizeChanged": "添付ファイルのサイズが変更されました。予期: {{expected}} バイト、実際: {{actual}} バイト。",
+ "invalidSize": "添付ファイルのサイズが無効なため、整合性ダイジェストを計算できません。",
+ "invalidBase64": "添付ファイルのチャンクが有効なbase64ではありません。",
+ "failedHttp": "添付ファイルのアップロードに失敗しました: HTTP {{status}}{{code}}",
+ "failedNetwork": "添付ファイルのアップロードに失敗しました。ネットワーク転送エラーです。接続を確認してからやり直してください。({{detail}})",
+ "timeout": "添付ファイルのアップロードがタイムアウトしました。接続を確認してからやり直してください。",
+ "fileTypeUnsupported": "このローカルファイルの種類はまだ添付ファイルとして送信できません。",
+ "snapshotFailedNoCacheDir": "添付ファイルのスナップショットを作成できません: キャッシュディレクトリが利用できません",
+ "snapshotFailed": "添付ファイルのスナップショットを作成できません",
+ "invalidUploadUrl": "サーバーから有効な添付ファイルのアップロードURLが返されませんでした。",
+ "noImageRead": "アップロードできる画像を読み取れませんでした。",
+ "emptyImage": "この画像は空のため、添付ファイルとして送信できません。",
+ "imageTooLarge": "画像が {{size}} MB を超えているため、現在は添付ファイルとして送信できません。",
+ "imageTooLargeSend": "画像が {{size}} MB を超えているため、現在は送信できません。",
+ "sessionExpiredImage": "ログインの有効期限が切れました。再度ログインしてから画像をアップロードしてください。",
+ "sessionExpiredFile": "ログインの有効期限が切れました。再度ログインしてから添付ファイルをアップロードしてください。",
+ "pasteTimeout": "画像の貼り付け処理がタイムアウトしました。もう一度お試しください。",
+ "clipboardReadFailed": "クリップボードの画像を読み取れませんでした。もう一度コピーしてから貼り付けてください。",
+ "maxAttachments": "添付ファイルは最大 {{count}} 件まで追加できます。",
+ "simulatorNoCamera": "シミュレーターにはカメラがありません。「写真」からライブラリを選択してください。",
+ "cameraPermission": "カメラのアクセスがオフです。システム設定で {{appName}} にカメラの使用を許可してください。",
+ "photoPermission": "写真のアクセスがオフです。システム設定で {{appName}} に写真へのアクセスを許可してください。",
+ "noFileRead": "アップロードできるファイルを読み取れませんでした。"
+ },
+ "voice": {
+ "recordingEmpty": "録音が空のため、文字起こしできません。",
+ "recordingTooLarge": "録音が上限の {{size}}MB を超えています。",
+ "invalidUploadUrl": "サーバーから有効な音声のアップロードURLが返されませんでした。",
+ "uploadFailed": "音声のアップロードに失敗しました: HTTP {{status}} {{statusText}}",
+ "refineFailed": "音声の推敲に失敗しました",
+ "refineResponseTooLarge": "音声推敲の応答が上限の {{max}} 文字を超えています。",
+ "refineStreamFailed": "音声推敲のストリーミング応答に失敗しました。",
+ "refineNoContent": "音声推敲から有効な内容が返されませんでした。",
+ "refineInvalidJson": "音声推敲から無効なJSONが返されました: {{snippet}}",
+ "invalidSession": "音声サービスから無効なセッションが返されました。",
+ "managedRefineUnsupported": "現在の {{appName}} 音声サービスはマネージド推敲に対応していません。",
+ "sessionNotConnected": "音声認識セッションがまだ接続されていません。",
+ "loginRequired": "音声入力を使用する前に {{appName}} にログインしてください。",
+ "serviceUnavailable": "現在の地域では {{appName}} 音声サービスが設定されていません。",
+ "realtimeUnsupported": "モバイル版のリアルタイム音声は {{detail}} ASR にまだ対応していません。",
+ "realtimeAuthUnsupported": "モバイル版のリアルタイム音声は {{auth}} ASR 認証にまだ対応していません。",
+ "realtimeProtocolUnsupported": "モバイル版のリアルタイム音声は {{detail}} ASR プロトコルにまだ対応していません。",
+ "missingConnectionProvider": "モバイル音声入力には {{appName}} の音声セッションチケットが必要です(connectionProvider がありません)。",
+ "realtimeAsrFailed": "リアルタイム音声認識に失敗しました。",
+ "volcengineAuthUnsupported": "モバイル版の Volcengine 音声は {{auth}} 認証にまだ対応していません。",
+ "volcengineMissingResourceId": "Volcengine ASR の設定に resourceId がありません。",
+ "sessionExpiredOrForbidden": "{{appName}} の音声セッションが失効したか権限がありません(WebSocket {{status}})。ログイン状態を確認してからやり直してください。",
+ "incomplete": "音声入力が完了しませんでした。もう一度お試しください。",
+ "missingRefinerTargetProvider": "モバイル版の音声推敲には {{appName}} の音声セッションが必要です(refinerTargetProvider がありません)。",
+ "emptyTranscript": "音声を検出しましたが、テキストを認識できませんでした。もう一度お試しください。",
+ "micPermission": "マイクの権限が許可されていません。システム設定で {{appName}} にマイクの使用を許可してください。",
+ "realtimeAudioUnavailable": "現在のビルドはリアルタイム音声入力に対応していません。ネイティブ録音モジュールを含むテストビルドをインストールしてください。"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/ja/deviceLink.json b/apps/mobile/src/i18n/locales/ja/deviceLink.json
new file mode 100644
index 0000000000..28e101b0b3
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ja/deviceLink.json
@@ -0,0 +1,18 @@
+{
+ "syncFailed": "同期に失敗しました",
+ "resync": "再同期",
+ "resyncing": "再同期しています",
+ "syncShort": "同期",
+ "connectStep1": "パソコンに {{appName}} をインストールして起動する",
+ "connectStep2": "スマートフォンと同じアカウントでログインする",
+ "connectStep3": "「設定 → リモート接続」で「同じアカウントのデバイスにこのパソコンの操作を許可」をオンにする",
+ "brandEyebrow": "Cindy モバイル",
+ "cloudTeaserTitle": "クラウド版 {{appName}} を準備中",
+ "cloudTeaserCopy": "公開後はパソコンがなくても、モバイルアプリだけで利用できます。",
+ "sectionFirstRun": "はじめに",
+ "sectionOffline": "接続したパソコン",
+ "sectionRemoteDisabled": "パソコンで操作",
+ "sectionAccessRevoked": "再度の許可が必要",
+ "retryAccess": "アクセスを再試行",
+ "recheck": "再確認"
+}
diff --git a/apps/mobile/src/i18n/locales/ja/devices.json b/apps/mobile/src/i18n/locales/ja/devices.json
new file mode 100644
index 0000000000..58c92eb6db
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ja/devices.json
@@ -0,0 +1,328 @@
+{
+ "common": {
+ "cancel": "キャンセル",
+ "save": "保存",
+ "saving": "保存中",
+ "delete": "削除",
+ "deleting": "削除中",
+ "create": "新規"
+ },
+ "list": {
+ "thisComputer": "このパソコン",
+ "allConversations": "すべての会話",
+ "syncFailed": "同期に失敗しました",
+ "requestFailed": "リクエストに失敗しました",
+ "loading": "操作可能なパソコンを読み込み中",
+ "untitled": "無題の会話",
+ "connection": {
+ "connecting": "接続中",
+ "disconnected": "切断されました"
+ },
+ "error": {
+ "sessionDeviceNotFound": "この会話が属するパソコンが見つかりません。再同期してからもう一度お試しください。",
+ "taskDeviceNotFound": "このタスクが属するパソコンが見つかりません。再同期してからもう一度お試しください。",
+ "noDevice": "利用できるパソコンがありません。デスクトップでリモート操作をオンにしてから、再同期してください。"
+ },
+ "alert": {
+ "actionFailed": "操作に失敗しました",
+ "renameFailed": "名前の変更に失敗しました",
+ "deleteTitle": "会話を削除しますか?",
+ "deleteMessage": "「{{title}}」を削除します。削除すると元に戻せません。"
+ },
+ "a11y": {
+ "selectScope": "会話の範囲を選択",
+ "openSettings": "設定を開く",
+ "syncing": "再同期中",
+ "sync": "再同期",
+ "pinnedConversations": "ピン留めした会話 {{count}} 件",
+ "newRemoteConversation": "新しいリモート会話",
+ "renameDevice": "{{label}} の名前を変更",
+ "project": "プロジェクト {{title}}",
+ "openAutomationLatest": "自動化タスク {{title}} の最新セッションを開く",
+ "automationTask": "自動化タスク {{title}}",
+ "openConversation": "会話 {{title}} を開く",
+ "collapse": "{{title}} を折りたたむ",
+ "expand": "{{title}} を展開",
+ "taskError": "タスクでエラー",
+ "awaitingYou": "対応待ち",
+ "doneUnread": "完了・未読",
+ "running": "実行中",
+ "close": "閉じる",
+ "cancelRename": "名前の変更をキャンセル"
+ },
+ "menu": {
+ "groupByProject": "プロジェクトごとにグループ化"
+ },
+ "renameDevice": {
+ "title": "デバイス名を変更",
+ "placeholder": "デバイス名",
+ "savingA11y": "デバイス名を保存中",
+ "saveA11y": "デバイス名を保存"
+ },
+ "renameSession": {
+ "title": "会話の名前を変更",
+ "placeholder": "会話のタイトル",
+ "savingA11y": "会話のタイトルを保存中",
+ "saveA11y": "会話のタイトルを保存"
+ },
+ "revoked": {
+ "title": "アクセス権が取り消されました",
+ "body": "「{{deviceName}}」がこの端末のリモートアクセスを取り消しました。そのパソコンの {{appName}} 設定でこの端末を再度承認し、「再試行」をタップしてください。",
+ "retry": "再試行"
+ },
+ "viewAllConversations": "すべての会話 {{count}} 件を表示",
+ "viewAllRuns": "すべての実行 {{count}} 回を表示",
+ "preview": {
+ "needAttention": "要対応 {{count}} 件",
+ "waiting": "対応待ち {{count}} 件",
+ "automationRunning": "自動化を実行中",
+ "totalRuns": "全 {{count}} 回の実行"
+ }
+ },
+ "detail": {
+ "filter": {
+ "active": "アクティブ",
+ "waiting": "対応待ち",
+ "automation": "自動化",
+ "archived": "アーカイブ",
+ "all": "すべて",
+ "a11y": "{{label}} の会話で絞り込み"
+ },
+ "group": {
+ "project": "プロジェクト",
+ "date": "日付",
+ "label": "グループ",
+ "a11y": "{{label}} でグループ化"
+ },
+ "metric": {
+ "active": "アクティブ",
+ "waiting": "対応待ち",
+ "automation": "自動化",
+ "activeA11y": "アクティブな会話で絞り込み",
+ "waitingA11y": "対応待ちの会話で絞り込み",
+ "automationA11y": "自動化の会話で絞り込み"
+ },
+ "plan": "スケジュール",
+ "automationsButtonA11y": "リモート自動化を開く",
+ "search": {
+ "openA11y": "リモート会話を検索",
+ "closeA11y": "リモート会話の検索を閉じる",
+ "label": "検索",
+ "placeholder": "タイトル、プロジェクト、モデル、メッセージを検索",
+ "clearA11y": "検索をクリア",
+ "closeInputA11y": "検索を閉じる",
+ "clear": "クリア",
+ "close": "閉じる"
+ },
+ "filters": {
+ "collapseA11y": "会話の絞り込みを折りたたむ",
+ "expandA11y": "会話の絞り込みを展開",
+ "label": "絞り込み"
+ },
+ "selection": {
+ "count": "{{count}} 件の会話を選択中",
+ "canAct": "実行できる操作あり",
+ "cannotAct": "実行できる操作なし",
+ "clearA11y": "会話の選択を解除"
+ },
+ "bulk": {
+ "pinning": "ピン留め中",
+ "unpinning": "解除中",
+ "archiving": "アーカイブ中",
+ "restoring": "復元中",
+ "deleting": "削除中",
+ "pinA11y": "選択した会話を一括でピン留め",
+ "unpinA11y": "選択した会話のピン留めを一括で解除",
+ "archiveA11y": "選択した会話を一括でアーカイブ",
+ "restoreA11y": "選択した会話を一括で復元",
+ "deleteA11y": "選択した会話を一括で削除",
+ "cancelA11y": "一括操作をキャンセル",
+ "partialFailure": "{{done}} 件を処理し、{{failed}} 件が失敗しました(復元済みで再試行できます)。",
+ "noArchivable": "選択の中にアーカイブできるアクティブな会話がありません。",
+ "noPinnable": "選択の中にピン留めできるアクティブな会話がありません。",
+ "noRestorable": "選択の中に復元できるアーカイブ済み会話がありません。",
+ "noUnpinnable": "選択の中にピン留め済みの会話がありません。",
+ "noDeletable": "選択の中に削除できる会話がありません。",
+ "noneModifiable": "選択した会話はいずれも変更できません。"
+ },
+ "automationScope": {
+ "eyebrow": "自動化タスク",
+ "title": "自動化タスク",
+ "emptyCopy": "タスクを実行すると、各実行のセッションがここに表示されます。",
+ "emptyTitle": "このタスクにはまだ実行履歴がありません"
+ },
+ "projectScope": {
+ "eyebrow": "プロジェクト",
+ "emptyCopy": "このプロジェクトで新しい会話を始めましょう。",
+ "emptyTitle": "このプロジェクトにはまだ会話がありません"
+ },
+ "subtitle": {
+ "deviceActive": "{{deviceName}} · アクティブな会話 {{count}} 件",
+ "activeAndProjects": "アクティブな会話 {{count}} 件 · プロジェクト {{projects}} 件"
+ },
+ "row": {
+ "a11yAutomationGroup": "自動化会話グループ {{title}}",
+ "a11ySession": "会話 {{title}}",
+ "a11yCollapse": "{{title}} を折りたたむ",
+ "a11yExpand": "{{title}} を展開",
+ "collapse": "折りたたむ",
+ "expand": "展開"
+ },
+ "badge": {
+ "waiting": "対応待ち {{count}}",
+ "automationPrefix": "自動化",
+ "sessionCount": "{{count}} 件の会話",
+ "aggregate": "集約",
+ "running": "実行中",
+ "unread": "未読 {{count}}"
+ },
+ "child": {
+ "openA11y": "自動化会話 {{title}} を開く"
+ },
+ "viewAllRuns": "すべての実行 {{count}} 回を表示"
+ },
+ "automations": {
+ "error": {
+ "projectMissingConfig": "プロジェクト自動化に projectConfigId がありません。デスクトップで削除してください。",
+ "deletePartial": "自動化を削除しましたが、{{count}} 件の生成された会話の状態を更新できませんでした。デスクトップでこれらの会話を確認してください。"
+ },
+ "subtitle": "実行中 {{active}} 件 · タスク {{total}} 件",
+ "metric": {
+ "running": "実行中",
+ "unreadResults": "未読の結果",
+ "executing": "処理中"
+ },
+ "summary": {
+ "paused": "{{count}} 件のタスクが一時停止中です。タスクを選ぶと実行・一時停止・編集や最近のセッションを開けます。",
+ "default": "タスクを選ぶと実行・一時停止・編集や最近のセッションを開けます。"
+ },
+ "empty": {
+ "copy": "最初の自動化タスクをスマホから直接作成するか、デスクトップで作成してここに同期できます。",
+ "title": "このパソコンには自動化がありません"
+ },
+ "createAutomation": "自動化を新規作成",
+ "recentRuns": "最近の実行",
+ "runs": {
+ "emptyCopy": "Run now をタップすると、新しい実行がここに表示されます。",
+ "emptyTitle": "まだ実行記録がありません"
+ },
+ "form": {
+ "title": {
+ "create": "自動化を新規作成",
+ "edit": "自動化を編集"
+ },
+ "sessionMode": {
+ "bound": "既存のセッションにひも付けると、ディレクトリ、worktree、Agent、Fast モードがそのセッションに従います。",
+ "persistent": "最初のトリガーで継続セッションを作成し、以降のトリガーは同じセッションに続けます。",
+ "fresh": "トリガーごとに新しいセッションを作成します。"
+ },
+ "field": {
+ "name": "名前",
+ "prompt": "プロンプト",
+ "trigger": "トリガー方式",
+ "runSession": "実行セッション",
+ "boundSession": "ひも付けセッション",
+ "intervalMinutes": "間隔(分)",
+ "workspace": "ワークスペース",
+ "projectDir": "プロジェクトディレクトリ",
+ "model": "モデル",
+ "effort": "推論の強度",
+ "timezone": "タイムゾーン"
+ },
+ "namePlaceholder": "例:毎日のプロジェクト点検",
+ "scriptHint": "これはスクリプトのみのタスクです。スクリプト設定はデスクトップでのみ編集できます。ここでは名前、トリガー方式、通知などのその他の項目を変更できます。",
+ "promptPlaceholder": "毎回の自動実行で {{appName}} に何をさせたいかを明確に書いてください",
+ "trigger": {
+ "recurring": "定期",
+ "manual": "手動"
+ },
+ "session": {
+ "fresh": "新しいセッション",
+ "persistent": "継続",
+ "bound": "ひも付け"
+ },
+ "boundSessionA11y": "セッション {{name}} をひも付け",
+ "intervalPlaceholder": "空欄の場合は cron を使用",
+ "workspace": {
+ "project": "プロジェクト",
+ "dialogue": "会話"
+ },
+ "useWorktree": "worktree を使用",
+ "modelPlaceholderBound": "セッションに従う",
+ "fastMode": "Fast モード",
+ "notifyDesktop": "デスクトップ通知",
+ "notifyFeishu": "Feishu 通知",
+ "savingA11y": "自動化を保存中",
+ "saveA11y": "自動化を保存",
+ "cancelA11y": "自動化の編集をキャンセル"
+ },
+ "delete": {
+ "counting": "この自動化が生成した会話を集計中...",
+ "confirmDeleteBoth": "タスクと会話を削除",
+ "confirmArchive": "タスクを削除して会話をアーカイブ",
+ "confirmTaskOnly": "タスクのみ削除",
+ "title": "{{name}} を削除",
+ "copy": "自動化タスクを削除しても、すでに開始された実行は中断されません。生成された会話は下のオプションに従って処理され、デスクトップと同じ挙動になります。",
+ "optionsA11y": "生成された会話の処理方法を選択",
+ "keepDesc": "この自動化タスクだけを削除し、過去の会話は元のリストに残します。",
+ "keepLabel": "生成された会話を残す",
+ "archiveDesc": "タスクを削除した後、生成された会話をアーカイブに移動します。後で検索できます。",
+ "archiveLabel": "生成された会話をアーカイブ",
+ "deleteDesc": "タスクを削除した後、生成された会話も削除済みとして扱います。この操作はスマホからは元に戻せません。",
+ "deleteLabel": "生成された会話を削除",
+ "cancelA11y": "自動化の削除をキャンセル",
+ "confirmA11y": "自動化の削除を確定"
+ },
+ "pause": {
+ "title": "{{name}} を一時停止",
+ "detailFallback": "一時停止すると、この自動化のトリガーが止まります。",
+ "previewFallback": "実行中の run はありません",
+ "confirmA11y": "自動化の一時停止を確定",
+ "pausing": "一時停止中",
+ "confirm": "一時停止を確定",
+ "cancelA11y": "自動化の一時停止をキャンセル"
+ },
+ "runDelete": {
+ "title": "この実行記録を削除",
+ "copy": "この自動化の実行記録のみを削除します。開いた会話は削除されず、以降の自動トリガーにも影響しません。",
+ "confirmA11y": "実行記録の削除を確定",
+ "confirm": "記録を削除",
+ "cancelA11y": "実行記録の削除をキャンセル"
+ },
+ "template": {
+ "label": "テンプレート",
+ "loadingA11y": "テンプレートを読み込み中",
+ "refreshA11y": "自動化テンプレートを更新",
+ "loading": "読み込み中",
+ "refresh": "更新",
+ "cardA11y": "自動化テンプレート {{name}}",
+ "manualConfig": "手動設定"
+ },
+ "scheduleRowA11y": "自動化タスク {{title}}",
+ "detail": {
+ "promptScriptFallback": "スクリプトのみのタスク。設定はデスクトップでのみ編集できます",
+ "promptEmpty": "タスクのプロンプトが保存されていません",
+ "deleteA11y": "自動化を削除",
+ "runNowA11y": "自動化を今すぐ実行",
+ "running": "実行中",
+ "resumeA11y": "自動化を再開",
+ "pauseA11y": "自動化を一時停止",
+ "resume": "再開",
+ "pause": "一時停止",
+ "editA11y": "自動化を編集",
+ "edit": "編集"
+ },
+ "run": {
+ "openSessionA11y": "自動化セッションを開く",
+ "opening": "開いています",
+ "session": "セッション",
+ "restartA11y": "自動化を再実行",
+ "restarting": "再実行中",
+ "restart": "再実行",
+ "markReadA11y": "実行記録を既読にする",
+ "marking": "マーク中",
+ "markRead": "既読",
+ "deleteA11y": "実行記録を削除"
+ }
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/ja/files.json b/apps/mobile/src/i18n/locales/ja/files.json
new file mode 100644
index 0000000000..eaf96b439d
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ja/files.json
@@ -0,0 +1,90 @@
+{
+ "browser": {
+ "titleFallback": "リモートファイル",
+ "workdirSuffix": " · 作業ディレクトリ",
+ "footerOnline": "接続済み · リアルタイム同期",
+ "footerConnecting": "接続中…",
+ "folderEmpty": "フォルダは空です。",
+ "noWorkdir": "このセッションには作業ディレクトリがないため、ファイルを閲覧できません。",
+ "rootDir": "(ルート)",
+ "copyPath": "パスをコピー",
+ "sendToSession": "セッションに送信",
+ "exportShare": "書き出し / 共有",
+ "preview": "クイックルック",
+ "copiedPath": "パスをコピーしました",
+ "shareFailed": "共有に失敗しました。もう一度お試しください。",
+ "exporting": "パソコンから書き出し中…",
+ "downloadFailed": "ダウンロードに失敗しました",
+ "searchPlaceholder": "検索",
+ "cancel": "キャンセル",
+ "searchModeName": "ファイル名",
+ "searchModeContent": "内容",
+ "searchModeA11y": "{{mode}}で検索",
+ "searchScope": "{{workdir}} 内",
+ "searching": " · 検索中…",
+ "searchingContent": "ファイルの内容を検索中…",
+ "noContentMatch": "一致する内容がありません。",
+ "contentSearchMinChars": "ファイルの内容を検索するには2文字以上入力してください。",
+ "contentSummary": "{{matches}} 件一致 · {{files}} 個のファイル",
+ "contentSummaryTruncated": " · 上限に達したため省略",
+ "indexing": "ファイルのインデックスを作成中…",
+ "noNameMatch": "一致するファイル名がありません。",
+ "nameSearchPrompt": "キーワードを入力してファイル名で検索します。",
+ "nameResultSummary": "{{n}} 件の結果 · 名前で一致",
+ "viewGrid": "グリッド表示",
+ "viewList": "リスト表示",
+ "sortName": "名前で並べ替え",
+ "sortMtime": "更新日で並べ替え",
+ "sortSize": "サイズで並べ替え",
+ "a11yTitleMenu": "パスと表示メニュー",
+ "a11ySearch": "ファイル名を検索",
+ "a11yMore": "その他",
+ "a11yOpenFolder": "フォルダを開く {{name}}",
+ "a11yPreviewFile": "ファイルをプレビュー {{name}}",
+ "a11yClear": "クリア",
+ "a11yCancelSearch": "検索をキャンセル",
+ "a11yPreviewName": "{{name}} をプレビュー",
+ "a11yPreviewNameLine": "{{name}} の {{line}} 行目をプレビュー"
+ },
+ "preview": {
+ "done": "完了",
+ "a11yShare": "書き出して共有",
+ "copyPath": "パスをコピー",
+ "sendToSession": "セッションに送信",
+ "copiedPath": "パスをコピーしました",
+ "exporting": "パソコンから書き出し中…",
+ "downloadFailed": "ダウンロードに失敗しました",
+ "fetchingVideo": "パソコンから動画を取得中…",
+ "fetchingAudio": "パソコンから音声を取得中…",
+ "fetchAvFailed": "取得に失敗しました:{{detail}}",
+ "fetchPdfFailed": "PDF の取得に失敗しました:{{detail}}",
+ "fetchingPdf": "パソコンから PDF を取得中…",
+ "unsupportedType": "この種類はスマートフォンではまだプレビューできません",
+ "oversize": "ファイルがプレビュー上限({{size}})を超えています。オリジナルをダウンロードして表示できます",
+ "oversizeUnknown": "大きすぎます",
+ "binaryFile": "バイナリファイルのため、テキストとしてプレビューできません",
+ "readFailed": "読み込みに失敗しました",
+ "truncated2mb": "ファイルが 2 MB を超えています。先頭 2 MB のみ表示します",
+ "truncatedLines": "先頭 {{lines}} 行のみ表示します",
+ "mdRendered": "レンダリング",
+ "mdSource": "ソース",
+ "mdViewA11y": "{{view}}表示",
+ "a11yViewImage": "画像を拡大表示 {{name}}",
+ "fetchOriginalFailed": "オリジナル画像の取得に失敗しました:{{detail}}",
+ "a11yRetryOriginal": "オリジナル画像の取得を再試行",
+ "retry": "再試行",
+ "fetchingOriginal": "パソコンからオリジナル画像を取得中…",
+ "originalFailedThumb": "オリジナルの取得に失敗しました。現在はサムネイルです",
+ "fetchingOriginalHint": "サムネイル · オリジナルを取得中…",
+ "a11yExportShareFile": "オリジナルファイルを書き出して共有",
+ "exportShare": "書き出し / 共有"
+ },
+ "export": {
+ "exportFailed": "書き出しに失敗しました",
+ "leftPage": "ページを離れたため、書き出しを中止しました",
+ "exportTimeout": "書き出しがタイムアウトしました。もう一度お試しください。"
+ },
+ "gallery": {
+ "cacheMiss": "リモートメディアのキャッシュミス(cachedOnly)"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/ja/home.json b/apps/mobile/src/i18n/locales/ja/home.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ja/home.json
@@ -0,0 +1 @@
+{}
diff --git a/apps/mobile/src/i18n/locales/ja/index.ts b/apps/mobile/src/i18n/locales/ja/index.ts
new file mode 100644
index 0000000000..82fba68991
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ja/index.ts
@@ -0,0 +1,38 @@
+/**
+ * 本 locale 的 catalog 组装:每个区域一个 JSON 文件、一个顶级 key,
+ * 组装成单一 'common' namespace 的资源对象。
+ * 区域清单四语必须一致(与其余 locale 的 index.ts 逐行同构);新增区域时
+ * 四个 locales/<locale>/index.ts 一起加,平价测试会拦截漏改。
+ */
+
+import apiErrors from './apiErrors.json';
+import composer from './composer.json';
+import deviceLink from './deviceLink.json';
+import devices from './devices.json';
+import files from './files.json';
+import home from './home.json';
+import interaction from './interaction.json';
+import message from './message.json';
+import models from './models.json';
+import session from './session.json';
+import settings from './settings.json';
+import shared from './shared.json';
+import startup from './startup.json';
+import update from './update.json';
+
+export default {
+ apiErrors,
+ composer,
+ deviceLink,
+ devices,
+ files,
+ home,
+ interaction,
+ message,
+ models,
+ session,
+ settings,
+ shared,
+ startup,
+ update,
+} as const;
diff --git a/apps/mobile/src/i18n/locales/ja/interaction.json b/apps/mobile/src/i18n/locales/ja/interaction.json
new file mode 100644
index 0000000000..8e4fb33079
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ja/interaction.json
@@ -0,0 +1,149 @@
+{
+ "permission": {
+ "mode": {
+ "default": "デフォルト権限",
+ "acceptEdits": "編集を許可",
+ "plan": "プランモード",
+ "auto": "自動承認",
+ "bypass": "フルアクセス"
+ },
+ "pickerSelect": "権限モード {{mode}} を選択",
+ "armedRiskWarning": "確認した後にのみ決定がパソコンへ送信されます。",
+ "armedHighRiskTitle": "高リスク操作を確認",
+ "kind": "権限",
+ "deny": "拒否",
+ "denyAccessibility": "権限リクエストを拒否",
+ "alwaysAllow": "このセッションで常に許可",
+ "alwaysAllowAccessibility": "このセッションで権限リクエストを常に許可",
+ "alwaysAllowConfirm": "このセッションで許可を確認",
+ "allowOnce": "1回だけ許可",
+ "allowOnceAccessibility": "権限リクエストを1回だけ許可",
+ "allowOnceConfirm": "1回だけ許可を確認",
+ "highRisk": "高リスク"
+ },
+ "planMode": {
+ "label": "プランモード",
+ "exit": "プランモードを終了"
+ },
+ "panel": {
+ "readOnlyKind": "確認待ち",
+ "readOnlyTitle": "パソコンで確認を待っています",
+ "pendingRequests": "保留中のリクエスト",
+ "queueSwitchTo": "{{position}}の保留中リクエストに切り替え: {{label}}",
+ "queueSwitchGeneric": "保留中のリクエストを切り替え",
+ "missingRequestId": "このリモート操作には requestId がないため、決定を返信できません。",
+ "issueConfirmUnsupported": "Issue の送信確認はパソコンでのみ行えます。デスクトップアプリに戻って確認またはキャンセルしてください。",
+ "unsupportedType": "このリモート操作タイプはモバイルではまだ対応していません。",
+ "unsupportedKind": "未対応",
+ "awaitingAnswer": "回答待ち",
+ "continueAccessibility": "リモートの質問を続行",
+ "continue": "続行",
+ "askOptionCount": "{{count}} 個の選択肢",
+ "askFreeInput": "自由入力",
+ "askModeMulti": "複数選択",
+ "askModeSingle": "単一選択",
+ "askMetaCaption": "{{options}} · {{mode}} · その他の回答も可",
+ "expandQuestionCard": "質問カードを展開",
+ "collapseQuestionCard": "質問カードを折りたたむ",
+ "selectAnswer": "回答 {{label}} を選択",
+ "submittingHint": "決定をパソコンに送信中です。重複して送信しないでください。",
+ "customAnswerInputAccessibility": "カスタム回答を入力",
+ "customAnswerPlaceholder": "その他の回答を入力",
+ "customAnswerButtonText": "その他の回答を入力...",
+ "answerInput": "回答を入力",
+ "previous": "戻る",
+ "skipAccessibility": "質問をスキップ",
+ "skip": "スキップ",
+ "submitAnswerAccessibility": "回答を送信",
+ "next": "次へ",
+ "answerRequired": "回答を選択または入力すると続行できます。",
+ "submit": "送信",
+ "planReviewTitle": "Claude のプランを確認",
+ "planExpand": "プランを展開",
+ "planEditHint": "編集モードでプランを調整",
+ "planBrowseHint": "セクションをタップして移動",
+ "planEditToggle": "プランを編集",
+ "planEditExit": "プラン編集を終了",
+ "planCollapse": "プランを折りたたむ",
+ "planExpandArea": "プラン閲覧エリアを展開",
+ "planHalf": "ハーフ画面のプランに切り替え",
+ "planEditorAccessibility": "プランエディター",
+ "planEditorPlaceholder": "プランを編集",
+ "planOutline": "目次",
+ "planJumpTo": "プランのセクション {{title}} に移動",
+ "planEmpty": "プランの内容が空です。",
+ "planApproveAccessibility": "プランを承認して実行",
+ "planApprove": "Claude のプランを承認してコーディングを開始",
+ "planFeedbackLabel": "プランのフィードバック",
+ "planFeedbackPlaceholder": "Claude にどうすべきか伝える",
+ "planFeedbackRequired": "送信前にフィードバックを入力してください。",
+ "planFeedbackSubmit": "プランのフィードバックを送信",
+ "planFeedbackAccessibility": "プランを変更するフィードバック"
+ },
+ "rewind": {
+ "readError": "巻き戻しプレビューを読み込めませんでした。再同期してからやり直してください。",
+ "noFilesNote": "ロールバックするファイルはありません。このメッセージ以降の会話履歴のみを切り詰めます。",
+ "moreFiles": "他に {{count}} 件のファイル",
+ "stats": "{{count}} 件のファイル · +{{insertions}} / -{{deletions}} 行",
+ "gotIt": "了解",
+ "cancel": "キャンセル",
+ "cancelAccessibility": "巻き戻しをキャンセル",
+ "confirm": "巻き戻しを確認",
+ "confirming": "巻き戻し中",
+ "titleLoading": "巻き戻しの影響を確認中",
+ "titleDefault": "このメッセージまで巻き戻しますか?",
+ "titleEmpty": "会話履歴のみを巻き戻す",
+ "titleError": "巻き戻せません",
+ "detailLoading": "パソコンからファイルの巻き戻しプレビューを読み込んでいます。",
+ "detailDefault": "以下のファイルをロールバックし、このメッセージ以降の会話履歴を切り詰めます。",
+ "detailEmpty": "ロールバックするファイルはありません。確認するとこのメッセージ以降の会話履歴のみを切り詰めます。",
+ "detailError": "パソコンがこの巻き戻しを拒否しました。"
+ },
+ "collab": {
+ "dispatchSummaryItem": "{{label}}:{{task}}",
+ "batchTitle": "{{count}} 個の worker にまとめて割り当て",
+ "batchTitleGeneric": "複数の worker にまとめて割り当て",
+ "batchBodyFallback": "worker を一括作成",
+ "dispatchTitle": "worker {{who}} に割り当て",
+ "dispatchRole": "ロール {{meta}}",
+ "dispatchBodyFallback": "worker を作成",
+ "sendTitle": "worker にメッセージ送信",
+ "sendBodyFallback": "メッセージを送信",
+ "reportTitle": "worker の報告",
+ "reportBodyFallback": "(報告なし)"
+ },
+ "contextSheet": {
+ "backAccessibility": "コンテキストパネルに戻る",
+ "goalStatus": {
+ "active": "進行中",
+ "paused": "一時停止中",
+ "blocked": "保留中",
+ "complete": "完了",
+ "budgetLimited": "上限に到達",
+ "usageLimited": "使用量制限中"
+ },
+ "goalLabel": "ゴール",
+ "goalObjectiveAccessibility": "ゴールの内容",
+ "goalPlaceholder": "何を達成したいですか?エージェントは完了するか制限に達するまで、このゴールに沿って自動で続行します。",
+ "advancedSettings": "詳細設定",
+ "limitsHint": "変更しない場合は操作対象パソコンのデフォルト制限に従います。いずれかの上限に達するとゴールは自動的に停止し、いつでも手動で終了できます。「無制限」はその上限を設定しないことを意味します。",
+ "maxTurns": "最大ターン数",
+ "tokenBudget": "トークン予算",
+ "noProgressLimit": "無進展の上限",
+ "startGoal": "ゴールを開始",
+ "goalMeta": "{{turns}} ターン · {{tokens}} token",
+ "pause": "一時停止",
+ "resume": "再開",
+ "clearGoal": "ゴールを終了",
+ "unlimited": "無制限",
+ "noScreenshots": "スクリーンショットが見つかりません。",
+ "mediaRemove": "写真の添付 {{name}} を削除",
+ "mediaDeselect": "写真 {{name}} の選択を解除",
+ "mediaSelect": "写真 {{name}} を選択",
+ "photoPermissionHint": "写真へのアクセスがオフです。オンにすると最近の写真をすばやく追加できます。",
+ "enablePhotoPermission": "写真アクセスをオンにする",
+ "enable": "オンにする",
+ "icloudTimeout": "写真がまだ iCloud からダウンロード中で、タイムアウトしました。ネットワークを確認して再試行してください。",
+ "photoNotReadable": "この写真は現在読み込めません(iCloud からのダウンロードが未完了の可能性があります)。後でもう一度お試しください。"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/ja/message.json b/apps/mobile/src/i18n/locales/ja/message.json
new file mode 100644
index 0000000000..2b1a516d8d
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ja/message.json
@@ -0,0 +1,191 @@
+{
+ "renderer": {
+ "previousQuestionJump": "前の質問へ移動:{{preview}}",
+ "noPreview": "プレビューなし",
+ "newMessagesToBottom": "新着メッセージあり、最下部へ移動",
+ "jumpToBottom": "最下部へ移動",
+ "openForkOrigin": "分岐元メッセージを開く",
+ "viewForkOrigin": "分岐元を表示",
+ "emptyMessages": "メッセージはありません",
+ "syncing": "同期中",
+ "copyLinkHint": "タップしてメッセージリンクをコピー",
+ "sentTime": "送信時刻 {{time}}",
+ "linkCopied": "リンクをコピーしました",
+ "turnCostEstimate": "今回 {{cost}}",
+ "turnCost": "今回の消費 {{cost}}",
+ "messageGenerating": "メッセージを生成中",
+ "generating": "生成中",
+ "collapseMessage": "メッセージを折りたたむ",
+ "expandMessage": "メッセージを展開",
+ "collapse": "折りたたむ",
+ "expand": "展開",
+ "automationOriginNamed": "自動化タスク「{{name}}」から送信",
+ "automationOrigin": "自動化タスクから送信",
+ "modelMismatch": "今回は選択した {{selected}} ではなく {{actual}} が応答しました(サーバー側の一時的なダウングレード)",
+ "copyStateCopying": "コピー中",
+ "copyStateCopied": "コピーしました",
+ "copyStateFailed": "コピー失敗",
+ "copyStateCopy": "コピー",
+ "thinkingHidden": "思考内容は非表示",
+ "thinkingDone": "思考 {{duration}}",
+ "thinkingActive": "思考中 {{elapsed}}",
+ "thinkingProcess": "思考プロセス",
+ "thinkingEmpty": "モデルは表示可能な思考内容を返しませんでした。",
+ "thinkingNoContent": "思考内容はありません",
+ "collapseRow": "{{label}}を折りたたむ",
+ "expandRow": "{{label}}を展開",
+ "statusRunning": "実行中",
+ "statusCompleted": "完了",
+ "statusFailed": "失敗",
+ "statusStopped": "停止",
+ "toolUseCount": "ツール呼び出し {{n}} 回",
+ "subagentTaskTitle": "サブエージェントタスク",
+ "recentTool": "最近のツール:{{name}}",
+ "outputFile": "出力:{{file}}",
+ "noMoreDetail": "詳細はありません",
+ "filesRead": "{{n}} 個のファイルを読み取り",
+ "searchCount": "{{n}} 回検索",
+ "listCount": "{{n}} 回リスト表示",
+ "collapseThinking": "思考内容を折りたたむ",
+ "expandThinking": "思考内容を展開",
+ "subagentTyped": "サブエージェント · {{type}}",
+ "subagent": "サブエージェント",
+ "workedDuration": "作業時間 {{duration}}",
+ "subagentSummary": "サブエージェントの要約",
+ "agentSwitchLabel": "{{from}} から {{to}} に切り替えました",
+ "agentSwitchViewHandoff": "{{label}}、引き継ぎ内容を表示",
+ "sessionResumedPill": "元のセッションを再開しました",
+ "handoffContentDesc": "引き継ぎ内容——切り替え時に新しいエンジンへ送るコンテキスト要約(あなたのメッセージには表示されません)",
+ "openDiagramDetail": "図の詳細を開く",
+ "sessionChipFallback": "セッション {{id}}",
+ "imageFallbackTitle": "画像",
+ "mermaidExportFailedTitle": "エクスポート失敗",
+ "mermaidRenderIncompleteBody": "図の描画がまだ完了していないか、エクスポートに失敗しました。後でもう一度お試しください。",
+ "mermaidDiagramTitle": "Mermaid 図",
+ "mermaidAnnotateFailedTitle": "注釈の追加に失敗",
+ "annotateSendToChat": "注釈を付けてチャットに送信",
+ "exportDiagramImage": "図を画像としてエクスポート",
+ "closeDetail": "詳細を閉じる",
+ "copyDetailContent": "詳細の内容をコピー",
+ "openDetailLink": "詳細リンクを開く",
+ "mediaNotPreviewable": "このメディアは今すぐ直接プレビューできません。",
+ "retryRemoteMediaFetch": "リモートメディアの取得を再試行",
+ "retryFetch": "取得を再試行",
+ "openMedia": "メディアを開く",
+ "readCurrentRemoteFile": "現在のリモートファイルを読み取り",
+ "reading": "読み取り中",
+ "retryFilePreview": "ファイルプレビューを再試行",
+ "readCurrentFile": "現在のファイルを読み取り",
+ "currentFilePreview": "現在のファイルのプレビュー",
+ "diffNoOldContent": "旧コンテンツなし",
+ "diffOldTitle": "旧",
+ "diffNoNewContent": "新規コンテンツなし",
+ "diffNewTitle": "新",
+ "fileKind": "ファイル",
+ "loadRemoteTextPreview": "リモートテキストプレビューを読み込む",
+ "loading": "読み込み中",
+ "retryPreview": "プレビューを再試行",
+ "loadPreview": "プレビューを読み込む",
+ "copyRemoteFilePath": "リモートファイルのパスをコピー",
+ "copyPath": "パスをコピー",
+ "copiedPath": "パスをコピーしました",
+ "copyPathFailed": "パスのコピーに失敗",
+ "remoteMediaIdle": "リモートメディアの取得を準備中",
+ "remoteMediaLoading": "リモートコンピューターから取得中",
+ "remoteMediaReady": "リモートメディアを取得しました",
+ "remoteMediaFetchFailed": "取得失敗:{{message}}",
+ "mediaPending": "{{label}} 再生待ち",
+ "mediaLoaded": "{{label}} 読み込み済み{{progress}}",
+ "mediaPlaying": "{{label}} 再生中{{progress}}",
+ "mediaPaused": "{{label}} 一時停止{{progress}}",
+ "mediaBuffering": "{{label}} バッファリング中{{progress}}",
+ "mediaEnded": "{{label}} 終了{{progress}}",
+ "mediaError": "{{label}} 再生エラー{{error}}",
+ "mediaSourceUrl": "元のアドレス: {{url}}",
+ "mediaDownloadUrl": "ダウンロードアドレス: {{url}}",
+ "mediaSize": "サイズ: {{size}}",
+ "mediaExpiresAt": "有効期限: {{time}}",
+ "mediaErrorLine": "エラー: {{message}}",
+ "mediaDeviceLinkHint": "モバイルは device-link 経由でリモートコンピューターにメディアのアップロードを要求してから開きます。",
+ "controlDelete": "メッセージを削除",
+ "controlRewind": "ここまで戻す",
+ "controlFork": "会話を分岐",
+ "markdownDocAriaLabel": "メッセージ本文",
+ "toolOutputTitle": "{{label}} の出力",
+ "mermaidEmpty": "空の Mermaid 図。",
+ "diffEditCount": "{{n}} 件の編集"
+ },
+ "actions": {
+ "attachmentsPrefix": "添付ファイル:{{names}}",
+ "justNow": "たった今",
+ "minutesAgo": "{{n}} 分前",
+ "hoursAgo": "{{n}} 時間前",
+ "turnCostValue": "概算 {{value}}"
+ },
+ "lightbox": {
+ "cancelAnnotation": "注釈をキャンセル",
+ "cancel": "キャンセル",
+ "undoLastStroke": "直前の描画を取り消す",
+ "undo": "元に戻す",
+ "done": "完了",
+ "shareImage": "画像を共有",
+ "annotateImage": "画像に注釈",
+ "annotate": "注釈",
+ "exportShare": "エクスポート / 共有",
+ "sendToChat": "チャットに送信",
+ "loadFailed": "画像の読み込みに失敗",
+ "retryLoadImage": "画像の読み込みを再試行",
+ "retry": "再試行",
+ "closeImage": "画像を閉じる"
+ },
+ "queue": {
+ "continueSystemInstruction": "未完了のタスクを続行(システム指令)",
+ "systemInstruction": "システム指令",
+ "retrySend": "送信を再試行",
+ "clearError": "エラーをクリア",
+ "credentialSwitchWait": "他の Codex タスクの終了を待っています。終了後に自動で送信します",
+ "aborting": "停止中です。キュー内のメッセージはここに保持されます",
+ "paused": "キューを一時停止しました。キュー内のメッセージは自動送信されません",
+ "resumeSendQueue": "キューの送信を再開",
+ "resume": "続行",
+ "attachmentCount": "添付ファイル {{n}} 件",
+ "attachmentMessage": "添付ファイルのメッセージ",
+ "steeringLabel": "割り込み送信中:{{text}}",
+ "queuedMessageLabel": "キュー内メッセージ {{index}}:{{text}}",
+ "editingInComposer": "下の入力欄で編集中…",
+ "cancel": "キャンセル",
+ "edit": "編集",
+ "steer": "割り込み",
+ "collapseQueued": "キュー内メッセージを折りたたむ",
+ "expandRemainingQueued": "残り {{n}} 件のキュー内メッセージを展開",
+ "collapse": "折りたたむ",
+ "expandRemaining": "残り {{n}} 件を展開",
+ "sendFailedMessage": "送信に失敗したメッセージ:{{text}}",
+ "sendingMessage": "送信中のメッセージ:{{text}}",
+ "uploadingAttachments": "添付ファイルをアップロード中 {{uploaded}}/{{total}}",
+ "delete": "削除",
+ "retry": "再試行"
+ },
+ "systemCard": {
+ "goalComplete": "目標を達成 · {{turns}} 回 · 所要 {{duration}}",
+ "goalResumed": "使用量が回復、目標を継続",
+ "autoResume": "接続が切断、自動的に継続しました",
+ "modelLabel": "モデル",
+ "sessionLabel": "セッション",
+ "sessionResumed": "再開済み",
+ "agentSwitch": "{{from}} から {{to}} に切り替えました",
+ "learnStarted": "スキル学習を開始しました",
+ "learnStartedBody": "蒸留はデスクトップのバックグラウンドで進行します。完了後、デスクトップでスキルの草案を確認・レビューしてください。",
+ "learnFailed": "スキル学習を開始できませんでした",
+ "learnBusyBody": "学習タスクが既に進行中です。完了してから再度お試しください。",
+ "learnFailedBody": "開始に失敗:{{detail}}",
+ "unknownError": "不明なエラー"
+ },
+ "quote": {
+ "count": "{{n}} 件の引用",
+ "countPreviewHint": "{{n}} 件の引用、タップしてプレビュー",
+ "remove": "引用を削除",
+ "closePreview": "引用プレビューを閉じる",
+ "menuLabel": "チャットに追加"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/ja/models.json b/apps/mobile/src/i18n/locales/ja/models.json
new file mode 100644
index 0000000000..cceca018c9
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ja/models.json
@@ -0,0 +1,36 @@
+{
+ "picker": {
+ "title": "モデル",
+ "permissionTitle": "権限",
+ "searchAccessibility": "モデルを検索",
+ "searchPlaceholder": "モデルを検索...",
+ "noResults": "一致するモデルがありません",
+ "emptyDefault": "利用可能なモデルがありません",
+ "loadingDefault": "モデルを読み込み中…",
+ "subscriptionBadge": "サブスク",
+ "backToModels": "モデル一覧に戻る",
+ "agentSwitchHint": "モデルを選択すると、次のメッセージから {{agent}} に切り替わります",
+ "crossAgentEmptyHint": "先に操作対象のパソコンで {{agent}} のモデルソースを接続してください",
+ "permissionModeAccessibility": "権限モード:{{mode}}",
+ "selectProviderModelAccessibility": "{{provider}} のモデル {{model}} を選択",
+ "selectModelAccessibility": "モデル {{model}} を選択",
+ "configureAccessibility": "{{model}} を設定",
+ "budgetDisabledHint": "このモデルを使うには、先に操作対象のパソコンで API キーを設定してください",
+ "priceLine": "入力 {{input}} · 出力 {{output}} / 100万トークン",
+ "contextSuffix": "{{size}} コンテキスト",
+ "fastTag": "高速"
+ },
+ "options": {
+ "fastMode": "高速モード",
+ "fastModeAccessibility": "高速モード {{model}}",
+ "reasoningEffort": "推論の強度",
+ "reasoningEffortAccessibility": "推論の強度 {{label}}"
+ },
+ "agentSwitch": {
+ "browseAccessibility": "{{agent}} のモデルを表示",
+ "confirmTitle": "{{agent}} に切り替えますか?",
+ "confirmMessage": "次のメッセージを送信すると、{{appName}} は現在のセッションを {{agent}} に引き継ぎます。2つのエージェントはコンテキストやツールの理解が異なる場合があります。確認してから対象のモデルを選択してください。",
+ "cancel": "キャンセル",
+ "confirm": "続けて選択"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/ja/session.json b/apps/mobile/src/i18n/locales/ja/session.json
new file mode 100644
index 0000000000..f8a6c01755
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ja/session.json
@@ -0,0 +1,237 @@
+{
+ "common": {
+ "cancel": "キャンセル",
+ "delete": "削除",
+ "openContextPanel": "コンテキストパネルを開く",
+ "groupMode": "モード",
+ "groupAdd": "追加",
+ "planMode": "プランモード",
+ "goalMode": "ゴールモード",
+ "context": "コンテキスト",
+ "screenshot": "スクリーンショット",
+ "photo": "写真",
+ "takePhoto": "写真を撮る",
+ "file": "ファイル",
+ "joinConversation": "会話に追加({{num}} 枚)",
+ "paletteLoading": "読み込み中",
+ "noMatchingCommands": "一致するコマンドがありません",
+ "noMatchingResources": "一致するリソースがありません",
+ "keepTypingToNarrow": "入力を続けて結果を絞り込む",
+ "insertCommand": "コマンド {{name}} を挿入",
+ "insertResource": "リソース {{name}} を挿入",
+ "openMicPermission": "マイクの権限設定を開く",
+ "maxAttachments": "添付は最大 {{max}} 件までです。",
+ "voiceStopRecording": "録音を停止",
+ "capabilitiesUnsupported": "リモート機能の形式に対応していません"
+ },
+ "screen": {
+ "composerSyncing": "セッションデータを同期中です。完了すると送信できます。",
+ "composerCreating": "セッションを作成中です。最初のメッセージ送信後に続けて送信できます。",
+ "nextAgentSwitch": "次から {{agent}} · {{model}} に切り替え",
+ "createFailedTitle": "セッションの作成に失敗しました",
+ "createFailedDefault": "セッションの作成に失敗しました。",
+ "createFailedNotice": "セッションの作成に失敗しました:{{message}}",
+ "backToEdit": "編集に戻る",
+ "retry": "再試行",
+ "firstMessageNotSent": "最初のメッセージは送信されませんでした。内容は入力欄に復元されました。",
+ "locateMessageNotFound": "移動先のメッセージが見つかりませんでした。",
+ "shareNoLocalImage": "ローカルの画像ファイルを取得できませんでした",
+ "shareFailedTitle": "共有に失敗しました",
+ "shareUnsupported": "このバージョンはまだ共有に対応していません。最新版に更新してから再試行してください。",
+ "downloadFailed": "ダウンロードに失敗しました",
+ "voiceNoRemoteDevice": "リモートデバイスがないため、音声入力を開始できません。",
+ "voiceSenderNotReady": "メッセージ送信機能が初期化されていません。",
+ "voiceStopAndSend": "音声入力を終了して送信",
+ "sendMessage": "リモートメッセージを送信",
+ "voiceStartInput": "音声入力を開始",
+ "stopSession": "リモートセッションを停止",
+ "sessionNotFoundResync": "現在のリモートセッションが見つかりません。再同期してから送信してください。",
+ "missingWorkingDir": "このセッションには作業ディレクトリがないため、メッセージを送信できません。",
+ "queueMessageGone": "このキュー内メッセージはもうキューにありません。変更は保存されませんでした。",
+ "editQueueUnsupported": "パソコン側のバージョンが古く、キュー内の引用・添付の変更やテキストの消去に安全に対応できません。パソコン側を更新するか、通常のテキストのみ変更してください。",
+ "sessionNotSyncedRetry": "セッションの同期がまだ完了していません。しばらくしてから再試行してください。",
+ "savingPreviousQueueEdit": "直前のキュー内メッセージの変更を保存中です。完了してから編集してください。",
+ "attachmentsUploadingBeforeEdit": "添付ファイルをアップロード中です。完了してからキュー内メッセージを編集してください。",
+ "goalAlreadyActive": "このセッションには進行中のゴールがあります。先にこちらで対応してください。",
+ "resetReconfirmTitle": "再確認してください",
+ "resetOfferExpired": "リセット用の認証が期限切れです。更新後の残量情報を確認してください。",
+ "resetOutcomeReset": "Codex の使用量ウィンドウをリセットしました。",
+ "resetOutcomeNothing": "リセットが必要な使用量ウィンドウはありません。",
+ "resetOutcomeNoCredit": "利用できるリセット回数がありません。",
+ "resetOutcomeAlready": "このリセット要求はすでに処理済みで、使用量は更新されました。",
+ "resetDoneTitle": "リセット完了",
+ "resetResultTitle": "リセット結果",
+ "resetFailedTitle": "リセットに失敗しました",
+ "operationFailed": "操作に失敗しました",
+ "sessionDeviceNotFound": "このセッションが属するパソコンが見つかりません。対象のデバイスが接続されているか確認して再試行してください。",
+ "deleteMessageTitle": "このメッセージを削除しますか?",
+ "deleteMessageBody": "ユーザーメッセージはこの1件のみ削除されます。AI メッセージの場合は、直前のユーザー入力以降に生成されたターン全体が削除されます。以降の会話は保持されます。次回の送信時に、残った記録から AI のコンテキストが再構築されます。",
+ "deleteMessageAction": "このメッセージを削除",
+ "readingCapabilities": "{{agent}} の実行機能を読み込み中…",
+ "editingQueueMessageNumbered": "キュー内メッセージ {{index}} 件目を編集中",
+ "editingQueueMessage": "キュー内メッセージを編集中",
+ "discardQueueEdit": "キュー内メッセージの編集を破棄",
+ "savingHint": "変更を保存中です。完了してから操作してください。",
+ "composerPlaceholder": "リモートメッセージを入力",
+ "openSessionMenu": "セッションメニューを開く",
+ "searchTitle": "このセッションを検索",
+ "searchPlaceholder": "このセッションのメッセージを検索",
+ "searchEnterKeyword": "キーワードを入力",
+ "searchNoMatch": "一致するメッセージがありません",
+ "searchPrevious": "前の検索結果",
+ "searchNext": "次の検索結果",
+ "syncingSession": "セッションを同期中",
+ "awaitingSync": "セッションの同期待ち",
+ "resync": "リモートセッションを再同期",
+ "collapseHistory": "履歴を折りたたむ",
+ "expandHistory": "履歴を表示",
+ "readOnlyMode": "読み取り専用",
+ "accessRevokedShort": "アクセスは取り消されました",
+ "sessionNotSynced": "セッション未同期",
+ "conversationFallback": "会話",
+ "accessRevoked": "パソコンによってアクセス権が取り消されました",
+ "syncing": "同期中",
+ "pendingCount": "保留中 {{num}} 件",
+ "archived": "アーカイブ済み",
+ "queuePausedNotice": "キュー一時停止中"
+ },
+ "new": {
+ "selectDevice": "パソコンを選択",
+ "workspaceDialogue": "会話",
+ "workspaceProject": "プロジェクト",
+ "selectProject": "プロジェクトを選択",
+ "composerPlaceholder": "今日は何をしましょうか〜",
+ "voiceSelectDeviceFirst": "パソコンを選択してから音声入力を使用してください。",
+ "creatingSession": "セッションを作成中",
+ "createAndSend": "セッションを作成して最初のメッセージを送信",
+ "modelAccessibility": "モデル:{{model}}",
+ "voiceInput": "音声入力",
+ "selectDeviceError": "パソコンを選択してください。",
+ "enterProjectPath": "パソコン側のプロジェクトパスを入力してください。",
+ "enterModel": "モデルを入力してください。",
+ "enterFirstMessageOrAttachment": "最初のメッセージを入力するか、添付を追加してください。",
+ "noSessionIdReturned": "パソコンから新しいセッション ID が返されませんでした。",
+ "sessionIdNotAdopted": "パソコンが事前生成のセッション ID を使用しませんでした(パソコン側のバージョン異常)。パソコンを更新してから再試行してください。",
+ "firstMessageMissingConfirm": "最初のメッセージは送信されませんでした。内容は入力欄に復元されました。送信前に、このメッセージがセッションに存在しないことを確認してください。",
+ "firstMessageUnconfirmed": "最初のメッセージの送信状態を確認できませんでした。内容は入力欄に復元されました。送信前に、このメッセージがすでにセッションにあるか確認してください。",
+ "selectControlledDevice": "操作対象のパソコンを選択",
+ "selectDeviceNamed": "パソコン {{name}} を選択",
+ "selectAgent": "エージェントを選択",
+ "switchToAgent": "{{label}} に切り替え",
+ "selectWorkspace": "ワークスペースを選択",
+ "dialogueNoProject": "会話(プロジェクトなし)",
+ "selectProjectNamed": "プロジェクト {{title}} を選択",
+ "noProjects": "プロジェクトはまだありません",
+ "chooseOtherFolder": "別のプロジェクトフォルダを選択",
+ "readingRemoteDir": "リモートディレクトリを読み込み中...",
+ "goParentDir": "上位ディレクトリへ",
+ "parentDir": "上へ",
+ "useCurrentRemoteDir": "現在のリモートディレクトリを使用",
+ "useCurrent": "現在を使用",
+ "firstMessagePlaceholder": "最初のメッセージを入力",
+ "noModelsAvailable": "利用できるモデルがありません",
+ "selectDeviceFirst": "先にパソコンを選択してください",
+ "enterDir": "ディレクトリ {{name}} を開く",
+ "selectDir": "ディレクトリ {{name}} を選択",
+ "select": "選択",
+ "noModelSelected": "モデル未選択",
+ "assignedDialogueDir": "パソコンが割り当てた会話ディレクトリ",
+ "extraDirsSuffix": "+{{num}} 追加ディレクトリ",
+ "noProjectPath": "プロジェクトパス未選択",
+ "dialogueWorkspace": "会話ワークスペース",
+ "previewDevice": "パソコン:{{name}}",
+ "unknownDevice": "不明なデバイス",
+ "previewLocation": "場所:{{target}}",
+ "previewRuntime": "実行:{{runtime}}",
+ "previewFirstMessage": "最初:{{preview}}",
+ "previewFirstAttachmentOnly": "最初:添付のみ送信",
+ "previewFirstEmpty": "最初:未入力",
+ "previewAttachments": "添付:{{num}} 件",
+ "previewReadyTitle": "作成して送信する準備ができました",
+ "previewNotReadyTitle": "まだ作成できません",
+ "previewReadySubtitle": "確認すると、操作対象のパソコンにセッションを作成し、最初のメッセージをキューに追加します。"
+ },
+ "menu": {
+ "chipPinned": "ピン留め済み",
+ "chipArchived": "アーカイブ済み",
+ "chipReadOnly": "読み取り専用",
+ "titleFallback": "リモートセッション",
+ "renameAction": "会話の名前を変更",
+ "copyLinkAction": "会話リンクをコピー",
+ "unpin": "ピン留めを解除",
+ "pin": "ピン留め",
+ "restore": "復元",
+ "archive": "アーカイブ",
+ "deleteAction": "セッションを削除",
+ "deleteConversation": "会話を削除",
+ "workingDir": "作業ディレクトリ",
+ "aiRenameUnsupported": "パソコン側のバージョンが古く、自動命名にまだ対応していません。",
+ "aiRenameOffline": "パソコンがオフラインです。後で再試行してください。",
+ "aiRenameFailed": "自動命名に失敗しました。再試行してください。",
+ "contextUsageSummary": "コンテキスト {{percent}}%",
+ "copied": "コピーしました",
+ "copyFailed": "コピーに失敗しました",
+ "deleteConfirmTitle": "セッションを削除しますか?",
+ "deleteConfirmBody": "削除すると元に戻せません。",
+ "dirAlreadyAdded": "このディレクトリはすでにリストにあります。",
+ "resetCodexTitle": "Codex の使用量をリセットしますか?",
+ "resetCodexBody": "{{account}} のリセットを 1 回消費します。残量ウィンドウはすぐに再開され、この操作は取り消せません。",
+ "currentCodexAccount": "現在の Codex アカウント",
+ "resetConsumeOnce": "リセットを 1 回消費",
+ "titlePlaceholder": "セッションのタイトル",
+ "aiRenameLabel": "AI で自動命名",
+ "viewUsageDetail": "セッションの使用量詳細を表示",
+ "linkCopied": "リンクをコピーしました",
+ "sessionInfo": "セッション情報",
+ "usageSection": "使用量",
+ "refreshContextUsage": "コンテキスト使用量を更新",
+ "currentSessionSpend": "今回のセッション",
+ "noSessionSpend": "セッションの使用量はまだありません",
+ "contextLabel": "コンテキスト",
+ "accountLimits": "アカウントの上限",
+ "quotaExhaustedResettable": "現在の残量を使い切りました。リセットするとすぐに 1 回消費され、取り消せません。",
+ "resetting": "リセット中…",
+ "resetCodexUsage": "Codex の使用量をリセット",
+ "quotaExhaustedNoCredit": "現在の残量を使い切りましたが、利用できるリセット回数がありません。",
+ "openDir": "ディレクトリを開く",
+ "copyPath": "パスをコピー",
+ "extraDirsSection": "追加参照ディレクトリ",
+ "noExtraDirs": "追加ディレクトリはまだありません。追加ディレクトリは、操作対象パソコン上のエージェントに追加コンテキストとして提供されます。",
+ "remove": "削除",
+ "collapseRemoteDir": "リモートディレクトリを閉じる",
+ "browseRemoteDir": "リモートディレクトリを参照",
+ "reading": "読み込み中…",
+ "parentDir": "上へ",
+ "addCurrentDir": "現在のディレクトリを追加",
+ "enterRemoteDir": "リモートディレクトリ {{name}} を開く",
+ "add": "追加",
+ "noSubDirs": "このディレクトリには開けるサブディレクトリがありません。",
+ "dirLimitNotice": "最初の 30 件のディレクトリのみ表示しています。より具体的なディレクトリを開いて選択を続けてください。",
+ "confirmRename": "名前の変更を確定",
+ "confirm": "確定",
+ "cancelRename": "名前の変更をキャンセル",
+ "backToMenu": "セッションメニューに戻る"
+ },
+ "tail": {
+ "interrupted": "タスクの実行中にアプリが終了したため、中断されました。",
+ "continueTask": "タスクを続ける",
+ "retry": "再試行",
+ "ignore": "無視",
+ "codexThreadLost": "Codex の認証モードが切り替わったため、このセッションは続行できません —— 新しいセッションを作成すると反映されます。",
+ "encryptedContentInvalid": "プロバイダーの変更により暗号化が利用できなくなったため、このセッションは元のプロバイダーでのみ使用できます。パソコン側で対応してください(Fork してプロトコルの暗号化コンテンツを破棄すれば、新しいセッションで続行できます)。"
+ },
+ "row": {
+ "moreOptions": "その他のオプション",
+ "archiveConversation": "会話をアーカイブ",
+ "closeActionMenu": "セッション操作メニューを閉じる",
+ "referenceAroundAnchor": "リンク付近",
+ "referenceRecent": "最近のメッセージ",
+ "referenceCount": "{{num}} 件",
+ "referenceTruncated": "切り詰め済み",
+ "pinnedSection": "ピン留め",
+ "extraDirsSummary": "追加ディレクトリ {{num}} 件",
+ "noExtraDirsSummary": "追加ディレクトリはありません",
+ "attachmentUploadFailed": "添付のアップロードに失敗しました。再試行するか、このメッセージを削除してください。",
+ "authGateHint": "{{agent}} はこのパソコンに接続済みのモデルプロバイダーがないため、送信は失敗します。パソコンの {{appName}} で「設定 → モデルプロバイダー」を設定してください。"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/ja/settings.json b/apps/mobile/src/i18n/locales/ja/settings.json
new file mode 100644
index 0000000000..4fcf2ac1f3
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ja/settings.json
@@ -0,0 +1,113 @@
+{
+ "title": "設定",
+ "language": {
+ "title": "言語",
+ "hint": "アプリの UI のみに影響します。Agent の応答言語は Agent 側の設定に従います。",
+ "options": {
+ "system": "自動 (システムに従う)",
+ "zh-CN": "简体中文",
+ "en": "English",
+ "ja": "日本語",
+ "ko": "한국어"
+ }
+ },
+ "version": {
+ "sectionTitle": "バージョン",
+ "currentLabel": "現在のバージョン",
+ "bundleVersion": "アプリ本体 {{version}}",
+ "otaVersion": "OTA バージョン {{version}}",
+ "desktopVersion": "デスクトップ版 {{version}}",
+ "devNoOta": "開発ビルドのため OTA 更新は利用できません",
+ "checkAction": "更新を確認",
+ "checking": "確認中",
+ "updating": "更新中",
+ "checkingAccessibility": "更新を確認しています",
+ "bundleUpdateFound": "アプリ本体の更新があります",
+ "upToDate": "すでに最新の状態です",
+ "bundleUpToDateNoOta": "アプリ本体は最新です。このバージョンは OTA 更新に対応していません",
+ "downloadedRestarting": "更新をダウンロードしました。再起動しています",
+ "bundleCheckFailed": "アプリ本体の更新を確認できませんでした。しばらくしてからもう一度お試しください。",
+ "checkFailedDetail": "更新の確認に失敗しました:{{detail}}",
+ "checkFailed": "更新の確認に失敗しました。しばらくしてからもう一度お試しください。"
+ },
+ "notifications": {
+ "sectionTitle": "通知",
+ "taskDone": "タスク完了通知",
+ "taskDoneHint": "パソコン側のタスクが完了・失敗・返信待ちになったとき、このスマートフォンに通知します。完了時と返信待ち時は最新の返信内容も含まれます。",
+ "permissionDenied": "システムの通知が許可されていません。iOS の「設定 → 通知 → {{appName}}」で通知を許可してから、もう一度お試しください。",
+ "unregisterQueued": "オフにしました。現在のネットワークでは登録解除が完了していません。次回オンライン時に自動で完了します。"
+ },
+ "about": {
+ "sectionTitle": "このスマートフォンについて",
+ "deviceName": "デバイス名",
+ "deviceNameDetail": "パソコン側の承認リストにこの名前が表示されます。",
+ "platform": "プラットフォーム",
+ "remoteControl": "リモート制御権限",
+ "remoteControlValue": "パソコン側で管理",
+ "remoteControlDetail": "このスマートフォンは操作する側としてのみ動作します。被操作の許可・取り消し・復元はパソコン側の設定で行います。",
+ "editAccessibility": "{{label}}を変更"
+ },
+ "relay": {
+ "online": "Relay 接続済み",
+ "connecting": "Relay に接続中",
+ "stopped": "Relay 未接続",
+ "lastSynced": "最終同期 {{time}}",
+ "canSync": "リモートセッションを同期できます。",
+ "reconnectHint": "ネットワーク回復後、リモートセッションは自動的に再購読されます。",
+ "resumeHint": "アプリに戻るか再ログインすると接続が回復します。"
+ },
+ "header": {
+ "notSignedIn": "未ログイン",
+ "thisPhone": "このスマートフォン"
+ },
+ "debug": {
+ "sectionTitle": "デバッグ / 開発者",
+ "userId": "ユーザー ID",
+ "notSynced": "未同期",
+ "deviceId": "デバイス ID",
+ "initializing": "初期化中",
+ "authServer": "Auth Server",
+ "authRegion": "ログインリージョン"
+ },
+ "updateInfo": {
+ "embedded": "アプリ本体と同梱",
+ "unknown": "不明",
+ "source": "実行ソース",
+ "sourceEmbedded": "内蔵バージョン (同梱)",
+ "sourceOta": "OTA 更新",
+ "updateId": "更新 ID",
+ "updatedAt": "更新日時",
+ "channel": "Channel",
+ "runtime": "Runtime",
+ "otaMarker": "OTA マーカー"
+ },
+ "legal": {
+ "sectionTitle": "法的情報",
+ "privacyPolicy": "プライバシーポリシー",
+ "view": "表示",
+ "openPrivacyPolicy": "プライバシーポリシーを開く",
+ "appFilingNumber": "アプリ届出番号"
+ },
+ "account": {
+ "logoutHint": "ログアウトすると、このスマートフォン上のログイン状態とローカルのリモートミラーだけが削除されます。パソコン側のセッションには影響しません。",
+ "logout": "ログアウト",
+ "loggingOut": "ログアウト中",
+ "loggingOutAccessibility": "ログアウトしています"
+ },
+ "copyRow": {
+ "action": "コピー",
+ "done": "コピー済み",
+ "accessibility": "{{label}}をコピー"
+ },
+ "deviceNameEditor": {
+ "screenTitle": "デバイス名",
+ "placeholder": "この端末の名前",
+ "resetAccessibility": "デフォルトの端末名に戻す",
+ "emptyError": "デバイス名を入力してください。",
+ "deviceInitializing": "デバイスを初期化しています。しばらくしてからもう一度お試しください。",
+ "saving": "保存中…",
+ "saved": "保存しました。",
+ "restoringDefault": "デフォルト名に戻しています…",
+ "restoredDefault": "デフォルト名に戻しました。"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/ja/shared.json b/apps/mobile/src/i18n/locales/ja/shared.json
new file mode 100644
index 0000000000..af59356cbb
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ja/shared.json
@@ -0,0 +1,6 @@
+{
+ "back": "戻る",
+ "syncing": "同期しています",
+ "selectOption": "{{label}} を選択",
+ "closePanel": "パネルを閉じる"
+}
diff --git a/apps/mobile/src/i18n/locales/ja/startup.json b/apps/mobile/src/i18n/locales/ja/startup.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ja/startup.json
@@ -0,0 +1 @@
+{}
diff --git a/apps/mobile/src/i18n/locales/ja/update.json b/apps/mobile/src/i18n/locales/ja/update.json
new file mode 100644
index 0000000000..d833b66205
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ja/update.json
@@ -0,0 +1,17 @@
+{
+ "installHintTitle": "インストール案内",
+ "installHintBody": "システムのダイアログで「インストール」をタップしたら、ホーム画面に戻ってインストールの進行状況を確認してください。ダウンロードが完了すると、現在のバージョンが自動的に置き換わります。",
+ "openInstallFailedTitle": "インストールリンクを開けません",
+ "openInstallFailedBody": "インストール先のアドレスを手動でコピーし、Safari で開いてください。",
+ "bundleAvailableBody": "新しいバージョンがあります。フルパッケージをダウンロードしてインストールし、更新してください。",
+ "releaseNotes": "\n更新内容:\n{{notes}}",
+ "forcedTitle": "更新が必要です",
+ "goUpdate": "更新する",
+ "newVersionTitle": "新しいバージョン",
+ "later": "後で",
+ "upToDateTitle": "最新の状態です",
+ "upToDateBody": "すでに最新のパッケージです。",
+ "checkFailedTitle": "確認に失敗しました",
+ "checkFailedBody": "更新サーバーに接続できません。しばらくしてからもう一度お試しください。",
+ "latestRequestFailed": "latest リクエスト失敗: HTTP {{status}}"
+}
diff --git a/apps/mobile/src/i18n/locales/ko/apiErrors.json b/apps/mobile/src/i18n/locales/ko/apiErrors.json
new file mode 100644
index 0000000000..7fa14f2827
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ko/apiErrors.json
@@ -0,0 +1,6 @@
+{
+ "requestTimeout": "요청 시간이 초과되었습니다. 나중에 다시 시도하세요.",
+ "networkUnavailable": "네트워크에 연결할 수 없습니다. 연결을 확인한 뒤 다시 시도하세요.{{webHint}}",
+ "networkUnavailableWebHint": " 웹 미리보기는 브라우저의 CORS 정책에 의해 차단될 수 있습니다. Expo Go 또는 시뮬레이터에서 테스트하세요.",
+ "requestFailed": "요청 실패"
+}
diff --git a/apps/mobile/src/i18n/locales/ko/composer.json b/apps/mobile/src/i18n/locales/ko/composer.json
new file mode 100644
index 0000000000..680f5679c7
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ko/composer.json
@@ -0,0 +1,103 @@
+{
+ "input": {
+ "resize": {
+ "increaseHeight": "입력창 높이 늘리기",
+ "decreaseHeight": "입력창 높이 줄이기",
+ "hint": "위아래로 드래그하여 입력창 높이 조절",
+ "label": "입력창 높이 조절"
+ }
+ },
+ "attachments": {
+ "viewImage": "이미지 {{name}} 보기",
+ "removeAttachment": "첨부 파일 {{name}} 제거",
+ "retryUpload": "{{name}} 업로드 재시도",
+ "retry": "재시도",
+ "removeFailed": "실패한 첨부 파일 {{name}} 제거",
+ "cancelUpload": "{{name}} 업로드 취소",
+ "uploadFailed": "{{name}} · 업로드 실패",
+ "collapsedBadge": "첨부 파일 {{count}}개, 눌러서 펼치기",
+ "imageNotAnnotatable": "이 이미지는 주석이나 전달을 지원하지 않습니다.",
+ "downloadOriginalFailed": "원본 이미지를 다운로드하지 못했습니다(HTTP {{status}}).",
+ "annotationSaveFailed": "주석을 저장하지 못했습니다",
+ "tryAgain": "다시 시도하세요.",
+ "sendToChat": "대화로 보내기",
+ "save": "저장",
+ "fileNotFound": "파일이 없습니다",
+ "pathNotReadable": "이 경로는 읽기가 허용되지 않습니다",
+ "readFailed": "읽기 실패",
+ "notFetchableMedia": "가져올 수 있는 데스크톱 미디어가 아닙니다",
+ "mediaResultInvalid": "원격 미디어 가져오기 결과가 잘못되었습니다",
+ "mediaUrlInvalid": "원격 미디어 다운로드 URL이 잘못되었습니다",
+ "mediaCacheMiss": "원격 미디어 캐시에 없습니다(cachedOnly)",
+ "mediaFetchCancelled": "원격 미디어 가져오기를 취소했습니다",
+ "fileMenu": {
+ "openBrowser": "파일 브라우저 열기",
+ "sendToSession": "세션으로 보내기",
+ "copyPath": "경로 복사",
+ "quickPreview": "빠른 미리보기",
+ "revealInBrowser": "파일 브라우저에서 보기",
+ "share": "내보내기 / 공유",
+ "folder": "폴더",
+ "file": "파일"
+ }
+ },
+ "upload": {
+ "emptyFile": "이 파일은 비어 있어 첨부 파일로 보낼 수 없습니다.",
+ "fileTooLarge": "파일이 {{size}} MB를 초과하여 지금은 첨부 파일로 보낼 수 없습니다.",
+ "cancelled": "첨부 파일 업로드를 취소했습니다.",
+ "incompleteRead": "파일 읽기가 완료되지 않았습니다. 예상: {{expected}}바이트, 실제: {{actual}}바이트.",
+ "integrityUnavailable": "이 첨부 파일 업로드 본문은 무결성 검사를 할 수 없습니다.",
+ "sizeChanged": "첨부 파일 크기가 변경되었습니다. 예상: {{expected}}바이트, 실제: {{actual}}바이트.",
+ "invalidSize": "첨부 파일 크기가 잘못되어 무결성 다이제스트를 계산할 수 없습니다.",
+ "invalidBase64": "첨부 파일 청크가 유효한 base64가 아닙니다.",
+ "failedHttp": "첨부 파일 업로드에 실패했습니다: HTTP {{status}}{{code}}",
+ "failedNetwork": "첨부 파일 업로드에 실패했습니다. 네트워크 전송 오류입니다. 연결을 확인한 후 다시 시도하세요. ({{detail}})",
+ "timeout": "첨부 파일 업로드 시간이 초과되었습니다. 연결을 확인한 후 다시 시도하세요.",
+ "fileTypeUnsupported": "이 로컬 파일 형식은 아직 첨부 파일로 보낼 수 없습니다.",
+ "snapshotFailedNoCacheDir": "첨부 파일 스냅샷을 만들 수 없습니다: 캐시 디렉터리를 사용할 수 없습니다",
+ "snapshotFailed": "첨부 파일 스냅샷을 만들 수 없습니다",
+ "invalidUploadUrl": "서버가 유효한 첨부 파일 업로드 URL을 반환하지 않았습니다.",
+ "noImageRead": "업로드할 이미지를 읽지 못했습니다.",
+ "emptyImage": "이 이미지는 비어 있어 첨부 파일로 보낼 수 없습니다.",
+ "imageTooLarge": "이미지가 {{size}} MB를 초과하여 지금은 첨부 파일로 보낼 수 없습니다.",
+ "imageTooLargeSend": "이미지가 {{size}} MB를 초과하여 지금은 보낼 수 없습니다.",
+ "sessionExpiredImage": "로그인이 만료되었습니다. 다시 로그인한 후 이미지를 업로드하세요.",
+ "sessionExpiredFile": "로그인이 만료되었습니다. 다시 로그인한 후 첨부 파일을 업로드하세요.",
+ "pasteTimeout": "이미지 붙여넣기 처리 시간이 초과되었습니다. 다시 시도하세요.",
+ "clipboardReadFailed": "클립보드 이미지를 읽지 못했습니다. 다시 복사한 후 붙여넣으세요.",
+ "maxAttachments": "첨부 파일은 최대 {{count}}개까지 추가할 수 있습니다.",
+ "simulatorNoCamera": "시뮬레이터에는 카메라가 없습니다. \"사진\"에서 라이브러리를 선택하세요.",
+ "cameraPermission": "카메라 접근이 꺼져 있습니다. 시스템 설정에서 {{appName}}의 카메라 사용을 허용하세요.",
+ "photoPermission": "사진 접근이 꺼져 있습니다. 시스템 설정에서 {{appName}}의 사진 접근을 허용하세요.",
+ "noFileRead": "업로드할 파일을 읽지 못했습니다."
+ },
+ "voice": {
+ "recordingEmpty": "녹음이 비어 있어 전사할 수 없습니다.",
+ "recordingTooLarge": "녹음이 상한 {{size}}MB를 초과했습니다.",
+ "invalidUploadUrl": "서버가 유효한 음성 업로드 URL을 반환하지 않았습니다.",
+ "uploadFailed": "음성 업로드에 실패했습니다: HTTP {{status}} {{statusText}}",
+ "refineFailed": "음성 다듬기에 실패했습니다",
+ "refineResponseTooLarge": "음성 다듬기 응답이 상한 {{max}}자를 초과했습니다.",
+ "refineStreamFailed": "음성 다듬기 스트리밍 응답에 실패했습니다.",
+ "refineNoContent": "음성 다듬기에서 유효한 내용을 반환하지 않았습니다.",
+ "refineInvalidJson": "음성 다듬기에서 잘못된 JSON을 반환했습니다: {{snippet}}",
+ "invalidSession": "음성 서비스가 잘못된 세션을 반환했습니다.",
+ "managedRefineUnsupported": "현재 {{appName}} 음성 서비스는 관리형 다듬기를 지원하지 않습니다.",
+ "sessionNotConnected": "음성 인식 세션이 아직 연결되지 않았습니다.",
+ "loginRequired": "음성 입력을 사용하기 전에 {{appName}}에 로그인하세요.",
+ "serviceUnavailable": "현재 지역에는 {{appName}} 음성 서비스가 구성되어 있지 않습니다.",
+ "realtimeUnsupported": "모바일 실시간 음성은 아직 {{detail}} ASR을 지원하지 않습니다.",
+ "realtimeAuthUnsupported": "모바일 실시간 음성은 아직 {{auth}} ASR 인증을 지원하지 않습니다.",
+ "realtimeProtocolUnsupported": "모바일 실시간 음성은 아직 {{detail}} ASR 프로토콜을 지원하지 않습니다.",
+ "missingConnectionProvider": "모바일 음성 입력에는 {{appName}} 음성 세션 티켓이 필요합니다(connectionProvider 누락).",
+ "realtimeAsrFailed": "실시간 음성 인식에 실패했습니다.",
+ "volcengineAuthUnsupported": "모바일 Volcengine 음성은 아직 {{auth}} 인증을 지원하지 않습니다.",
+ "volcengineMissingResourceId": "Volcengine ASR 구성에 resourceId가 없습니다.",
+ "sessionExpiredOrForbidden": "{{appName}} 음성 세션이 만료되었거나 권한이 없습니다(WebSocket {{status}}). 로그인 상태를 확인한 후 다시 시도하세요.",
+ "incomplete": "음성 입력이 완료되지 않았습니다. 다시 시도하세요.",
+ "missingRefinerTargetProvider": "모바일 음성 다듬기에는 {{appName}} 음성 세션이 필요합니다(refinerTargetProvider 누락).",
+ "emptyTranscript": "음성이 감지되었지만 텍스트를 인식하지 못했습니다. 다시 시도해 주세요.",
+ "micPermission": "마이크 권한이 꺼져 있습니다. 시스템 설정에서 {{appName}}의 마이크 사용을 허용해 주세요.",
+ "realtimeAudioUnavailable": "현재 설치 패키지는 실시간 음성 입력을 지원하지 않습니다. 네이티브 녹음 모듈이 포함된 테스트 빌드를 설치해 주세요."
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/ko/deviceLink.json b/apps/mobile/src/i18n/locales/ko/deviceLink.json
new file mode 100644
index 0000000000..371c4a73e2
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ko/deviceLink.json
@@ -0,0 +1,18 @@
+{
+ "syncFailed": "동기화 실패",
+ "resync": "다시 동기화",
+ "resyncing": "다시 동기화하는 중",
+ "syncShort": "동기화",
+ "connectStep1": "컴퓨터에 {{appName}}을(를) 설치하고 실행하세요",
+ "connectStep2": "휴대폰과 동일한 계정으로 로그인하세요",
+ "connectStep3": "'설정 → 원격 연결'에서 '동일 계정 기기의 이 컴퓨터 제어 허용'을 켜세요",
+ "brandEyebrow": "Cindy 모바일",
+ "cloudTeaserTitle": "클라우드 {{appName}} 준비 중",
+ "cloudTeaserCopy": "출시되면 컴퓨터 없이 모바일 앱만으로 바로 사용할 수 있습니다.",
+ "sectionFirstRun": "시작하기",
+ "sectionOffline": "연결한 컴퓨터",
+ "sectionRemoteDisabled": "컴퓨터에서 조작",
+ "sectionAccessRevoked": "다시 허용 필요",
+ "retryAccess": "액세스 재시도",
+ "recheck": "다시 확인"
+}
diff --git a/apps/mobile/src/i18n/locales/ko/devices.json b/apps/mobile/src/i18n/locales/ko/devices.json
new file mode 100644
index 0000000000..023d682859
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ko/devices.json
@@ -0,0 +1,328 @@
+{
+ "common": {
+ "cancel": "취소",
+ "save": "저장",
+ "saving": "저장 중",
+ "delete": "삭제",
+ "deleting": "삭제 중",
+ "create": "새로 만들기"
+ },
+ "list": {
+ "thisComputer": "이 컴퓨터",
+ "allConversations": "모든 대화",
+ "syncFailed": "동기화 실패",
+ "requestFailed": "요청 실패",
+ "loading": "제어 가능한 컴퓨터를 불러오는 중",
+ "untitled": "제목 없는 대화",
+ "connection": {
+ "connecting": "연결 중",
+ "disconnected": "연결 끊김"
+ },
+ "error": {
+ "sessionDeviceNotFound": "이 대화가 속한 컴퓨터를 찾을 수 없습니다. 다시 동기화한 후 시도하세요.",
+ "taskDeviceNotFound": "이 작업이 속한 컴퓨터를 찾을 수 없습니다. 다시 동기화한 후 시도하세요.",
+ "noDevice": "사용할 수 있는 컴퓨터가 없습니다. 데스크톱에서 원격 제어를 켠 후 다시 동기화하세요."
+ },
+ "alert": {
+ "actionFailed": "작업 실패",
+ "renameFailed": "이름 변경 실패",
+ "deleteTitle": "대화를 삭제할까요?",
+ "deleteMessage": "「{{title}}」을(를) 삭제합니다. 삭제하면 복구할 수 없습니다."
+ },
+ "a11y": {
+ "selectScope": "대화 범위 선택",
+ "openSettings": "설정 열기",
+ "syncing": "다시 동기화하는 중",
+ "sync": "다시 동기화",
+ "pinnedConversations": "고정된 대화 {{count}}개",
+ "newRemoteConversation": "새 원격 대화",
+ "renameDevice": "{{label}} 이름 변경",
+ "project": "프로젝트 {{title}}",
+ "openAutomationLatest": "자동화 작업 {{title}}의 최근 세션 열기",
+ "automationTask": "자동화 작업 {{title}}",
+ "openConversation": "대화 {{title}} 열기",
+ "collapse": "{{title}} 접기",
+ "expand": "{{title}} 펼치기",
+ "taskError": "작업 오류",
+ "awaitingYou": "확인 대기 중",
+ "doneUnread": "완료·읽지 않음",
+ "running": "실행 중",
+ "close": "닫기",
+ "cancelRename": "이름 변경 취소"
+ },
+ "menu": {
+ "groupByProject": "프로젝트별 그룹화"
+ },
+ "renameDevice": {
+ "title": "기기 이름 변경",
+ "placeholder": "기기 이름",
+ "savingA11y": "기기 이름 저장 중",
+ "saveA11y": "기기 이름 저장"
+ },
+ "renameSession": {
+ "title": "대화 이름 변경",
+ "placeholder": "대화 제목",
+ "savingA11y": "대화 제목 저장 중",
+ "saveA11y": "대화 제목 저장"
+ },
+ "revoked": {
+ "title": "액세스 권한이 취소됨",
+ "body": "「{{deviceName}}」이(가) 이 기기의 원격 액세스를 취소했습니다. 해당 컴퓨터의 {{appName}} 설정에서 이 기기를 다시 승인한 후 「다시 시도」를 누르세요.",
+ "retry": "다시 시도"
+ },
+ "viewAllConversations": "대화 {{count}}개 모두 보기",
+ "viewAllRuns": "실행 {{count}}회 모두 보기",
+ "preview": {
+ "needAttention": "확인 필요 {{count}}개",
+ "waiting": "확인 대기 {{count}}개",
+ "automationRunning": "자동화 실행 중",
+ "totalRuns": "총 {{count}}회 실행"
+ }
+ },
+ "detail": {
+ "filter": {
+ "active": "활성",
+ "waiting": "대기 중",
+ "automation": "자동화",
+ "archived": "보관됨",
+ "all": "전체",
+ "a11y": "{{label}} 대화로 필터링"
+ },
+ "group": {
+ "project": "프로젝트",
+ "date": "날짜",
+ "label": "그룹",
+ "a11y": "{{label}} 기준으로 그룹화"
+ },
+ "metric": {
+ "active": "활동",
+ "waiting": "대기 중",
+ "automation": "자동화",
+ "activeA11y": "활동 중인 대화로 필터링",
+ "waitingA11y": "대기 중인 대화로 필터링",
+ "automationA11y": "자동화 대화로 필터링"
+ },
+ "plan": "스케줄",
+ "automationsButtonA11y": "원격 자동화 열기",
+ "search": {
+ "openA11y": "원격 대화 검색",
+ "closeA11y": "원격 대화 검색 닫기",
+ "label": "검색",
+ "placeholder": "제목, 프로젝트, 모델, 메시지 검색",
+ "clearA11y": "검색 지우기",
+ "closeInputA11y": "검색 닫기",
+ "clear": "지우기",
+ "close": "닫기"
+ },
+ "filters": {
+ "collapseA11y": "대화 필터 접기",
+ "expandA11y": "대화 필터 펼치기",
+ "label": "필터"
+ },
+ "selection": {
+ "count": "대화 {{count}}개 선택됨",
+ "canAct": "실행 가능한 작업 있음",
+ "cannotAct": "실행 가능한 작업 없음",
+ "clearA11y": "대화 선택 해제"
+ },
+ "bulk": {
+ "pinning": "고정 중",
+ "unpinning": "해제 중",
+ "archiving": "보관 중",
+ "restoring": "복원 중",
+ "deleting": "삭제 중",
+ "pinA11y": "선택한 대화 일괄 고정",
+ "unpinA11y": "선택한 대화 고정 일괄 해제",
+ "archiveA11y": "선택한 대화 일괄 보관",
+ "restoreA11y": "선택한 대화 일괄 복원",
+ "deleteA11y": "선택한 대화 일괄 삭제",
+ "cancelA11y": "일괄 작업 취소",
+ "partialFailure": "{{done}}개를 처리했고 {{failed}}개가 실패했습니다(복원됨, 다시 시도할 수 있습니다).",
+ "noArchivable": "선택 항목에 보관할 수 있는 활성 대화가 없습니다.",
+ "noPinnable": "선택 항목에 고정할 수 있는 활성 대화가 없습니다.",
+ "noRestorable": "선택 항목에 복원할 수 있는 보관된 대화가 없습니다.",
+ "noUnpinnable": "선택 항목에 고정된 대화가 없습니다.",
+ "noDeletable": "선택 항목에 삭제할 수 있는 대화가 없습니다.",
+ "noneModifiable": "선택한 대화는 모두 변경할 수 없습니다."
+ },
+ "automationScope": {
+ "eyebrow": "자동화 작업",
+ "title": "자동화 작업",
+ "emptyCopy": "작업이 실행되면 각 실행의 세션이 여기에 표시됩니다.",
+ "emptyTitle": "이 작업에는 아직 실행 기록이 없습니다"
+ },
+ "projectScope": {
+ "eyebrow": "프로젝트",
+ "emptyCopy": "이 프로젝트에서 새 대화를 시작하세요.",
+ "emptyTitle": "이 프로젝트에는 아직 대화가 없습니다"
+ },
+ "subtitle": {
+ "deviceActive": "{{deviceName}} · 활동 중인 대화 {{count}}개",
+ "activeAndProjects": "활동 중인 대화 {{count}}개 · 프로젝트 {{projects}}개"
+ },
+ "row": {
+ "a11yAutomationGroup": "자동화 대화 그룹 {{title}}",
+ "a11ySession": "대화 {{title}}",
+ "a11yCollapse": "{{title}} 접기",
+ "a11yExpand": "{{title}} 펼치기",
+ "collapse": "접기",
+ "expand": "펼치기"
+ },
+ "badge": {
+ "waiting": "대기 중 {{count}}",
+ "automationPrefix": "자동화",
+ "sessionCount": "대화 {{count}}개",
+ "aggregate": "집계",
+ "running": "실행 중",
+ "unread": "읽지 않음 {{count}}"
+ },
+ "child": {
+ "openA11y": "자동화 대화 {{title}} 열기"
+ },
+ "viewAllRuns": "실행 {{count}}회 모두 보기"
+ },
+ "automations": {
+ "error": {
+ "projectMissingConfig": "프로젝트 자동화에 projectConfigId가 없습니다. 데스크톱에서 삭제하세요.",
+ "deletePartial": "자동화를 삭제했지만 생성된 대화 {{count}}개의 상태를 업데이트하지 못했습니다. 데스크톱에서 이 대화들을 확인하세요."
+ },
+ "subtitle": "실행 중 {{active}}개 · 작업 {{total}}개",
+ "metric": {
+ "running": "실행 중",
+ "unreadResults": "읽지 않은 결과",
+ "executing": "처리 중"
+ },
+ "summary": {
+ "paused": "작업 {{count}}개가 일시 중지되었습니다. 작업을 선택하면 실행·일시 중지·편집하거나 최근 세션을 열 수 있습니다.",
+ "default": "작업을 선택하면 실행·일시 중지·편집하거나 최근 세션을 열 수 있습니다."
+ },
+ "empty": {
+ "copy": "휴대폰에서 첫 자동화 작업을 바로 만들거나, 데스크톱에서 만든 후 여기로 동기화할 수 있습니다.",
+ "title": "이 컴퓨터에는 자동화가 없습니다"
+ },
+ "createAutomation": "자동화 새로 만들기",
+ "recentRuns": "최근 실행",
+ "runs": {
+ "emptyCopy": "Run now를 누르면 새 실행이 여기에 표시됩니다.",
+ "emptyTitle": "아직 실행 기록이 없습니다"
+ },
+ "form": {
+ "title": {
+ "create": "자동화 새로 만들기",
+ "edit": "자동화 편집"
+ },
+ "sessionMode": {
+ "bound": "기존 세션에 연결하면 디렉터리, worktree, Agent, Fast 모드가 해당 세션을 따릅니다.",
+ "persistent": "첫 트리거에서 지속 세션을 만들고, 이후 트리거는 같은 세션에서 이어집니다.",
+ "fresh": "트리거할 때마다 새 세션을 만듭니다."
+ },
+ "field": {
+ "name": "이름",
+ "prompt": "프롬프트",
+ "trigger": "트리거 방식",
+ "runSession": "실행 세션",
+ "boundSession": "연결 세션",
+ "intervalMinutes": "간격(분)",
+ "workspace": "작업 공간",
+ "projectDir": "프로젝트 디렉터리",
+ "model": "모델",
+ "effort": "추론 강도",
+ "timezone": "시간대"
+ },
+ "namePlaceholder": "예: 매일 프로젝트 점검",
+ "scriptHint": "이것은 스크립트 전용 작업입니다. 스크립트 설정은 데스크톱에서만 편집할 수 있습니다. 여기서는 이름, 트리거 방식, 알림 등 다른 항목을 변경할 수 있습니다.",
+ "promptPlaceholder": "매번 자동 실행할 때 {{appName}}이(가) 무엇을 하기를 원하는지 명확하게 작성하세요",
+ "trigger": {
+ "recurring": "주기",
+ "manual": "수동"
+ },
+ "session": {
+ "fresh": "새 세션",
+ "persistent": "지속",
+ "bound": "연결"
+ },
+ "boundSessionA11y": "세션 {{name}} 연결",
+ "intervalPlaceholder": "비워 두면 cron 사용",
+ "workspace": {
+ "project": "프로젝트",
+ "dialogue": "대화"
+ },
+ "useWorktree": "worktree 사용",
+ "modelPlaceholderBound": "세션 따르기",
+ "fastMode": "Fast 모드",
+ "notifyDesktop": "데스크톱 알림",
+ "notifyFeishu": "Feishu 알림",
+ "savingA11y": "자동화 저장 중",
+ "saveA11y": "자동화 저장",
+ "cancelA11y": "자동화 편집 취소"
+ },
+ "delete": {
+ "counting": "이 자동화가 생성한 대화를 집계하는 중...",
+ "confirmDeleteBoth": "작업과 대화 삭제",
+ "confirmArchive": "작업 삭제 후 대화 보관",
+ "confirmTaskOnly": "작업만 삭제",
+ "title": "{{name}} 삭제",
+ "copy": "자동화 작업을 삭제해도 이미 시작된 실행은 중단되지 않습니다. 생성된 대화는 아래 옵션에 따라 처리되며 데스크톱과 동일하게 동작합니다.",
+ "optionsA11y": "생성된 대화 처리 방식 선택",
+ "keepDesc": "이 자동화 작업만 삭제하고, 이전 대화는 원래 목록에 그대로 둡니다.",
+ "keepLabel": "생성된 대화 유지",
+ "archiveDesc": "작업을 삭제한 후 생성된 대화를 보관함으로 옮깁니다. 이후에도 검색할 수 있습니다.",
+ "archiveLabel": "생성된 대화 보관",
+ "deleteDesc": "작업을 삭제한 후 생성된 대화도 삭제됨으로 표시합니다. 이 작업은 휴대폰에서 되돌릴 수 없습니다.",
+ "deleteLabel": "생성된 대화 삭제",
+ "cancelA11y": "자동화 삭제 취소",
+ "confirmA11y": "자동화 삭제 확인"
+ },
+ "pause": {
+ "title": "{{name}} 일시 중지",
+ "detailFallback": "일시 중지하면 이 자동화의 트리거가 멈춥니다.",
+ "previewFallback": "실행 중인 run이 없습니다",
+ "confirmA11y": "자동화 일시 중지 확인",
+ "pausing": "일시 중지 중",
+ "confirm": "일시 중지 확인",
+ "cancelA11y": "자동화 일시 중지 취소"
+ },
+ "runDelete": {
+ "title": "이 실행 기록 삭제",
+ "copy": "이 자동화 실행 기록만 삭제합니다. 열었던 대화는 삭제되지 않으며 이후 자동 트리거에도 영향을 주지 않습니다.",
+ "confirmA11y": "실행 기록 삭제 확인",
+ "confirm": "기록 삭제",
+ "cancelA11y": "실행 기록 삭제 취소"
+ },
+ "template": {
+ "label": "템플릿",
+ "loadingA11y": "템플릿 불러오는 중",
+ "refreshA11y": "자동화 템플릿 새로 고침",
+ "loading": "불러오는 중",
+ "refresh": "새로 고침",
+ "cardA11y": "자동화 템플릿 {{name}}",
+ "manualConfig": "수동 설정"
+ },
+ "scheduleRowA11y": "자동화 작업 {{title}}",
+ "detail": {
+ "promptScriptFallback": "스크립트 전용 작업. 설정은 데스크톱에서만 편집할 수 있습니다",
+ "promptEmpty": "저장된 작업 프롬프트가 없습니다",
+ "deleteA11y": "자동화 삭제",
+ "runNowA11y": "자동화 지금 실행",
+ "running": "실행 중",
+ "resumeA11y": "자동화 재개",
+ "pauseA11y": "자동화 일시 중지",
+ "resume": "재개",
+ "pause": "일시 중지",
+ "editA11y": "자동화 편집",
+ "edit": "편집"
+ },
+ "run": {
+ "openSessionA11y": "자동화 세션 열기",
+ "opening": "여는 중",
+ "session": "세션",
+ "restartA11y": "자동화 다시 실행",
+ "restarting": "다시 실행 중",
+ "restart": "다시 실행",
+ "markReadA11y": "실행 기록 읽음으로 표시",
+ "marking": "표시 중",
+ "markRead": "읽음",
+ "deleteA11y": "실행 기록 삭제"
+ }
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/ko/files.json b/apps/mobile/src/i18n/locales/ko/files.json
new file mode 100644
index 0000000000..cdff716375
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ko/files.json
@@ -0,0 +1,90 @@
+{
+ "browser": {
+ "titleFallback": "원격 파일",
+ "workdirSuffix": " · 작업 디렉터리",
+ "footerOnline": "연결됨 · 실시간 동기화",
+ "footerConnecting": "연결 중…",
+ "folderEmpty": "폴더가 비어 있습니다.",
+ "noWorkdir": "이 세션에는 작업 디렉터리가 없어 파일을 탐색할 수 없습니다.",
+ "rootDir": "(루트)",
+ "copyPath": "경로 복사",
+ "sendToSession": "세션으로 보내기",
+ "exportShare": "내보내기 / 공유",
+ "preview": "빠른 미리보기",
+ "copiedPath": "경로를 복사했습니다",
+ "shareFailed": "공유에 실패했습니다. 다시 시도하세요.",
+ "exporting": "컴퓨터에서 내보내는 중…",
+ "downloadFailed": "다운로드에 실패했습니다",
+ "searchPlaceholder": "검색",
+ "cancel": "취소",
+ "searchModeName": "파일 이름",
+ "searchModeContent": "내용",
+ "searchModeA11y": "{{mode}}(으)로 검색",
+ "searchScope": "{{workdir}} 내",
+ "searching": " · 검색 중…",
+ "searchingContent": "파일 내용을 검색하는 중…",
+ "noContentMatch": "일치하는 내용이 없습니다.",
+ "contentSearchMinChars": "파일 내용을 검색하려면 2자 이상 입력하세요.",
+ "contentSummary": "{{matches}}개 일치 · {{files}}개 파일",
+ "contentSummaryTruncated": " · 상한에 도달하여 잘림",
+ "indexing": "파일 색인을 만드는 중…",
+ "noNameMatch": "일치하는 파일 이름이 없습니다.",
+ "nameSearchPrompt": "키워드를 입력해 파일 이름으로 검색하세요.",
+ "nameResultSummary": "결과 {{n}}개 · 이름으로 일치",
+ "viewGrid": "그리드 보기",
+ "viewList": "목록 보기",
+ "sortName": "이름순 정렬",
+ "sortMtime": "수정한 날짜순 정렬",
+ "sortSize": "크기순 정렬",
+ "a11yTitleMenu": "경로 및 보기 메뉴",
+ "a11ySearch": "파일 이름 검색",
+ "a11yMore": "더 보기",
+ "a11yOpenFolder": "폴더 열기 {{name}}",
+ "a11yPreviewFile": "파일 미리보기 {{name}}",
+ "a11yClear": "지우기",
+ "a11yCancelSearch": "검색 취소",
+ "a11yPreviewName": "{{name}} 미리보기",
+ "a11yPreviewNameLine": "{{name}} {{line}}번째 줄 미리보기"
+ },
+ "preview": {
+ "done": "완료",
+ "a11yShare": "내보내 공유",
+ "copyPath": "경로 복사",
+ "sendToSession": "세션으로 보내기",
+ "copiedPath": "경로를 복사했습니다",
+ "exporting": "컴퓨터에서 내보내는 중…",
+ "downloadFailed": "다운로드에 실패했습니다",
+ "fetchingVideo": "컴퓨터에서 동영상을 가져오는 중…",
+ "fetchingAudio": "컴퓨터에서 오디오를 가져오는 중…",
+ "fetchAvFailed": "가져오기에 실패했습니다: {{detail}}",
+ "fetchPdfFailed": "PDF 가져오기에 실패했습니다: {{detail}}",
+ "fetchingPdf": "컴퓨터에서 PDF를 가져오는 중…",
+ "unsupportedType": "이 형식은 휴대폰에서 아직 미리볼 수 없습니다",
+ "oversize": "파일이 미리보기 한도({{size}})를 초과했습니다. 원본을 다운로드해 확인하세요",
+ "oversizeUnknown": "너무 큼",
+ "binaryFile": "바이너리 파일이라 텍스트로 미리볼 수 없습니다",
+ "readFailed": "읽기에 실패했습니다",
+ "truncated2mb": "파일이 2 MB를 초과합니다. 처음 2 MB만 표시합니다",
+ "truncatedLines": "처음 {{lines}}줄만 표시합니다",
+ "mdRendered": "렌더링",
+ "mdSource": "소스",
+ "mdViewA11y": "{{view}} 보기",
+ "a11yViewImage": "큰 이미지 보기 {{name}}",
+ "fetchOriginalFailed": "원본 이미지 가져오기에 실패했습니다: {{detail}}",
+ "a11yRetryOriginal": "원본 이미지 가져오기 재시도",
+ "retry": "재시도",
+ "fetchingOriginal": "컴퓨터에서 원본 이미지를 가져오는 중…",
+ "originalFailedThumb": "원본 가져오기에 실패했습니다. 현재는 썸네일입니다",
+ "fetchingOriginalHint": "썸네일 · 원본 가져오는 중…",
+ "a11yExportShareFile": "원본 파일 내보내 공유",
+ "exportShare": "내보내기 / 공유"
+ },
+ "export": {
+ "exportFailed": "내보내기에 실패했습니다",
+ "leftPage": "페이지를 벗어나 내보내기를 중단했습니다",
+ "exportTimeout": "내보내기 시간이 초과되었습니다. 다시 시도하세요."
+ },
+ "gallery": {
+ "cacheMiss": "원격 미디어 캐시 미스(cachedOnly)"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/ko/home.json b/apps/mobile/src/i18n/locales/ko/home.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ko/home.json
@@ -0,0 +1 @@
+{}
diff --git a/apps/mobile/src/i18n/locales/ko/index.ts b/apps/mobile/src/i18n/locales/ko/index.ts
new file mode 100644
index 0000000000..82fba68991
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ko/index.ts
@@ -0,0 +1,38 @@
+/**
+ * 本 locale 的 catalog 组装:每个区域一个 JSON 文件、一个顶级 key,
+ * 组装成单一 'common' namespace 的资源对象。
+ * 区域清单四语必须一致(与其余 locale 的 index.ts 逐行同构);新增区域时
+ * 四个 locales/<locale>/index.ts 一起加,平价测试会拦截漏改。
+ */
+
+import apiErrors from './apiErrors.json';
+import composer from './composer.json';
+import deviceLink from './deviceLink.json';
+import devices from './devices.json';
+import files from './files.json';
+import home from './home.json';
+import interaction from './interaction.json';
+import message from './message.json';
+import models from './models.json';
+import session from './session.json';
+import settings from './settings.json';
+import shared from './shared.json';
+import startup from './startup.json';
+import update from './update.json';
+
+export default {
+ apiErrors,
+ composer,
+ deviceLink,
+ devices,
+ files,
+ home,
+ interaction,
+ message,
+ models,
+ session,
+ settings,
+ shared,
+ startup,
+ update,
+} as const;
diff --git a/apps/mobile/src/i18n/locales/ko/interaction.json b/apps/mobile/src/i18n/locales/ko/interaction.json
new file mode 100644
index 0000000000..4f8ba88176
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ko/interaction.json
@@ -0,0 +1,149 @@
+{
+ "permission": {
+ "mode": {
+ "default": "기본 권한",
+ "acceptEdits": "편집 허용",
+ "plan": "플랜 모드",
+ "auto": "자동 승인",
+ "bypass": "전체 접근"
+ },
+ "pickerSelect": "권한 모드 {{mode}} 선택",
+ "armedRiskWarning": "확인한 후에만 결정이 컴퓨터로 전송됩니다.",
+ "armedHighRiskTitle": "고위험 작업 확인",
+ "kind": "권한",
+ "deny": "거부",
+ "denyAccessibility": "권한 요청 거부",
+ "alwaysAllow": "이 세션에서 항상 허용",
+ "alwaysAllowAccessibility": "이 세션에서 권한 요청 항상 허용",
+ "alwaysAllowConfirm": "이 세션 허용 확인",
+ "allowOnce": "한 번 허용",
+ "allowOnceAccessibility": "권한 요청 한 번 허용",
+ "allowOnceConfirm": "한 번 허용 확인",
+ "highRisk": "고위험"
+ },
+ "planMode": {
+ "label": "플랜 모드",
+ "exit": "플랜 모드 종료"
+ },
+ "panel": {
+ "readOnlyKind": "확인 대기",
+ "readOnlyTitle": "컴퓨터에서 확인을 기다리는 중",
+ "pendingRequests": "대기 중인 요청",
+ "queueSwitchTo": "{{position}} 대기 중인 요청으로 전환: {{label}}",
+ "queueSwitchGeneric": "대기 중인 요청 전환",
+ "missingRequestId": "이 원격 상호작용에는 requestId가 없어 결정을 돌려보낼 수 없습니다.",
+ "issueConfirmUnsupported": "Issue 제출 확인은 컴퓨터에서만 처리됩니다. 데스크톱 앱으로 돌아가 확인하거나 취소하세요.",
+ "unsupportedType": "이 원격 상호작용 유형은 모바일에서 아직 지원되지 않습니다.",
+ "unsupportedKind": "미지원",
+ "awaitingAnswer": "답변 대기",
+ "continueAccessibility": "원격 질문 계속",
+ "continue": "계속",
+ "askOptionCount": "{{count}}개 선택지",
+ "askFreeInput": "자유 입력",
+ "askModeMulti": "다중 선택",
+ "askModeSingle": "단일 선택",
+ "askMetaCaption": "{{options}} · {{mode}} · 다른 답변 가능",
+ "expandQuestionCard": "질문 카드 펼치기",
+ "collapseQuestionCard": "질문 카드 접기",
+ "selectAnswer": "답변 {{label}} 선택",
+ "submittingHint": "결정을 컴퓨터로 전송 중입니다. 중복 제출하지 마세요.",
+ "customAnswerInputAccessibility": "사용자 지정 답변 입력",
+ "customAnswerPlaceholder": "다른 답변 입력",
+ "customAnswerButtonText": "다른 답변 입력...",
+ "answerInput": "답변 입력",
+ "previous": "이전",
+ "skipAccessibility": "질문 건너뛰기",
+ "skip": "건너뛰기",
+ "submitAnswerAccessibility": "답변 제출",
+ "next": "다음",
+ "answerRequired": "답변을 선택하거나 입력해야 계속할 수 있습니다.",
+ "submit": "제출",
+ "planReviewTitle": "Claude의 플랜 검토",
+ "planExpand": "플랜 펼치기",
+ "planEditHint": "편집 모드로 플랜 조정",
+ "planBrowseHint": "섹션을 탭하면 이동합니다",
+ "planEditToggle": "플랜 편집",
+ "planEditExit": "플랜 편집 종료",
+ "planCollapse": "플랜 접기",
+ "planExpandArea": "플랜 보기 영역 펼치기",
+ "planHalf": "반 화면 플랜으로 전환",
+ "planEditorAccessibility": "플랜 편집기",
+ "planEditorPlaceholder": "플랜 편집",
+ "planOutline": "목차",
+ "planJumpTo": "플랜 섹션 {{title}}(으)로 이동",
+ "planEmpty": "플랜 내용이 비어 있습니다.",
+ "planApproveAccessibility": "플랜 승인 및 실행",
+ "planApprove": "Claude의 플랜을 승인하고 코딩 시작",
+ "planFeedbackLabel": "플랜 피드백",
+ "planFeedbackPlaceholder": "Claude에게 무엇을 해야 할지 알려주세요",
+ "planFeedbackRequired": "제출하기 전에 피드백을 입력하세요.",
+ "planFeedbackSubmit": "플랜 피드백 제출",
+ "planFeedbackAccessibility": "플랜을 변경할 피드백"
+ },
+ "rewind": {
+ "readError": "되감기 미리보기를 읽을 수 없습니다. 다시 동기화한 후 시도하세요.",
+ "noFilesNote": "롤백할 파일이 없습니다. 이 메시지 이후의 대화 기록만 잘립니다.",
+ "moreFiles": "파일 {{count}}개 더",
+ "stats": "파일 {{count}}개 · +{{insertions}} / -{{deletions}} 줄",
+ "gotIt": "확인",
+ "cancel": "취소",
+ "cancelAccessibility": "되감기 취소",
+ "confirm": "되감기 확인",
+ "confirming": "되감는 중",
+ "titleLoading": "되감기 영향 확인 중",
+ "titleDefault": "이 메시지로 되감을까요?",
+ "titleEmpty": "대화 기록만 되감기",
+ "titleError": "되감을 수 없음",
+ "detailLoading": "컴퓨터에서 파일 되감기 미리보기를 읽는 중입니다.",
+ "detailDefault": "아래 파일을 롤백하고 이 메시지 이후의 대화 기록을 자릅니다.",
+ "detailEmpty": "롤백할 파일이 없습니다. 확인하면 이 메시지 이후의 대화 기록만 잘립니다.",
+ "detailError": "컴퓨터가 이 되감기를 거부했습니다."
+ },
+ "collab": {
+ "dispatchSummaryItem": "{{label}}: {{task}}",
+ "batchTitle": "worker {{count}}명에게 일괄 배정",
+ "batchTitleGeneric": "여러 worker에게 일괄 배정",
+ "batchBodyFallback": "worker 일괄 생성",
+ "dispatchTitle": "worker {{who}}에게 배정",
+ "dispatchRole": "역할 {{meta}}",
+ "dispatchBodyFallback": "worker 생성",
+ "sendTitle": "worker에게 메시지 전송",
+ "sendBodyFallback": "메시지 전송",
+ "reportTitle": "worker 보고",
+ "reportBodyFallback": "(빈 보고)"
+ },
+ "contextSheet": {
+ "backAccessibility": "컨텍스트 패널로 돌아가기",
+ "goalStatus": {
+ "active": "진행 중",
+ "paused": "일시정지됨",
+ "blocked": "대기 중",
+ "complete": "완료됨",
+ "budgetLimited": "한도 도달",
+ "usageLimited": "사용량 제한됨"
+ },
+ "goalLabel": "목표",
+ "goalObjectiveAccessibility": "목표 내용",
+ "goalPlaceholder": "무엇을 달성하고 싶나요? 에이전트가 완료하거나 한도에 도달할 때까지 이 목표를 중심으로 자동으로 계속 진행합니다.",
+ "advancedSettings": "고급 설정",
+ "limitsHint": "변경하지 않으면 제어 대상 컴퓨터의 기본 한도를 따릅니다. 한도 중 하나에 도달하면 목표가 자동으로 중지되며 언제든지 수동으로 종료할 수 있습니다. \"무제한\"은 해당 한도를 설정하지 않음을 의미합니다.",
+ "maxTurns": "최대 턴 수",
+ "tokenBudget": "토큰 예산",
+ "noProgressLimit": "무진전 한도",
+ "startGoal": "목표 시작",
+ "goalMeta": "{{turns}} 턴 · {{tokens}} token",
+ "pause": "일시정지",
+ "resume": "계속",
+ "clearGoal": "목표 종료",
+ "unlimited": "무제한",
+ "noScreenshots": "스크린샷을 찾을 수 없습니다.",
+ "mediaRemove": "사진 첨부 {{name}} 제거",
+ "mediaDeselect": "사진 {{name}} 선택 해제",
+ "mediaSelect": "사진 {{name}} 선택",
+ "photoPermissionHint": "사진 접근이 꺼져 있습니다. 켜면 최근 사진을 빠르게 추가할 수 있습니다.",
+ "enablePhotoPermission": "사진 접근 켜기",
+ "enable": "켜기",
+ "icloudTimeout": "사진이 아직 iCloud에서 다운로드 중이며 시간이 초과되었습니다. 네트워크를 확인하고 다시 시도하세요.",
+ "photoNotReadable": "이 사진은 지금 읽을 수 없습니다(iCloud에서 다운로드가 완료되지 않았을 수 있습니다). 나중에 다시 시도하세요."
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/ko/message.json b/apps/mobile/src/i18n/locales/ko/message.json
new file mode 100644
index 0000000000..fd5fd4d66e
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ko/message.json
@@ -0,0 +1,191 @@
+{
+ "renderer": {
+ "previousQuestionJump": "이전 질문으로 이동: {{preview}}",
+ "noPreview": "미리보기 없음",
+ "newMessagesToBottom": "새 메시지, 맨 아래로 이동",
+ "jumpToBottom": "맨 아래로 이동",
+ "openForkOrigin": "분기 원본 메시지 열기",
+ "viewForkOrigin": "분기 원본 보기",
+ "emptyMessages": "메시지가 없습니다",
+ "syncing": "동기화 중",
+ "copyLinkHint": "탭하여 메시지 링크 복사",
+ "sentTime": "보낸 시간 {{time}}",
+ "linkCopied": "링크를 복사했습니다",
+ "turnCostEstimate": "이번 턴 {{cost}}",
+ "turnCost": "이번 턴 소비 {{cost}}",
+ "messageGenerating": "메시지 생성 중",
+ "generating": "생성 중",
+ "collapseMessage": "메시지 접기",
+ "expandMessage": "메시지 펼치기",
+ "collapse": "접기",
+ "expand": "펼치기",
+ "automationOriginNamed": "자동화 작업 「{{name}}」에서 전송",
+ "automationOrigin": "자동화 작업에서 전송",
+ "modelMismatch": "이번 턴은 선택한 {{selected}}이(가) 아니라 {{actual}}이(가) 응답했습니다(서버 측 임시 다운그레이드)",
+ "copyStateCopying": "복사 중",
+ "copyStateCopied": "복사됨",
+ "copyStateFailed": "복사 실패",
+ "copyStateCopy": "복사",
+ "thinkingHidden": "생각 내용 숨김",
+ "thinkingDone": "생각 {{duration}}",
+ "thinkingActive": "생각 중 {{elapsed}}",
+ "thinkingProcess": "생각 과정",
+ "thinkingEmpty": "모델이 표시할 생각 내용을 반환하지 않았습니다.",
+ "thinkingNoContent": "생각 내용 없음",
+ "collapseRow": "{{label}} 접기",
+ "expandRow": "{{label}} 펼치기",
+ "statusRunning": "실행 중",
+ "statusCompleted": "완료됨",
+ "statusFailed": "실패",
+ "statusStopped": "중지됨",
+ "toolUseCount": "도구 호출 {{n}}회",
+ "subagentTaskTitle": "서브 에이전트 작업",
+ "recentTool": "최근 도구: {{name}}",
+ "outputFile": "출력: {{file}}",
+ "noMoreDetail": "추가 세부 정보 없음",
+ "filesRead": "파일 {{n}}개 읽음",
+ "searchCount": "{{n}}회 검색",
+ "listCount": "{{n}}회 목록 표시",
+ "collapseThinking": "생각 내용 접기",
+ "expandThinking": "생각 내용 펼치기",
+ "subagentTyped": "서브 에이전트 · {{type}}",
+ "subagent": "서브 에이전트",
+ "workedDuration": "작업 시간 {{duration}}",
+ "subagentSummary": "서브 에이전트 요약",
+ "agentSwitchLabel": "{{from}}에서 {{to}}(으)로 전환됨",
+ "agentSwitchViewHandoff": "{{label}}, 인계 내용 보기",
+ "sessionResumedPill": "원래 세션을 재개함",
+ "handoffContentDesc": "인계 내용——전환 시 새 엔진에 전달되는 컨텍스트 요약(내 메시지에는 표시되지 않음)",
+ "openDiagramDetail": "다이어그램 세부 정보 열기",
+ "sessionChipFallback": "세션 {{id}}",
+ "imageFallbackTitle": "이미지",
+ "mermaidExportFailedTitle": "내보내기 실패",
+ "mermaidRenderIncompleteBody": "다이어그램이 아직 완전히 렌더링되지 않았거나 내보내기에 실패했습니다. 나중에 다시 시도하세요.",
+ "mermaidDiagramTitle": "Mermaid 다이어그램",
+ "mermaidAnnotateFailedTitle": "주석 추가 실패",
+ "annotateSendToChat": "주석을 달아 대화로 보내기",
+ "exportDiagramImage": "다이어그램을 이미지로 내보내기",
+ "closeDetail": "세부 정보 닫기",
+ "copyDetailContent": "세부 내용 복사",
+ "openDetailLink": "세부 정보 링크 열기",
+ "mediaNotPreviewable": "이 미디어는 지금 바로 미리 볼 수 없습니다.",
+ "retryRemoteMediaFetch": "원격 미디어 가져오기 재시도",
+ "retryFetch": "가져오기 재시도",
+ "openMedia": "미디어 열기",
+ "readCurrentRemoteFile": "현재 원격 파일 읽기",
+ "reading": "읽는 중",
+ "retryFilePreview": "파일 미리보기 재시도",
+ "readCurrentFile": "현재 파일 읽기",
+ "currentFilePreview": "현재 파일 미리보기",
+ "diffNoOldContent": "이전 내용 없음",
+ "diffOldTitle": "이전",
+ "diffNoNewContent": "새 내용 없음",
+ "diffNewTitle": "새 내용",
+ "fileKind": "파일",
+ "loadRemoteTextPreview": "원격 텍스트 미리보기 불러오기",
+ "loading": "불러오는 중",
+ "retryPreview": "미리보기 재시도",
+ "loadPreview": "미리보기 불러오기",
+ "copyRemoteFilePath": "원격 파일 경로 복사",
+ "copyPath": "경로 복사",
+ "copiedPath": "경로를 복사했습니다",
+ "copyPathFailed": "경로 복사 실패",
+ "remoteMediaIdle": "원격 미디어 가져오기 준비 중",
+ "remoteMediaLoading": "원격 컴퓨터에서 가져오는 중",
+ "remoteMediaReady": "원격 미디어를 가져왔습니다",
+ "remoteMediaFetchFailed": "가져오기 실패: {{message}}",
+ "mediaPending": "{{label}} 재생 대기",
+ "mediaLoaded": "{{label}} 로드됨{{progress}}",
+ "mediaPlaying": "{{label}} 재생 중{{progress}}",
+ "mediaPaused": "{{label}} 일시정지{{progress}}",
+ "mediaBuffering": "{{label}} 버퍼링 중{{progress}}",
+ "mediaEnded": "{{label}} 종료됨{{progress}}",
+ "mediaError": "{{label}} 재생 오류{{error}}",
+ "mediaSourceUrl": "원본 주소: {{url}}",
+ "mediaDownloadUrl": "다운로드 주소: {{url}}",
+ "mediaSize": "크기: {{size}}",
+ "mediaExpiresAt": "만료 시간: {{time}}",
+ "mediaErrorLine": "오류: {{message}}",
+ "mediaDeviceLinkHint": "모바일은 device-link를 통해 원격 컴퓨터에 미디어 업로드를 요청한 후 엽니다.",
+ "controlDelete": "메시지 삭제",
+ "controlRewind": "여기로 되돌리기",
+ "controlFork": "대화 분기",
+ "markdownDocAriaLabel": "메시지 본문",
+ "toolOutputTitle": "{{label}} 출력",
+ "mermaidEmpty": "빈 Mermaid 다이어그램.",
+ "diffEditCount": "{{n}}개 편집"
+ },
+ "actions": {
+ "attachmentsPrefix": "첨부파일: {{names}}",
+ "justNow": "방금",
+ "minutesAgo": "{{n}}분 전",
+ "hoursAgo": "{{n}}시간 전",
+ "turnCostValue": "예상 {{value}}"
+ },
+ "lightbox": {
+ "cancelAnnotation": "주석 취소",
+ "cancel": "취소",
+ "undoLastStroke": "마지막 획 취소",
+ "undo": "실행 취소",
+ "done": "완료",
+ "shareImage": "이미지 공유",
+ "annotateImage": "이미지에 주석",
+ "annotate": "주석",
+ "exportShare": "내보내기 / 공유",
+ "sendToChat": "대화로 보내기",
+ "loadFailed": "이미지 로드 실패",
+ "retryLoadImage": "이미지 로드 재시도",
+ "retry": "재시도",
+ "closeImage": "이미지 닫기"
+ },
+ "queue": {
+ "continueSystemInstruction": "완료되지 않은 작업 계속(시스템 지시)",
+ "systemInstruction": "시스템 지시",
+ "retrySend": "전송 재시도",
+ "clearError": "오류 지우기",
+ "credentialSwitchWait": "다른 Codex 작업이 끝나기를 기다리는 중입니다. 끝나면 자동으로 전송합니다",
+ "aborting": "중지 중입니다. 대기 중인 메시지는 여기에 유지됩니다",
+ "paused": "큐가 일시정지되었습니다. 대기 중인 메시지는 자동으로 전송되지 않습니다",
+ "resumeSendQueue": "큐 전송 재개",
+ "resume": "계속",
+ "attachmentCount": "첨부파일 {{n}}개",
+ "attachmentMessage": "첨부파일 메시지",
+ "steeringLabel": "끼어들어 전송 중:{{text}}",
+ "queuedMessageLabel": "대기 중인 메시지 {{index}}:{{text}}",
+ "editingInComposer": "아래 입력창에서 편집 중…",
+ "cancel": "취소",
+ "edit": "편집",
+ "steer": "끼어들기",
+ "collapseQueued": "대기 중인 메시지 접기",
+ "expandRemainingQueued": "남은 {{n}}개의 대기 중인 메시지 펼치기",
+ "collapse": "접기",
+ "expandRemaining": "남은 {{n}}개 펼치기",
+ "sendFailedMessage": "전송 실패한 메시지:{{text}}",
+ "sendingMessage": "전송 중인 메시지:{{text}}",
+ "uploadingAttachments": "첨부파일 업로드 중 {{uploaded}}/{{total}}",
+ "delete": "삭제",
+ "retry": "재시도"
+ },
+ "systemCard": {
+ "goalComplete": "목표 달성 · {{turns}}회 · 소요 {{duration}}",
+ "goalResumed": "사용량이 회복되어 목표를 계속합니다",
+ "autoResume": "연결이 끊겨 자동으로 계속했습니다",
+ "modelLabel": "모델",
+ "sessionLabel": "세션",
+ "sessionResumed": "재개됨",
+ "agentSwitch": "{{from}}에서 {{to}}(으)로 전환됨",
+ "learnStarted": "스킬 학습을 시작했습니다",
+ "learnStartedBody": "증류는 데스크톱 백그라운드에서 진행됩니다. 완료되면 데스크톱에서 스킬 초안을 확인하고 검토하세요.",
+ "learnFailed": "스킬 학습을 시작하지 못했습니다",
+ "learnBusyBody": "이미 학습 작업이 진행 중입니다. 완료된 후 다시 시도하세요.",
+ "learnFailedBody": "시작 실패:{{detail}}",
+ "unknownError": "알 수 없는 오류"
+ },
+ "quote": {
+ "count": "인용 {{n}}건",
+ "countPreviewHint": "인용 {{n}}건, 탭하여 미리보기",
+ "remove": "인용 제거",
+ "closePreview": "인용 미리보기 닫기",
+ "menuLabel": "대화에 추가"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/ko/models.json b/apps/mobile/src/i18n/locales/ko/models.json
new file mode 100644
index 0000000000..7da7361511
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ko/models.json
@@ -0,0 +1,36 @@
+{
+ "picker": {
+ "title": "모델",
+ "permissionTitle": "권한",
+ "searchAccessibility": "모델 검색",
+ "searchPlaceholder": "모델 검색...",
+ "noResults": "일치하는 모델이 없습니다",
+ "emptyDefault": "사용 가능한 모델이 없습니다",
+ "loadingDefault": "모델을 불러오는 중…",
+ "subscriptionBadge": "구독",
+ "backToModels": "모델 목록으로 돌아가기",
+ "agentSwitchHint": "모델을 선택하면 다음 메시지부터 {{agent}}(으)로 전환됩니다",
+ "crossAgentEmptyHint": "먼저 제어 대상 컴퓨터에서 {{agent}} 모델 소스를 연결하세요",
+ "permissionModeAccessibility": "권한 모드:{{mode}}",
+ "selectProviderModelAccessibility": "{{provider}}의 모델 {{model}} 선택",
+ "selectModelAccessibility": "모델 {{model}} 선택",
+ "configureAccessibility": "{{model}} 구성",
+ "budgetDisabledHint": "이 모델을 사용하려면 먼저 제어 대상 컴퓨터에서 API 키를 설정해야 합니다",
+ "priceLine": "입력 {{input}} · 출력 {{output}} / 100만 토큰",
+ "contextSuffix": "{{size}} 컨텍스트",
+ "fastTag": "빠름"
+ },
+ "options": {
+ "fastMode": "빠른 모드",
+ "fastModeAccessibility": "빠른 모드 {{model}}",
+ "reasoningEffort": "추론 강도",
+ "reasoningEffortAccessibility": "추론 강도 {{label}}"
+ },
+ "agentSwitch": {
+ "browseAccessibility": "{{agent}} 모델 보기",
+ "confirmTitle": "{{agent}}(으)로 전환할까요?",
+ "confirmMessage": "다음 메시지를 보낼 때 {{appName}}이(가) 현재 세션을 {{agent}}에 인계합니다. 두 에이전트는 컨텍스트와 도구에 대한 이해가 다를 수 있으니 확인 후 대상 모델을 선택하세요.",
+ "cancel": "취소",
+ "confirm": "계속 선택"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/ko/session.json b/apps/mobile/src/i18n/locales/ko/session.json
new file mode 100644
index 0000000000..040236d7ab
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ko/session.json
@@ -0,0 +1,237 @@
+{
+ "common": {
+ "cancel": "취소",
+ "delete": "삭제",
+ "openContextPanel": "컨텍스트 패널 열기",
+ "groupMode": "모드",
+ "groupAdd": "추가",
+ "planMode": "플랜 모드",
+ "goalMode": "목표 모드",
+ "context": "컨텍스트",
+ "screenshot": "스크린샷",
+ "photo": "사진",
+ "takePhoto": "사진 촬영",
+ "file": "파일",
+ "joinConversation": "대화에 추가 ({{num}}장)",
+ "paletteLoading": "불러오는 중",
+ "noMatchingCommands": "일치하는 명령이 없습니다",
+ "noMatchingResources": "일치하는 리소스가 없습니다",
+ "keepTypingToNarrow": "계속 입력하여 결과 좁히기",
+ "insertCommand": "명령 {{name}} 삽입",
+ "insertResource": "리소스 {{name}} 삽입",
+ "openMicPermission": "마이크 권한 설정 열기",
+ "maxAttachments": "첨부는 최대 {{max}}개까지 가능합니다.",
+ "voiceStopRecording": "녹음 중지",
+ "capabilitiesUnsupported": "지원되지 않는 원격 기능 형식입니다"
+ },
+ "screen": {
+ "composerSyncing": "세션 데이터를 동기화 중입니다. 완료되면 보낼 수 있습니다.",
+ "composerCreating": "세션을 만드는 중입니다. 첫 메시지가 전송되면 계속 보낼 수 있습니다.",
+ "nextAgentSwitch": "다음부터 {{agent}} · {{model}}(으)로 전환",
+ "createFailedTitle": "세션 생성 실패",
+ "createFailedDefault": "세션 생성에 실패했습니다.",
+ "createFailedNotice": "세션 생성 실패: {{message}}",
+ "backToEdit": "편집으로 돌아가기",
+ "retry": "다시 시도",
+ "firstMessageNotSent": "첫 메시지가 전송되지 않았습니다. 내용이 입력창에 복원되었습니다.",
+ "locateMessageNotFound": "이동할 메시지를 찾을 수 없습니다.",
+ "shareNoLocalImage": "로컬 이미지 파일을 가져올 수 없습니다",
+ "shareFailedTitle": "공유 실패",
+ "shareUnsupported": "현재 앱 버전은 아직 공유를 지원하지 않습니다. 최신 버전으로 업데이트한 후 다시 시도하세요.",
+ "downloadFailed": "다운로드 실패",
+ "voiceNoRemoteDevice": "원격 기기가 없어 음성 입력을 시작할 수 없습니다.",
+ "voiceSenderNotReady": "메시지 전송기가 초기화되지 않았습니다.",
+ "voiceStopAndSend": "음성 입력 종료 후 전송",
+ "sendMessage": "원격 메시지 보내기",
+ "voiceStartInput": "음성 입력 시작",
+ "stopSession": "원격 세션 중지",
+ "sessionNotFoundResync": "현재 원격 세션을 찾을 수 없습니다. 다시 동기화한 후 보내세요.",
+ "missingWorkingDir": "이 세션에는 작업 디렉터리가 없어 메시지를 보낼 수 없습니다.",
+ "queueMessageGone": "이 대기열 메시지는 더 이상 대기열에 없습니다. 변경 사항이 저장되지 않았습니다.",
+ "editQueueUnsupported": "컴퓨터 버전이 오래되어 대기열의 인용·첨부 변경이나 텍스트 지우기를 안전하게 지원하지 않습니다. 컴퓨터를 업데이트하거나 일반 텍스트만 수정하세요.",
+ "sessionNotSyncedRetry": "세션 동기화가 아직 완료되지 않았습니다. 잠시 후 다시 시도하세요.",
+ "savingPreviousQueueEdit": "이전 대기열 메시지의 변경을 저장 중입니다. 완료된 후 편집하세요.",
+ "attachmentsUploadingBeforeEdit": "첨부 파일을 업로드 중입니다. 완료된 후 대기열 메시지를 편집하세요.",
+ "goalAlreadyActive": "이 세션에는 진행 중인 목표가 있습니다. 먼저 여기에서 처리하세요.",
+ "resetReconfirmTitle": "다시 확인해 주세요",
+ "resetOfferExpired": "재설정 자격 증명이 만료되었습니다. 새로 고친 사용량 정보를 확인하세요.",
+ "resetOutcomeReset": "Codex 사용량 창을 재설정했습니다.",
+ "resetOutcomeNothing": "지금 재설정이 필요한 사용량 창이 없습니다.",
+ "resetOutcomeNoCredit": "사용 가능한 재설정 횟수가 없습니다.",
+ "resetOutcomeAlready": "이 재설정 요청은 이미 처리되었으며 사용량이 새로 고쳐졌습니다.",
+ "resetDoneTitle": "재설정 완료",
+ "resetResultTitle": "재설정 결과",
+ "resetFailedTitle": "재설정 실패",
+ "operationFailed": "작업 실패",
+ "sessionDeviceNotFound": "이 세션이 속한 컴퓨터를 찾을 수 없습니다. 해당 기기가 연결되어 있는지 확인하고 다시 시도하세요.",
+ "deleteMessageTitle": "이 메시지를 삭제할까요?",
+ "deleteMessageBody": "사용자 메시지는 이 항목만 삭제됩니다. AI 메시지의 경우 이전 사용자 입력 이후 생성된 전체 턴이 삭제됩니다. 이후 대화는 유지됩니다. 다음 전송 시 남은 기록에서 AI 컨텍스트가 다시 구성됩니다.",
+ "deleteMessageAction": "이 메시지 삭제",
+ "readingCapabilities": "{{agent}} 실행 기능을 불러오는 중…",
+ "editingQueueMessageNumbered": "대기열 메시지 {{index}}번째 편집 중",
+ "editingQueueMessage": "대기열 메시지 편집 중",
+ "discardQueueEdit": "대기열 메시지 편집 취소",
+ "savingHint": "변경을 저장 중입니다. 완료된 후 진행하세요.",
+ "composerPlaceholder": "원격 메시지 입력",
+ "openSessionMenu": "세션 메뉴 열기",
+ "searchTitle": "이 세션 검색",
+ "searchPlaceholder": "이 세션의 메시지 검색",
+ "searchEnterKeyword": "검색어 입력",
+ "searchNoMatch": "일치하는 메시지가 없습니다",
+ "searchPrevious": "이전 검색 결과",
+ "searchNext": "다음 검색 결과",
+ "syncingSession": "세션 동기화 중",
+ "awaitingSync": "세션 동기화 대기 중",
+ "resync": "원격 세션 다시 동기화",
+ "collapseHistory": "기록 접기",
+ "expandHistory": "기록 보기",
+ "readOnlyMode": "읽기 전용",
+ "accessRevokedShort": "액세스 취소됨",
+ "sessionNotSynced": "세션 미동기화",
+ "conversationFallback": "대화",
+ "accessRevoked": "컴퓨터에서 액세스 권한을 취소했습니다",
+ "syncing": "동기화 중",
+ "pendingCount": "대기 {{num}}건",
+ "archived": "보관됨",
+ "queuePausedNotice": "대기열 일시 중지됨"
+ },
+ "new": {
+ "selectDevice": "컴퓨터 선택",
+ "workspaceDialogue": "대화",
+ "workspaceProject": "프로젝트",
+ "selectProject": "프로젝트 선택",
+ "composerPlaceholder": "오늘 무엇을 해볼까요~",
+ "voiceSelectDeviceFirst": "컴퓨터를 선택한 후 음성 입력을 사용하세요.",
+ "creatingSession": "세션 생성 중",
+ "createAndSend": "세션을 만들고 첫 메시지 보내기",
+ "modelAccessibility": "모델: {{model}}",
+ "voiceInput": "음성 입력",
+ "selectDeviceError": "컴퓨터를 선택하세요.",
+ "enterProjectPath": "컴퓨터의 프로젝트 경로를 입력하세요.",
+ "enterModel": "모델을 입력하세요.",
+ "enterFirstMessageOrAttachment": "첫 메시지를 입력하거나 첨부를 추가하세요.",
+ "noSessionIdReturned": "컴퓨터에서 새 세션 ID를 반환하지 않았습니다.",
+ "sessionIdNotAdopted": "컴퓨터가 미리 생성된 세션 ID를 사용하지 않았습니다(컴퓨터 버전 이상). 컴퓨터를 업데이트한 후 다시 시도하세요.",
+ "firstMessageMissingConfirm": "첫 메시지가 전송되지 않았습니다. 내용이 입력창에 복원되었습니다. 보내기 전에 이 메시지가 세션에 없는지 확인하세요.",
+ "firstMessageUnconfirmed": "첫 메시지의 전송 상태를 확인할 수 없습니다. 내용이 입력창에 복원되었습니다. 보내기 전에 이 메시지가 이미 세션에 있는지 확인하세요.",
+ "selectControlledDevice": "제어할 컴퓨터 선택",
+ "selectDeviceNamed": "컴퓨터 {{name}} 선택",
+ "selectAgent": "에이전트 선택",
+ "switchToAgent": "{{label}}(으)로 전환",
+ "selectWorkspace": "작업 공간 선택",
+ "dialogueNoProject": "대화(프로젝트 없음)",
+ "selectProjectNamed": "프로젝트 {{title}} 선택",
+ "noProjects": "아직 프로젝트가 없습니다",
+ "chooseOtherFolder": "다른 프로젝트 폴더 선택",
+ "readingRemoteDir": "원격 디렉터리를 읽는 중...",
+ "goParentDir": "상위 디렉터리로",
+ "parentDir": "상위",
+ "useCurrentRemoteDir": "현재 원격 디렉터리 사용",
+ "useCurrent": "현재 사용",
+ "firstMessagePlaceholder": "첫 메시지 입력",
+ "noModelsAvailable": "사용 가능한 모델이 없습니다",
+ "selectDeviceFirst": "먼저 컴퓨터를 선택하세요",
+ "enterDir": "디렉터리 {{name}} 열기",
+ "selectDir": "디렉터리 {{name}} 선택",
+ "select": "선택",
+ "noModelSelected": "모델 미선택",
+ "assignedDialogueDir": "컴퓨터가 할당한 대화 디렉터리",
+ "extraDirsSuffix": "+{{num}} 추가 디렉터리",
+ "noProjectPath": "프로젝트 경로 미선택",
+ "dialogueWorkspace": "대화 작업 공간",
+ "previewDevice": "컴퓨터: {{name}}",
+ "unknownDevice": "알 수 없는 기기",
+ "previewLocation": "위치: {{target}}",
+ "previewRuntime": "실행: {{runtime}}",
+ "previewFirstMessage": "첫 메시지: {{preview}}",
+ "previewFirstAttachmentOnly": "첫 메시지: 첨부만 전송",
+ "previewFirstEmpty": "첫 메시지: 미입력",
+ "previewAttachments": "첨부: {{num}}개",
+ "previewReadyTitle": "만들고 보낼 준비 완료",
+ "previewNotReadyTitle": "아직 만들 수 없습니다",
+ "previewReadySubtitle": "확인하면 제어 컴퓨터에 세션을 만들고 첫 메시지를 대기열에 추가합니다."
+ },
+ "menu": {
+ "chipPinned": "고정됨",
+ "chipArchived": "보관됨",
+ "chipReadOnly": "읽기 전용",
+ "titleFallback": "원격 세션",
+ "renameAction": "대화 이름 변경",
+ "copyLinkAction": "대화 링크 복사",
+ "unpin": "고정 해제",
+ "pin": "고정",
+ "restore": "복원",
+ "archive": "보관",
+ "deleteAction": "세션 삭제",
+ "deleteConversation": "대화 삭제",
+ "workingDir": "작업 디렉터리",
+ "aiRenameUnsupported": "컴퓨터 버전이 오래되어 자동 이름 짓기를 아직 지원하지 않습니다.",
+ "aiRenameOffline": "컴퓨터가 오프라인입니다. 나중에 다시 시도하세요.",
+ "aiRenameFailed": "자동 이름 짓기에 실패했습니다. 다시 시도하세요.",
+ "contextUsageSummary": "컨텍스트 {{percent}}%",
+ "copied": "복사됨",
+ "copyFailed": "복사 실패",
+ "deleteConfirmTitle": "세션을 삭제할까요?",
+ "deleteConfirmBody": "삭제하면 되돌릴 수 없습니다.",
+ "dirAlreadyAdded": "이 디렉터리는 이미 목록에 있습니다.",
+ "resetCodexTitle": "Codex 사용량을 재설정할까요?",
+ "resetCodexBody": "{{account}}에 대해 재설정 1회를 사용합니다. 사용량 창이 즉시 다시 열리며 이 작업은 취소할 수 없습니다.",
+ "currentCodexAccount": "현재 Codex 계정",
+ "resetConsumeOnce": "재설정 1회 사용",
+ "titlePlaceholder": "세션 제목",
+ "aiRenameLabel": "AI 자동 이름 짓기",
+ "viewUsageDetail": "세션 사용량 세부 정보 보기",
+ "linkCopied": "링크 복사됨",
+ "sessionInfo": "세션 정보",
+ "usageSection": "사용량",
+ "refreshContextUsage": "컨텍스트 사용량 새로 고침",
+ "currentSessionSpend": "이번 세션",
+ "noSessionSpend": "아직 세션 사용량이 없습니다",
+ "contextLabel": "컨텍스트",
+ "accountLimits": "계정 한도",
+ "quotaExhaustedResettable": "현재 사용량을 모두 소진했습니다. 재설정하면 즉시 1회가 사용되며 취소할 수 없습니다.",
+ "resetting": "재설정 중…",
+ "resetCodexUsage": "Codex 사용량 재설정",
+ "quotaExhaustedNoCredit": "현재 사용량을 모두 소진했지만 사용 가능한 재설정 횟수가 없습니다.",
+ "openDir": "디렉터리 열기",
+ "copyPath": "경로 복사",
+ "extraDirsSection": "추가 참조 디렉터리",
+ "noExtraDirs": "아직 추가 디렉터리가 없습니다. 추가 디렉터리는 제어 컴퓨터의 에이전트에 추가 컨텍스트로 제공됩니다.",
+ "remove": "제거",
+ "collapseRemoteDir": "원격 디렉터리 접기",
+ "browseRemoteDir": "원격 디렉터리 찾아보기",
+ "reading": "읽는 중…",
+ "parentDir": "상위",
+ "addCurrentDir": "현재 디렉터리 추가",
+ "enterRemoteDir": "원격 디렉터리 {{name}} 열기",
+ "add": "추가",
+ "noSubDirs": "이 디렉터리에는 열 수 있는 하위 디렉터리가 없습니다.",
+ "dirLimitNotice": "처음 30개 디렉터리만 표시합니다. 더 구체적인 디렉터리로 들어가 계속 선택하세요.",
+ "confirmRename": "이름 변경 확인",
+ "confirm": "확인",
+ "cancelRename": "이름 변경 취소",
+ "backToMenu": "세션 메뉴로 돌아가기"
+ },
+ "tail": {
+ "interrupted": "작업 실행 도중 앱이 종료되어 중단되었습니다.",
+ "continueTask": "작업 계속",
+ "retry": "다시 시도",
+ "ignore": "무시",
+ "codexThreadLost": "Codex 인증 모드가 전환되어 이 세션을 계속할 수 없습니다 —— 새 세션을 만들면 적용됩니다.",
+ "encryptedContentInvalid": "공급자 변경으로 암호화를 사용할 수 없게 되어 이 세션은 원래 공급자에서만 사용할 수 있습니다. 컴퓨터에서 처리하세요(Fork하여 프로토콜 암호화 콘텐츠를 버린 후 새 세션에서 계속할 수 있습니다)."
+ },
+ "row": {
+ "moreOptions": "기타 옵션",
+ "archiveConversation": "대화 보관",
+ "closeActionMenu": "세션 작업 메뉴 닫기",
+ "referenceAroundAnchor": "링크 부근",
+ "referenceRecent": "최근 메시지",
+ "referenceCount": "{{num}}건",
+ "referenceTruncated": "잘림",
+ "pinnedSection": "고정됨",
+ "extraDirsSummary": "추가 디렉터리 {{num}}개",
+ "noExtraDirsSummary": "추가 디렉터리 없음",
+ "attachmentUploadFailed": "첨부 업로드에 실패했습니다. 다시 시도하거나 이 메시지를 삭제하세요.",
+ "authGateHint": "이 컴퓨터에 {{agent}}에 연결된 모델 공급자가 없어 전송이 실패합니다. 컴퓨터의 {{appName}}에서 '설정 → 모델 공급자'를 설정하세요."
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/ko/settings.json b/apps/mobile/src/i18n/locales/ko/settings.json
new file mode 100644
index 0000000000..35a3a23956
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ko/settings.json
@@ -0,0 +1,113 @@
+{
+ "title": "설정",
+ "language": {
+ "title": "언어",
+ "hint": "앱 UI에만 영향을 줍니다. Agent 응답 언어는 Agent 자체 설정에 따릅니다.",
+ "options": {
+ "system": "자동 (시스템 따르기)",
+ "zh-CN": "简体中文",
+ "en": "English",
+ "ja": "日本語",
+ "ko": "한국어"
+ }
+ },
+ "version": {
+ "sectionTitle": "버전",
+ "currentLabel": "현재 버전",
+ "bundleVersion": "앱 패키지 {{version}}",
+ "otaVersion": "OTA 버전 {{version}}",
+ "desktopVersion": "데스크톱 버전 {{version}}",
+ "devNoOta": "개발 빌드에서는 OTA 업데이트를 사용할 수 없습니다",
+ "checkAction": "업데이트 확인",
+ "checking": "확인 중",
+ "updating": "업데이트 중",
+ "checkingAccessibility": "업데이트를 확인하는 중",
+ "bundleUpdateFound": "앱 패키지 업데이트가 있습니다",
+ "upToDate": "이미 최신 버전입니다",
+ "bundleUpToDateNoOta": "앱 패키지는 최신입니다. 현재 버전은 OTA 업데이트를 지원하지 않습니다",
+ "downloadedRestarting": "업데이트를 다운로드했습니다. 다시 시작하는 중",
+ "bundleCheckFailed": "앱 패키지 업데이트를 확인할 수 없습니다. 잠시 후 다시 시도해 주세요.",
+ "checkFailedDetail": "업데이트 확인에 실패했습니다: {{detail}}",
+ "checkFailed": "업데이트 확인에 실패했습니다. 잠시 후 다시 시도해 주세요."
+ },
+ "notifications": {
+ "sectionTitle": "알림",
+ "taskDone": "작업 완료 알림",
+ "taskDoneHint": "컴퓨터의 작업이 완료되거나 실패하거나 회신이 필요할 때 이 휴대폰으로 알림을 보냅니다. 완료·회신 알림에는 최신 응답 내용이 포함됩니다.",
+ "permissionDenied": "시스템 알림 권한이 꺼져 있습니다. iOS 설정 → 알림 → {{appName}}에서 알림을 허용한 뒤 다시 시도해 주세요.",
+ "unregisterQueued": "껐습니다. 현재 네트워크에서는 등록 해제가 완료되지 않았으며, 다음에 온라인이 되면 자동으로 완료됩니다."
+ },
+ "about": {
+ "sectionTitle": "이 휴대폰 정보",
+ "deviceName": "기기 이름",
+ "deviceNameDetail": "컴퓨터의 승인 목록에 이 이름이 표시됩니다.",
+ "platform": "플랫폼",
+ "remoteControl": "원격 제어 권한",
+ "remoteControlValue": "데스크톱에서 관리",
+ "remoteControlDetail": "이 휴대폰은 제어하는 쪽으로만 동작합니다. 피제어 허용·철회·복원은 데스크톱 설정에서 진행합니다.",
+ "editAccessibility": "{{label}} 수정"
+ },
+ "relay": {
+ "online": "Relay 연결됨",
+ "connecting": "Relay 연결 중",
+ "stopped": "Relay 연결 안 됨",
+ "lastSynced": "마지막 동기화 {{time}}",
+ "canSync": "원격 세션을 동기화할 수 있습니다.",
+ "reconnectHint": "네트워크가 복구되면 원격 세션이 자동으로 다시 구독됩니다.",
+ "resumeHint": "앱으로 돌아오거나 다시 로그인하면 연결이 복구됩니다."
+ },
+ "header": {
+ "notSignedIn": "로그인하지 않음",
+ "thisPhone": "현재 휴대폰"
+ },
+ "debug": {
+ "sectionTitle": "디버그 / 개발자",
+ "userId": "사용자 ID",
+ "notSynced": "동기화되지 않음",
+ "deviceId": "기기 ID",
+ "initializing": "초기화 중",
+ "authServer": "Auth Server",
+ "authRegion": "로그인 지역"
+ },
+ "updateInfo": {
+ "embedded": "앱 패키지 포함",
+ "unknown": "알 수 없음",
+ "source": "실행 소스",
+ "sourceEmbedded": "내장 버전 (패키지 포함)",
+ "sourceOta": "OTA 업데이트",
+ "updateId": "업데이트 ID",
+ "updatedAt": "업데이트 시간",
+ "channel": "Channel",
+ "runtime": "Runtime",
+ "otaMarker": "OTA 마커"
+ },
+ "legal": {
+ "sectionTitle": "법적 정보",
+ "privacyPolicy": "개인정보 처리방침",
+ "view": "보기",
+ "openPrivacyPolicy": "개인정보 처리방침 열기",
+ "appFilingNumber": "앱 등록 번호"
+ },
+ "account": {
+ "logoutHint": "로그아웃하면 이 휴대폰의 로그인 상태와 로컬 원격 미러만 삭제됩니다. 컴퓨터의 세션에는 영향이 없습니다.",
+ "logout": "로그아웃",
+ "loggingOut": "로그아웃 중",
+ "loggingOutAccessibility": "로그아웃하는 중"
+ },
+ "copyRow": {
+ "action": "복사",
+ "done": "복사됨",
+ "accessibility": "{{label}} 복사"
+ },
+ "deviceNameEditor": {
+ "screenTitle": "기기 이름",
+ "placeholder": "이 기기 이름",
+ "resetAccessibility": "기본 기기 이름 복원",
+ "emptyError": "기기 이름을 입력해 주세요.",
+ "deviceInitializing": "기기를 초기화하는 중입니다. 잠시 후 다시 시도해 주세요.",
+ "saving": "저장 중…",
+ "saved": "저장했습니다.",
+ "restoringDefault": "기본 이름을 복원하는 중…",
+ "restoredDefault": "기본 이름을 복원했습니다."
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/ko/shared.json b/apps/mobile/src/i18n/locales/ko/shared.json
new file mode 100644
index 0000000000..353f136b0a
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ko/shared.json
@@ -0,0 +1,6 @@
+{
+ "back": "뒤로",
+ "syncing": "동기화 중",
+ "selectOption": "{{label}} 선택",
+ "closePanel": "패널 닫기"
+}
diff --git a/apps/mobile/src/i18n/locales/ko/startup.json b/apps/mobile/src/i18n/locales/ko/startup.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ko/startup.json
@@ -0,0 +1 @@
+{}
diff --git a/apps/mobile/src/i18n/locales/ko/update.json b/apps/mobile/src/i18n/locales/ko/update.json
new file mode 100644
index 0000000000..75ac2e46ed
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/ko/update.json
@@ -0,0 +1,17 @@
+{
+ "installHintTitle": "설치 안내",
+ "installHintBody": "시스템 대화상자에서 '설치'를 누른 뒤 홈 화면으로 돌아가 설치 진행 상황을 확인하세요. 다운로드가 완료되면 현재 버전이 자동으로 교체됩니다.",
+ "openInstallFailedTitle": "설치 링크를 열 수 없습니다",
+ "openInstallFailedBody": "설치 주소를 직접 복사해 Safari에서 여세요.",
+ "bundleAvailableBody": "새 버전이 있습니다. 전체 패키지를 다운로드하고 설치해 업데이트하세요.",
+ "releaseNotes": "\n업데이트 내용:\n{{notes}}",
+ "forcedTitle": "업데이트 필요",
+ "goUpdate": "업데이트",
+ "newVersionTitle": "새 버전 있음",
+ "later": "나중에",
+ "upToDateTitle": "최신 상태입니다",
+ "upToDateBody": "이미 최신 패키지입니다.",
+ "checkFailedTitle": "확인 실패",
+ "checkFailedBody": "업데이트 서버에 연결할 수 없습니다. 나중에 다시 시도하세요.",
+ "latestRequestFailed": "latest 요청 실패: HTTP {{status}}"
+}
diff --git a/apps/mobile/src/i18n/locales/zh-CN/apiErrors.json b/apps/mobile/src/i18n/locales/zh-CN/apiErrors.json
new file mode 100644
index 0000000000..74cb581a40
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/zh-CN/apiErrors.json
@@ -0,0 +1,6 @@
+{
+ "requestTimeout": "请求超时,请稍后重试",
+ "networkUnavailable": "网络连接不可用,请检查网络后重试{{webHint}}",
+ "networkUnavailableWebHint": "。Web 预览可能被浏览器 CORS 拦截,请用 Expo Go/模拟器测试",
+ "requestFailed": "请求失败"
+}
diff --git a/apps/mobile/src/i18n/locales/zh-CN/composer.json b/apps/mobile/src/i18n/locales/zh-CN/composer.json
new file mode 100644
index 0000000000..f4b7b8c67a
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/zh-CN/composer.json
@@ -0,0 +1,103 @@
+{
+ "input": {
+ "resize": {
+ "increaseHeight": "增大输入框高度",
+ "decreaseHeight": "减小输入框高度",
+ "hint": "上下拖动调整输入框高度",
+ "label": "输入框高度调节"
+ }
+ },
+ "attachments": {
+ "viewImage": "查看图片 {{name}}",
+ "removeAttachment": "移除附件 {{name}}",
+ "retryUpload": "重试上传 {{name}}",
+ "retry": "重试",
+ "removeFailed": "移除失败的附件 {{name}}",
+ "cancelUpload": "取消上传 {{name}}",
+ "uploadFailed": "{{name}} · 上传失败",
+ "collapsedBadge": "{{count}} 个附件,点击展开",
+ "imageNotAnnotatable": "这张图片暂不支持标注或转发。",
+ "downloadOriginalFailed": "下载原图失败(HTTP {{status}})。",
+ "annotationSaveFailed": "标注保存失败",
+ "tryAgain": "请重试。",
+ "sendToChat": "发送到对话",
+ "save": "保存",
+ "fileNotFound": "文件不存在",
+ "pathNotReadable": "该路径不允许读取",
+ "readFailed": "读取失败",
+ "notFetchableMedia": "不是可取件的桌面端媒体",
+ "mediaResultInvalid": "远程媒体取件结果无效",
+ "mediaUrlInvalid": "远程媒体下载地址无效",
+ "mediaCacheMiss": "远程媒体缓存未命中(cachedOnly)",
+ "mediaFetchCancelled": "远程媒体取件已取消",
+ "fileMenu": {
+ "openBrowser": "打开文件浏览器",
+ "sendToSession": "发送到会话",
+ "copyPath": "复制路径",
+ "quickPreview": "快速预览",
+ "revealInBrowser": "在文件浏览器中查看",
+ "share": "导出 / 分享",
+ "folder": "文件夹",
+ "file": "文件"
+ }
+ },
+ "upload": {
+ "emptyFile": "这个文件为空,不能作为附件发送。",
+ "fileTooLarge": "文件超过 {{size}} MB,暂不能作为附件发送。",
+ "cancelled": "附件上传已取消。",
+ "incompleteRead": "文件读取不完整:预期 {{expected}} 字节,实际 {{actual}} 字节。",
+ "integrityUnavailable": "当前附件上传体无法进行完整性校验。",
+ "sizeChanged": "附件大小已变化:预期 {{expected}} 字节,实际 {{actual}} 字节。",
+ "invalidSize": "附件大小无效,无法计算完整性摘要。",
+ "invalidBase64": "附件分块不是有效的 base64。",
+ "failedHttp": "附件上传失败: HTTP {{status}}{{code}}",
+ "failedNetwork": "附件上传失败:网络传输异常,请检查网络后重试。({{detail}})",
+ "timeout": "附件上传超时,请检查网络后重试。",
+ "fileTypeUnsupported": "这个本机文件类型暂不支持作为附件发送。",
+ "snapshotFailedNoCacheDir": "无法创建附件快照:缓存目录不可用",
+ "snapshotFailed": "无法创建附件快照",
+ "invalidUploadUrl": "服务端没有返回有效的附件上传地址。",
+ "noImageRead": "没有读取到可上传的图片。",
+ "emptyImage": "这个图片为空,不能作为附件发送。",
+ "imageTooLarge": "图片超过 {{size}} MB,暂不能作为附件发送。",
+ "imageTooLargeSend": "图片超过 {{size}} MB,暂不能发送。",
+ "sessionExpiredImage": "登录已过期,请重新登录后再上传图片。",
+ "sessionExpiredFile": "登录已过期,请重新登录后再上传附件。",
+ "pasteTimeout": "粘贴图片处理超时,请重试。",
+ "clipboardReadFailed": "剪贴板图片读取失败,请重新复制后再粘贴。",
+ "maxAttachments": "最多添加 {{count}} 个附件。",
+ "simulatorNoCamera": "模拟器没有相机,请用「照片」从相册选择。",
+ "cameraPermission": "相机权限未开启,请在系统设置里允许 {{appName}} 使用相机。",
+ "photoPermission": "照片权限未开启,请在系统设置里允许 {{appName}} 访问照片。",
+ "noFileRead": "没有读取到可上传的文件。"
+ },
+ "voice": {
+ "recordingEmpty": "录音为空,不能转写。",
+ "recordingTooLarge": "录音超过上限 {{size}}MB。",
+ "invalidUploadUrl": "服务端没有返回有效的语音上传地址。",
+ "uploadFailed": "语音上传失败: HTTP {{status}} {{statusText}}",
+ "refineFailed": "语音润色失败",
+ "refineResponseTooLarge": "语音润色返回内容超过上限 {{max}} 字符。",
+ "refineStreamFailed": "语音润色流式返回失败。",
+ "refineNoContent": "语音润色没有返回有效内容。",
+ "refineInvalidJson": "语音润色返回了无效 JSON: {{snippet}}",
+ "invalidSession": "语音服务返回了无效会话。",
+ "managedRefineUnsupported": "当前 {{appName}} 语音服务暂不支持托管润色。",
+ "sessionNotConnected": "语音识别会话尚未连接。",
+ "loginRequired": "请先登录 {{appName}} 后再使用语音输入。",
+ "serviceUnavailable": "当前区域未配置 {{appName}} 语音服务。",
+ "realtimeUnsupported": "手机版实时语音暂不支持 {{detail}} ASR。",
+ "realtimeAuthUnsupported": "手机版实时语音暂不支持 {{auth}} ASR 鉴权。",
+ "realtimeProtocolUnsupported": "手机版实时语音暂不支持 {{detail}} ASR 协议。",
+ "missingConnectionProvider": "手机语音输入需要 {{appName}} 语音会话票据(缺少 connectionProvider)。",
+ "realtimeAsrFailed": "实时语音识别失败。",
+ "volcengineAuthUnsupported": "手机版 Volcengine 语音暂不支持 {{auth}} 鉴权。",
+ "volcengineMissingResourceId": "Volcengine ASR 配置缺少 resourceId。",
+ "sessionExpiredOrForbidden": "{{appName}} 语音会话已失效或没有权限(WebSocket {{status}})。请确认登录状态后重试。",
+ "incomplete": "语音输入未完成,请重试。",
+ "missingRefinerTargetProvider": "手机版语音润色需要 {{appName}} 语音会话(缺少 refinerTargetProvider)。",
+ "emptyTranscript": "检测到语音但未识别出文本,请重试。",
+ "micPermission": "麦克风权限未开启,请在系统设置里允许 {{appName}} 使用麦克风。",
+ "realtimeAudioUnavailable": "当前安装包不支持实时语音输入,请安装包含原生录音模块的测试版。"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/zh-CN/deviceLink.json b/apps/mobile/src/i18n/locales/zh-CN/deviceLink.json
new file mode 100644
index 0000000000..20322db79d
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/zh-CN/deviceLink.json
@@ -0,0 +1,18 @@
+{
+ "syncFailed": "同步失败",
+ "resync": "重新同步",
+ "resyncing": "正在重新同步",
+ "syncShort": "同步",
+ "connectStep1": "在电脑上安装并打开 {{appName}}",
+ "connectStep2": "用与手机相同的账号登录",
+ "connectStep3": "在「设置 → 远程连接」中开启「允许同账号设备控制本机」",
+ "brandEyebrow": "CINDY 手机版",
+ "cloudTeaserTitle": "云端 {{appName}} 筹备中",
+ "cloudTeaserCopy": "上线后无需电脑,手机版即可直接使用。",
+ "sectionFirstRun": "开始使用",
+ "sectionOffline": "连接过的电脑",
+ "sectionRemoteDisabled": "在电脑上操作",
+ "sectionAccessRevoked": "需要重新允许",
+ "retryAccess": "重试访问",
+ "recheck": "重新检查"
+}
diff --git a/apps/mobile/src/i18n/locales/zh-CN/devices.json b/apps/mobile/src/i18n/locales/zh-CN/devices.json
new file mode 100644
index 0000000000..1fa286d9eb
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/zh-CN/devices.json
@@ -0,0 +1,328 @@
+{
+ "common": {
+ "cancel": "取消",
+ "save": "保存",
+ "saving": "保存中",
+ "delete": "删除",
+ "deleting": "删除中",
+ "create": "新建"
+ },
+ "list": {
+ "thisComputer": "这台电脑",
+ "allConversations": "所有对话",
+ "syncFailed": "同步失败",
+ "requestFailed": "请求失败",
+ "loading": "正在读取可控制电脑",
+ "untitled": "未命名对话",
+ "connection": {
+ "connecting": "连接中",
+ "disconnected": "连接断开"
+ },
+ "error": {
+ "sessionDeviceNotFound": "找不到这个会话所属电脑,请重新同步后再试。",
+ "taskDeviceNotFound": "找不到这个任务所属电脑,请重新同步后再试。",
+ "noDevice": "没有可用电脑。请先打开桌面端远程控制,然后重新同步。"
+ },
+ "alert": {
+ "actionFailed": "操作失败",
+ "renameFailed": "重命名失败",
+ "deleteTitle": "删除对话?",
+ "deleteMessage": "将删除「{{title}}」,删除后不可恢复。"
+ },
+ "a11y": {
+ "selectScope": "选择对话范围",
+ "openSettings": "打开设置",
+ "syncing": "正在重新同步",
+ "sync": "重新同步",
+ "pinnedConversations": "置顶 {{count}} 条对话",
+ "newRemoteConversation": "新建远程对话",
+ "renameDevice": "重命名 {{label}}",
+ "project": "项目 {{title}}",
+ "openAutomationLatest": "打开自动化任务 {{title}} 的最新会话",
+ "automationTask": "自动化任务 {{title}}",
+ "openConversation": "打开会话 {{title}}",
+ "collapse": "收起 {{title}}",
+ "expand": "展开 {{title}}",
+ "taskError": "任务出错",
+ "awaitingYou": "等待你处理",
+ "doneUnread": "已完成未读",
+ "running": "运行中",
+ "close": "关闭",
+ "cancelRename": "取消重命名"
+ },
+ "menu": {
+ "groupByProject": "按项目分组"
+ },
+ "renameDevice": {
+ "title": "重命名设备",
+ "placeholder": "设备名称",
+ "savingA11y": "正在保存设备名",
+ "saveA11y": "保存设备名"
+ },
+ "renameSession": {
+ "title": "重命名对话",
+ "placeholder": "对话标题",
+ "savingA11y": "正在保存对话标题",
+ "saveA11y": "保存对话标题"
+ },
+ "revoked": {
+ "title": "已撤销访问权限",
+ "body": "「{{deviceName}}」撤销了本机的远程访问权限。请在该电脑的 {{appName}} 设置里重新授权本设备,然后点「重试访问」。",
+ "retry": "重试访问"
+ },
+ "viewAllConversations": "查看全部 {{count}} 条对话",
+ "viewAllRuns": "查看全部 {{count}} 次运行",
+ "preview": {
+ "needAttention": "{{count}} 个需关注",
+ "waiting": "等待处理 {{count}} 个",
+ "automationRunning": "自动化执行中",
+ "totalRuns": "共 {{count}} 次运行"
+ }
+ },
+ "detail": {
+ "filter": {
+ "active": "活跃",
+ "waiting": "待处理",
+ "automation": "自动化",
+ "archived": "归档",
+ "all": "全部",
+ "a11y": "筛选{{label}}会话"
+ },
+ "group": {
+ "project": "项目",
+ "date": "时间",
+ "label": "分组",
+ "a11y": "按{{label}}分组"
+ },
+ "metric": {
+ "active": "活动",
+ "waiting": "待处理",
+ "automation": "自动化",
+ "activeA11y": "筛选活动会话",
+ "waitingA11y": "筛选待处理会话",
+ "automationA11y": "筛选自动化会话"
+ },
+ "plan": "计划",
+ "automationsButtonA11y": "打开远程自动化",
+ "search": {
+ "openA11y": "搜索远程会话",
+ "closeA11y": "关闭搜索远程会话",
+ "label": "搜索",
+ "placeholder": "搜索标题、项目、模型、消息",
+ "clearA11y": "清除搜索",
+ "closeInputA11y": "关闭搜索",
+ "clear": "清除",
+ "close": "关闭"
+ },
+ "filters": {
+ "collapseA11y": "收起会话筛选",
+ "expandA11y": "展开会话筛选",
+ "label": "筛选"
+ },
+ "selection": {
+ "count": "已选择 {{count}} 个会话",
+ "canAct": "可执行操作",
+ "cannotAct": "没有可执行操作",
+ "clearA11y": "取消选择会话"
+ },
+ "bulk": {
+ "pinning": "置顶中",
+ "unpinning": "取消中",
+ "archiving": "归档中",
+ "restoring": "恢复中",
+ "deleting": "删除中",
+ "pinA11y": "批量置顶选中会话",
+ "unpinA11y": "批量取消置顶选中会话",
+ "archiveA11y": "批量归档选中会话",
+ "restoreA11y": "批量恢复选中会话",
+ "deleteA11y": "批量删除选中会话",
+ "cancelA11y": "取消批量操作",
+ "partialFailure": "已处理 {{done}} 个,{{failed}} 个失败(已还原,可重试)。",
+ "noArchivable": "当前选择里没有可归档的活跃会话。",
+ "noPinnable": "当前选择里没有可置顶的活跃会话。",
+ "noRestorable": "当前选择里没有可恢复的归档会话。",
+ "noUnpinnable": "当前选择里没有已置顶的会话。",
+ "noDeletable": "当前选择里没有可删除的会话。",
+ "noneModifiable": "当前选择的会话都不能修改。"
+ },
+ "automationScope": {
+ "eyebrow": "自动化任务",
+ "title": "自动化任务",
+ "emptyCopy": "任务运行后,每次运行的会话都会出现在这里。",
+ "emptyTitle": "这个任务还没有运行记录"
+ },
+ "projectScope": {
+ "eyebrow": "项目",
+ "emptyCopy": "在这个项目里开始一个新对话。",
+ "emptyTitle": "这个项目还没有对话"
+ },
+ "subtitle": {
+ "deviceActive": "{{deviceName}} · {{count}} 个活动会话",
+ "activeAndProjects": "{{count}} 个活动会话 · {{projects}} 个项目"
+ },
+ "row": {
+ "a11yAutomationGroup": "自动化会话组 {{title}}",
+ "a11ySession": "会话 {{title}}",
+ "a11yCollapse": "收起 {{title}}",
+ "a11yExpand": "展开 {{title}}",
+ "collapse": "收起",
+ "expand": "展开"
+ },
+ "badge": {
+ "waiting": "待处理 {{count}}",
+ "automationPrefix": "自动化",
+ "sessionCount": "{{count}} 个会话",
+ "aggregate": "聚合",
+ "running": "执行中",
+ "unread": "未读 {{count}}"
+ },
+ "child": {
+ "openA11y": "打开自动化会话 {{title}}"
+ },
+ "viewAllRuns": "查看全部 {{count}} 次运行"
+ },
+ "automations": {
+ "error": {
+ "projectMissingConfig": "项目自动化缺少 projectConfigId,请在桌面端删除",
+ "deletePartial": "自动化已删除,但 {{count}} 个生成会话未能更新状态。请在桌面端检查这些会话。"
+ },
+ "subtitle": "{{active}} 个运行中 · {{total}} 个任务",
+ "metric": {
+ "running": "运行中",
+ "unreadResults": "未读结果",
+ "executing": "执行中"
+ },
+ "summary": {
+ "paused": "{{count}} 个任务已暂停。选择任务后可以运行、暂停、编辑或打开最近会话。",
+ "default": "选择任务后可以运行、暂停、编辑或打开最近会话。"
+ },
+ "empty": {
+ "copy": "可以直接从手机创建第一条自动化任务,或在桌面端创建后同步到这里。",
+ "title": "这台电脑暂无自动化"
+ },
+ "createAutomation": "新建自动化",
+ "recentRuns": "最近执行",
+ "runs": {
+ "emptyCopy": "点击 Run now 后会在这里看到新 run。",
+ "emptyTitle": "还没有执行记录"
+ },
+ "form": {
+ "title": {
+ "create": "新建自动化",
+ "edit": "编辑自动化"
+ },
+ "sessionMode": {
+ "bound": "绑定已有会话后,目录、worktree、Agent 和 Fast 模式跟随该会话。",
+ "persistent": "首次触发会创建持续会话,后续触发继续接在同一会话里。",
+ "fresh": "每次触发都会创建新的会话。"
+ },
+ "field": {
+ "name": "名称",
+ "prompt": "提示词",
+ "trigger": "触发方式",
+ "runSession": "运行会话",
+ "boundSession": "绑定会话",
+ "intervalMinutes": "间隔分钟",
+ "workspace": "工作区",
+ "projectDir": "项目目录",
+ "model": "模型",
+ "effort": "推理强度",
+ "timezone": "时区"
+ },
+ "namePlaceholder": "例如:每日项目巡检",
+ "scriptHint": "这是一个仅运行脚本任务,脚本配置只能在桌面端编辑;此处可以改动名称、触发方式、通知等其它字段。",
+ "promptPlaceholder": "写清楚每次自动执行要让 {{appName}} 做什么",
+ "trigger": {
+ "recurring": "周期",
+ "manual": "手动"
+ },
+ "session": {
+ "fresh": "新会话",
+ "persistent": "持续",
+ "bound": "绑定"
+ },
+ "boundSessionA11y": "绑定会话 {{name}}",
+ "intervalPlaceholder": "留空则使用 cron",
+ "workspace": {
+ "project": "项目",
+ "dialogue": "对话"
+ },
+ "useWorktree": "使用 worktree",
+ "modelPlaceholderBound": "跟随会话",
+ "fastMode": "Fast 模式",
+ "notifyDesktop": "桌面通知",
+ "notifyFeishu": "飞书通知",
+ "savingA11y": "正在保存自动化",
+ "saveA11y": "保存自动化",
+ "cancelA11y": "取消编辑自动化"
+ },
+ "delete": {
+ "counting": "正在统计由这条自动化生成的会话...",
+ "confirmDeleteBoth": "删除任务和会话",
+ "confirmArchive": "删除任务并归档会话",
+ "confirmTaskOnly": "只删除任务",
+ "title": "删除 {{name}}",
+ "copy": "删除自动化任务不会中断已经开始的执行。生成过的会话按下面的选项处理,和桌面端保持一致。",
+ "optionsA11y": "选择生成会话处理方式",
+ "keepDesc": "只删除这条自动化任务,历史会话继续保留在原列表里。",
+ "keepLabel": "保留生成会话",
+ "archiveDesc": "删除任务后,把由它生成的会话移到归档,后续仍可搜索。",
+ "archiveLabel": "归档生成会话",
+ "deleteDesc": "删除任务后,把由它生成的会话也标记为删除。这个操作不可从手机端撤销。",
+ "deleteLabel": "删除生成会话",
+ "cancelA11y": "取消删除自动化",
+ "confirmA11y": "确认删除自动化"
+ },
+ "pause": {
+ "title": "暂停 {{name}}",
+ "detailFallback": "暂停会阻止这条自动化继续触发。",
+ "previewFallback": "没有正在执行的 run",
+ "confirmA11y": "确认暂停自动化",
+ "pausing": "暂停中",
+ "confirm": "确认暂停",
+ "cancelA11y": "取消暂停自动化"
+ },
+ "runDelete": {
+ "title": "删除这条执行记录",
+ "copy": "只会删除这条自动化执行记录,不会删除它打开过的会话,也不会影响后续自动触发。",
+ "confirmA11y": "确认删除执行记录",
+ "confirm": "删除记录",
+ "cancelA11y": "取消删除执行记录"
+ },
+ "template": {
+ "label": "模板",
+ "loadingA11y": "模板加载中",
+ "refreshA11y": "刷新自动化模板",
+ "loading": "加载中",
+ "refresh": "刷新",
+ "cardA11y": "自动化模板 {{name}}",
+ "manualConfig": "手动配置"
+ },
+ "scheduleRowA11y": "自动化任务 {{title}}",
+ "detail": {
+ "promptScriptFallback": "仅运行脚本任务,配置只能在桌面端编辑",
+ "promptEmpty": "没有保存任务提示词",
+ "deleteA11y": "删除自动化",
+ "runNowA11y": "立即执行自动化",
+ "running": "执行中",
+ "resumeA11y": "恢复自动化",
+ "pauseA11y": "暂停自动化",
+ "resume": "恢复",
+ "pause": "暂停",
+ "editA11y": "编辑自动化",
+ "edit": "编辑"
+ },
+ "run": {
+ "openSessionA11y": "打开自动化会话",
+ "opening": "打开中",
+ "session": "会话",
+ "restartA11y": "重新执行自动化",
+ "restarting": "重跑中",
+ "restart": "重跑",
+ "markReadA11y": "标记执行记录已读",
+ "marking": "标记中",
+ "markRead": "已读",
+ "deleteA11y": "删除执行记录"
+ }
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/zh-CN/files.json b/apps/mobile/src/i18n/locales/zh-CN/files.json
new file mode 100644
index 0000000000..8886cac1fb
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/zh-CN/files.json
@@ -0,0 +1,90 @@
+{
+ "browser": {
+ "titleFallback": "远程文件",
+ "workdirSuffix": " · 工作目录",
+ "footerOnline": "已连接 · 实时同步",
+ "footerConnecting": "连接中…",
+ "folderEmpty": "文件夹为空。",
+ "noWorkdir": "该会话没有工作目录,无法浏览文件。",
+ "rootDir": "(根目录)",
+ "copyPath": "复制路径",
+ "sendToSession": "发送到会话",
+ "exportShare": "导出 / 分享",
+ "preview": "快速预览",
+ "copiedPath": "已复制路径",
+ "shareFailed": "分享失败,请重试",
+ "exporting": "正在从电脑导出…",
+ "downloadFailed": "下载失败",
+ "searchPlaceholder": "搜索",
+ "cancel": "取消",
+ "searchModeName": "文件名",
+ "searchModeContent": "内容",
+ "searchModeA11y": "按{{mode}}搜索",
+ "searchScope": "在 {{workdir}} 内",
+ "searching": " · 搜索中…",
+ "searchingContent": "正在搜索文件内容…",
+ "noContentMatch": "没有匹配的内容。",
+ "contentSearchMinChars": "输入至少 2 个字符搜索文件内容。",
+ "contentSummary": "{{matches}} 处匹配 · {{files}} 个文件",
+ "contentSummaryTruncated": " · 已达上限截断",
+ "indexing": "正在建立文件索引…",
+ "noNameMatch": "没有匹配的文件名。",
+ "nameSearchPrompt": "输入关键字按文件名搜索。",
+ "nameResultSummary": "{{n}} 个结果 · 按名称匹配",
+ "viewGrid": "网格视图",
+ "viewList": "列表视图",
+ "sortName": "按名称排序",
+ "sortMtime": "按修改时间排序",
+ "sortSize": "按大小排序",
+ "a11yTitleMenu": "路径与视图菜单",
+ "a11ySearch": "搜索文件名",
+ "a11yMore": "更多",
+ "a11yOpenFolder": "打开文件夹 {{name}}",
+ "a11yPreviewFile": "预览文件 {{name}}",
+ "a11yClear": "清空",
+ "a11yCancelSearch": "取消搜索",
+ "a11yPreviewName": "预览 {{name}}",
+ "a11yPreviewNameLine": "预览 {{name}} 第 {{line}} 行"
+ },
+ "preview": {
+ "done": "完成",
+ "a11yShare": "导出分享",
+ "copyPath": "复制路径",
+ "sendToSession": "发送到会话",
+ "copiedPath": "已复制路径",
+ "exporting": "正在从电脑导出…",
+ "downloadFailed": "下载失败",
+ "fetchingVideo": "正在从电脑取回视频…",
+ "fetchingAudio": "正在从电脑取回音频…",
+ "fetchAvFailed": "取回失败:{{detail}}",
+ "fetchPdfFailed": "取回 PDF 失败:{{detail}}",
+ "fetchingPdf": "正在从电脑取回 PDF…",
+ "unsupportedType": "此类型暂不支持在手机上预览",
+ "oversize": "文件超过预览上限({{size}}),可下载原文件查看",
+ "oversizeUnknown": "过大",
+ "binaryFile": "二进制文件,无法以文本预览",
+ "readFailed": "读取失败",
+ "truncated2mb": "文件超过 2 MB,仅显示前 2 MB 内容",
+ "truncatedLines": "仅显示前 {{lines}} 行",
+ "mdRendered": "渲染",
+ "mdSource": "源码",
+ "mdViewA11y": "{{view}}视图",
+ "a11yViewImage": "查看大图 {{name}}",
+ "fetchOriginalFailed": "取回原图失败:{{detail}}",
+ "a11yRetryOriginal": "重试取回原图",
+ "retry": "重试",
+ "fetchingOriginal": "正在从电脑取回原图…",
+ "originalFailedThumb": "原图取回失败,当前为缩略图",
+ "fetchingOriginalHint": "缩略图 · 正在取回原图…",
+ "a11yExportShareFile": "导出分享原文件",
+ "exportShare": "导出 / 分享"
+ },
+ "export": {
+ "exportFailed": "导出失败",
+ "leftPage": "已离开页面,导出中止",
+ "exportTimeout": "导出超时,请重试"
+ },
+ "gallery": {
+ "cacheMiss": "远程媒体缓存未命中(cachedOnly)"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/zh-CN/home.json b/apps/mobile/src/i18n/locales/zh-CN/home.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/zh-CN/home.json
@@ -0,0 +1 @@
+{}
diff --git a/apps/mobile/src/i18n/locales/zh-CN/index.ts b/apps/mobile/src/i18n/locales/zh-CN/index.ts
new file mode 100644
index 0000000000..82fba68991
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/zh-CN/index.ts
@@ -0,0 +1,38 @@
+/**
+ * 本 locale 的 catalog 组装:每个区域一个 JSON 文件、一个顶级 key,
+ * 组装成单一 'common' namespace 的资源对象。
+ * 区域清单四语必须一致(与其余 locale 的 index.ts 逐行同构);新增区域时
+ * 四个 locales/<locale>/index.ts 一起加,平价测试会拦截漏改。
+ */
+
+import apiErrors from './apiErrors.json';
+import composer from './composer.json';
+import deviceLink from './deviceLink.json';
+import devices from './devices.json';
+import files from './files.json';
+import home from './home.json';
+import interaction from './interaction.json';
+import message from './message.json';
+import models from './models.json';
+import session from './session.json';
+import settings from './settings.json';
+import shared from './shared.json';
+import startup from './startup.json';
+import update from './update.json';
+
+export default {
+ apiErrors,
+ composer,
+ deviceLink,
+ devices,
+ files,
+ home,
+ interaction,
+ message,
+ models,
+ session,
+ settings,
+ shared,
+ startup,
+ update,
+} as const;
diff --git a/apps/mobile/src/i18n/locales/zh-CN/interaction.json b/apps/mobile/src/i18n/locales/zh-CN/interaction.json
new file mode 100644
index 0000000000..cc5e03c19e
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/zh-CN/interaction.json
@@ -0,0 +1,149 @@
+{
+ "permission": {
+ "mode": {
+ "default": "默认权限",
+ "acceptEdits": "允许编辑",
+ "plan": "计划模式",
+ "auto": "自动审批",
+ "bypass": "完全访问"
+ },
+ "pickerSelect": "选择权限模式 {{mode}}",
+ "armedRiskWarning": "确认允许后才会把决定回传到电脑端。",
+ "armedHighRiskTitle": "确认高风险操作",
+ "kind": "权限确认",
+ "deny": "拒绝",
+ "denyAccessibility": "拒绝权限请求",
+ "alwaysAllow": "本会话总是允许",
+ "alwaysAllowAccessibility": "本会话总是允许权限请求",
+ "alwaysAllowConfirm": "确认本会话允许",
+ "allowOnce": "允许一次",
+ "allowOnceAccessibility": "允许一次权限请求",
+ "allowOnceConfirm": "确认允许一次",
+ "highRisk": "高风险"
+ },
+ "planMode": {
+ "label": "计划模式",
+ "exit": "退出计划模式"
+ },
+ "panel": {
+ "readOnlyKind": "待确认",
+ "readOnlyTitle": "电脑端正在等待确认",
+ "pendingRequests": "待处理请求",
+ "queueSwitchTo": "切换到{{position}}待处理请求: {{label}}",
+ "queueSwitchGeneric": "切换待处理请求",
+ "missingRequestId": "这个远程交互缺少 requestId,无法回传决定。",
+ "issueConfirmUnsupported": "Issue 提交确认只在电脑端处理。请回到桌面端确认或取消提交。",
+ "unsupportedType": "手机版暂不支持这个远程交互类型。",
+ "unsupportedKind": "暂不支持",
+ "awaitingAnswer": "等待回答",
+ "continueAccessibility": "继续远程提问",
+ "continue": "继续",
+ "askOptionCount": "{{count}} 个选项",
+ "askFreeInput": "自由输入",
+ "askModeMulti": "多选",
+ "askModeSingle": "单选",
+ "askMetaCaption": "{{options}} · {{mode}} · 支持其他回答",
+ "expandQuestionCard": "展开问题卡片",
+ "collapseQuestionCard": "收起问题卡片",
+ "selectAnswer": "选择回答 {{label}}",
+ "submittingHint": "正在把决定回传到电脑端,请不要重复提交。",
+ "customAnswerInputAccessibility": "输入自定义回答",
+ "customAnswerPlaceholder": "输入其他回答",
+ "customAnswerButtonText": "输入其他回答...",
+ "answerInput": "输入回答",
+ "previous": "上一步",
+ "skipAccessibility": "跳过问题",
+ "skip": "跳过",
+ "submitAnswerAccessibility": "提交回答",
+ "next": "下一步",
+ "answerRequired": "选择或输入回答后才能继续。",
+ "submit": "提交",
+ "planReviewTitle": "审阅 Claude 的计划",
+ "planExpand": "展开计划",
+ "planEditHint": "使用编辑模式调整计划",
+ "planBrowseHint": "选中章节即可跳转浏览",
+ "planEditToggle": "编辑计划",
+ "planEditExit": "退出计划编辑",
+ "planCollapse": "收起计划",
+ "planExpandArea": "展开计划浏览区",
+ "planHalf": "切换到半屏计划",
+ "planEditorAccessibility": "计划编辑器",
+ "planEditorPlaceholder": "编辑计划",
+ "planOutline": "目录",
+ "planJumpTo": "跳到计划章节 {{title}}",
+ "planEmpty": "计划内容为空。",
+ "planApproveAccessibility": "批准执行计划",
+ "planApprove": "批准 Claude 的计划并开始编码",
+ "planFeedbackLabel": "计划反馈",
+ "planFeedbackPlaceholder": "告诉 Claude 应该怎么做",
+ "planFeedbackRequired": "输入反馈后才能提交。",
+ "planFeedbackSubmit": "提交计划反馈",
+ "planFeedbackAccessibility": "反馈修改计划"
+ },
+ "rewind": {
+ "readError": "无法读取回退预览结果,请重新同步后再试。",
+ "noFilesNote": "没有可回滚的文件,将只截断这条消息之后的对话历史。",
+ "moreFiles": "另有 {{count}} 个文件",
+ "stats": "{{count}} 个文件 · +{{insertions}} / -{{deletions}} 行",
+ "gotIt": "知道了",
+ "cancel": "取消",
+ "cancelAccessibility": "取消回退",
+ "confirm": "确认回退",
+ "confirming": "回退中",
+ "titleLoading": "正在检查回退影响",
+ "titleDefault": "确认回退到这条消息?",
+ "titleEmpty": "只回退对话历史",
+ "titleError": "无法回退",
+ "detailLoading": "手机端正在向电脑端读取文件回退预览。",
+ "detailDefault": "会回滚下面这些文件,并截断这条消息之后的对话历史。",
+ "detailEmpty": "没有文件需要回滚,确认后只会截断这条消息之后的对话历史。",
+ "detailError": "电脑端拒绝了这次回退操作。"
+ },
+ "collab": {
+ "dispatchSummaryItem": "{{label}}:{{task}}",
+ "batchTitle": "批量派活给 {{count}} 个 worker",
+ "batchTitleGeneric": "批量派活给多个 worker",
+ "batchBodyFallback": "批量创建 worker",
+ "dispatchTitle": "派活给 worker {{who}}",
+ "dispatchRole": "角色 {{meta}}",
+ "dispatchBodyFallback": "创建 worker",
+ "sendTitle": "发消息给 worker",
+ "sendBodyFallback": "发送消息",
+ "reportTitle": "worker 回报",
+ "reportBodyFallback": "(空回报)"
+ },
+ "contextSheet": {
+ "backAccessibility": "返回上下文面板",
+ "goalStatus": {
+ "active": "进行中",
+ "paused": "已暂停",
+ "blocked": "待处理",
+ "complete": "已完成",
+ "budgetLimited": "已达上限",
+ "usageLimited": "用量受限"
+ },
+ "goalLabel": "目标",
+ "goalObjectiveAccessibility": "目标内容",
+ "goalPlaceholder": "想要达成什么?agent 会围绕这个目标自动续跑,直到完成或达到限制。",
+ "advancedSettings": "高级设置",
+ "limitsHint": "未改动时跟随被控端的默认限制;达到任一上限时目标自动停止,可随时手动终止;「不限」表示不设该上限。",
+ "maxTurns": "最大轮数",
+ "tokenBudget": "Token 预算",
+ "noProgressLimit": "无进展上限",
+ "startGoal": "开始目标",
+ "goalMeta": "{{turns}} 轮 · {{tokens}} token",
+ "pause": "暂停",
+ "resume": "继续",
+ "clearGoal": "终止目标",
+ "unlimited": "不限",
+ "noScreenshots": "没有找到截图。",
+ "mediaRemove": "移除照片附件 {{name}}",
+ "mediaDeselect": "取消选择照片 {{name}}",
+ "mediaSelect": "选择照片 {{name}}",
+ "photoPermissionHint": "照片权限未开启,开启后可快速添加最近照片。",
+ "enablePhotoPermission": "开启照片权限",
+ "enable": "去开启",
+ "icloudTimeout": "照片还在从 iCloud 下载,等待超时了。请检查网络,稍后重试。",
+ "photoNotReadable": "这张照片暂时无法读取(可能还没从 iCloud 下载完成),请稍后重试。"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/zh-CN/message.json b/apps/mobile/src/i18n/locales/zh-CN/message.json
new file mode 100644
index 0000000000..4b511d24a7
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/zh-CN/message.json
@@ -0,0 +1,191 @@
+{
+ "renderer": {
+ "previousQuestionJump": "跳到上一条提问:{{preview}}",
+ "noPreview": "无预览",
+ "newMessagesToBottom": "有新消息,跳到底部",
+ "jumpToBottom": "跳到底部",
+ "openForkOrigin": "打开分叉来源消息",
+ "viewForkOrigin": "查看分叉来源",
+ "emptyMessages": "暂无消息",
+ "syncing": "正在同步",
+ "copyLinkHint": "点按复制消息链接",
+ "sentTime": "发送时间 {{time}}",
+ "linkCopied": "链接已复制",
+ "turnCostEstimate": "本轮{{cost}}",
+ "turnCost": "本轮消耗 {{cost}}",
+ "messageGenerating": "消息正在生成",
+ "generating": "生成中",
+ "collapseMessage": "收起消息",
+ "expandMessage": "展开消息",
+ "collapse": "收起",
+ "expand": "展开",
+ "automationOriginNamed": "由自动化任务「{{name}}」发送",
+ "automationOrigin": "由自动化任务发送",
+ "modelMismatch": "本轮由 {{actual}} 响应,而非所选的 {{selected}}(服务端临时降级)",
+ "copyStateCopying": "复制中",
+ "copyStateCopied": "已复制",
+ "copyStateFailed": "复制失败",
+ "copyStateCopy": "复制",
+ "thinkingHidden": "思考内容已隐藏",
+ "thinkingDone": "思考 {{duration}}",
+ "thinkingActive": "思考中 {{elapsed}}",
+ "thinkingProcess": "思考过程",
+ "thinkingEmpty": "模型没有返回可展示的思考内容。",
+ "thinkingNoContent": "暂无思考内容",
+ "collapseRow": "收起{{label}}",
+ "expandRow": "展开{{label}}",
+ "statusRunning": "运行中",
+ "statusCompleted": "已完成",
+ "statusFailed": "失败",
+ "statusStopped": "已停止",
+ "toolUseCount": "{{n}} 次工具调用",
+ "subagentTaskTitle": "子 Agent 任务",
+ "recentTool": "最近工具:{{name}}",
+ "outputFile": "输出:{{file}}",
+ "noMoreDetail": "暂无更多详情",
+ "filesRead": "读取 {{n}} 个文件",
+ "searchCount": "搜索 {{n}} 次",
+ "listCount": "列出 {{n}} 次",
+ "collapseThinking": "收起思考内容",
+ "expandThinking": "展开思考内容",
+ "subagentTyped": "子 agent · {{type}}",
+ "subagent": "子 agent",
+ "workedDuration": "已工作 {{duration}}",
+ "subagentSummary": "子 agent 小结",
+ "agentSwitchLabel": "已从 {{from}} 切换到 {{to}}",
+ "agentSwitchViewHandoff": "{{label}},查看交接内容",
+ "sessionResumedPill": "已续接原会话",
+ "handoffContentDesc": "交接内容——切换时发送给新引擎的上下文摘要(不会出现在你的消息里)",
+ "openDiagramDetail": "打开图表详情",
+ "sessionChipFallback": "会话 {{id}}",
+ "imageFallbackTitle": "图片",
+ "mermaidExportFailedTitle": "导出失败",
+ "mermaidRenderIncompleteBody": "图表尚未渲染完成或导出出错,请稍后重试。",
+ "mermaidDiagramTitle": "Mermaid 图表",
+ "mermaidAnnotateFailedTitle": "标注失败",
+ "annotateSendToChat": "标注并发送到对话",
+ "exportDiagramImage": "导出图表为图片",
+ "closeDetail": "关闭详情",
+ "copyDetailContent": "复制详情内容",
+ "openDetailLink": "打开详情链接",
+ "mediaNotPreviewable": "当前媒体暂不能直接预览。",
+ "retryRemoteMediaFetch": "重试远程媒体取件",
+ "retryFetch": "重试取件",
+ "openMedia": "打开媒体",
+ "readCurrentRemoteFile": "读取当前远程文件",
+ "reading": "读取中",
+ "retryFilePreview": "重试文件预览",
+ "readCurrentFile": "读取当前文件",
+ "currentFilePreview": "当前文件预览",
+ "diffNoOldContent": "没有旧内容",
+ "diffOldTitle": "旧内容",
+ "diffNoNewContent": "没有新增内容",
+ "diffNewTitle": "新内容",
+ "fileKind": "文件",
+ "loadRemoteTextPreview": "加载远程文本预览",
+ "loading": "加载中",
+ "retryPreview": "重试预览",
+ "loadPreview": "加载预览",
+ "copyRemoteFilePath": "复制远程文件路径",
+ "copyPath": "复制路径",
+ "copiedPath": "已复制路径",
+ "copyPathFailed": "复制路径失败",
+ "remoteMediaIdle": "正在准备远程媒体取件",
+ "remoteMediaLoading": "正在从远程电脑取件",
+ "remoteMediaReady": "已取回远程媒体",
+ "remoteMediaFetchFailed": "取件失败:{{message}}",
+ "mediaPending": "{{label}} 待播放",
+ "mediaLoaded": "{{label}} 已加载{{progress}}",
+ "mediaPlaying": "{{label}} 播放中{{progress}}",
+ "mediaPaused": "{{label}} 已暂停{{progress}}",
+ "mediaBuffering": "{{label}} 缓冲中{{progress}}",
+ "mediaEnded": "{{label}} 已结束{{progress}}",
+ "mediaError": "{{label}} 播放出错{{error}}",
+ "mediaSourceUrl": "原始地址: {{url}}",
+ "mediaDownloadUrl": "下载地址: {{url}}",
+ "mediaSize": "大小: {{size}}",
+ "mediaExpiresAt": "过期时间: {{time}}",
+ "mediaErrorLine": "错误: {{message}}",
+ "mediaDeviceLinkHint": "移动端会通过 device-link 请求远程电脑上传媒体后再打开。",
+ "controlDelete": "删除消息",
+ "controlRewind": "回退到这里",
+ "controlFork": "分叉对话",
+ "markdownDocAriaLabel": "消息正文",
+ "toolOutputTitle": "{{label}} 输出",
+ "mermaidEmpty": "空 Mermaid 图表。",
+ "diffEditCount": "{{n}} 处编辑"
+ },
+ "actions": {
+ "attachmentsPrefix": "附件:{{names}}",
+ "justNow": "刚刚",
+ "minutesAgo": "{{n}} 分钟前",
+ "hoursAgo": "{{n}} 小时前",
+ "turnCostValue": "价值 {{value}}"
+ },
+ "lightbox": {
+ "cancelAnnotation": "取消标注",
+ "cancel": "取消",
+ "undoLastStroke": "撤销上一笔",
+ "undo": "撤销",
+ "done": "完成",
+ "shareImage": "分享图片",
+ "annotateImage": "标注图片",
+ "annotate": "标注",
+ "exportShare": "导出 / 分享",
+ "sendToChat": "发送到对话",
+ "loadFailed": "图片加载失败",
+ "retryLoadImage": "重试加载图片",
+ "retry": "重试",
+ "closeImage": "关闭图片"
+ },
+ "queue": {
+ "continueSystemInstruction": "继续未完成的任务(系统指令)",
+ "systemInstruction": "系统指令",
+ "retrySend": "重试发送",
+ "clearError": "清除错误",
+ "credentialSwitchWait": "正在等待其它 Codex 任务结束,结束后自动发送",
+ "aborting": "正在停止,排队消息会保留在这里",
+ "paused": "队列已暂停,排队消息不会自动发送",
+ "resumeSendQueue": "继续发送队列",
+ "resume": "继续",
+ "attachmentCount": "{{n}} 个附件",
+ "attachmentMessage": "附件消息",
+ "steeringLabel": "插话发送中:{{text}}",
+ "queuedMessageLabel": "排队消息 {{index}}:{{text}}",
+ "editingInComposer": "正在下方输入框编辑…",
+ "cancel": "取消",
+ "edit": "编辑",
+ "steer": "插话",
+ "collapseQueued": "收起排队消息",
+ "expandRemainingQueued": "展开剩余 {{n}} 条排队消息",
+ "collapse": "收起",
+ "expandRemaining": "展开剩余 {{n}} 条",
+ "sendFailedMessage": "发送失败的消息:{{text}}",
+ "sendingMessage": "发送中的消息:{{text}}",
+ "uploadingAttachments": "附件上传中 {{uploaded}}/{{total}}",
+ "delete": "删除",
+ "retry": "重试"
+ },
+ "systemCard": {
+ "goalComplete": "目标已达成 · {{turns}} 轮 · 耗时 {{duration}}",
+ "goalResumed": "用量已恢复,继续目标",
+ "autoResume": "连接中断,已自动继续",
+ "modelLabel": "模型",
+ "sessionLabel": "会话",
+ "sessionResumed": "已续接",
+ "agentSwitch": "已从 {{from}} 切换到 {{to}}",
+ "learnStarted": "技能学习已启动",
+ "learnStartedBody": "蒸馏在桌面端后台进行,完成后请到桌面端查看并评审技能草案。",
+ "learnFailed": "技能学习未能启动",
+ "learnBusyBody": "已有一个学习任务在进行中,等它完成后再试。",
+ "learnFailedBody": "启动失败:{{detail}}",
+ "unknownError": "未知错误"
+ },
+ "quote": {
+ "count": "{{n}} 处引用",
+ "countPreviewHint": "{{n}} 处引用,点击预览",
+ "remove": "移除引用",
+ "closePreview": "关闭引用预览",
+ "menuLabel": "添加到对话"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/zh-CN/models.json b/apps/mobile/src/i18n/locales/zh-CN/models.json
new file mode 100644
index 0000000000..047486650e
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/zh-CN/models.json
@@ -0,0 +1,36 @@
+{
+ "picker": {
+ "title": "模型",
+ "permissionTitle": "权限",
+ "searchAccessibility": "搜索模型",
+ "searchPlaceholder": "搜索模型...",
+ "noResults": "没有匹配的模型",
+ "emptyDefault": "暂无可用模型",
+ "loadingDefault": "正在加载模型…",
+ "subscriptionBadge": "订阅",
+ "backToModels": "返回模型列表",
+ "agentSwitchHint": "选择模型后,下一条消息将切换到 {{agent}}",
+ "crossAgentEmptyHint": "请先在被控电脑连接 {{agent}} 的模型来源",
+ "permissionModeAccessibility": "权限模式:{{mode}}",
+ "selectProviderModelAccessibility": "选择来源 {{provider}} 的模型 {{model}}",
+ "selectModelAccessibility": "选择模型 {{model}}",
+ "configureAccessibility": "配置 {{model}}",
+ "budgetDisabledHint": "该模型需先在被控电脑配置 API key 才能使用",
+ "priceLine": "输入 {{input}} · 输出 {{output}} / 百万 token",
+ "contextSuffix": "{{size}} 上下文",
+ "fastTag": "快速"
+ },
+ "options": {
+ "fastMode": "快速模式",
+ "fastModeAccessibility": "快速模式 {{model}}",
+ "reasoningEffort": "推理强度",
+ "reasoningEffortAccessibility": "推理强度 {{label}}"
+ },
+ "agentSwitch": {
+ "browseAccessibility": "浏览 {{agent}} 模型",
+ "confirmTitle": "切换到 {{agent}}?",
+ "confirmMessage": "下一条消息发送时,{{appName}} 会把当前会话交接给 {{agent}}。两个 Agent 对上下文和工具的理解可能不同,请确认后再选择目标模型。",
+ "cancel": "取消",
+ "confirm": "继续选择"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/zh-CN/session.json b/apps/mobile/src/i18n/locales/zh-CN/session.json
new file mode 100644
index 0000000000..cc7475efb0
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/zh-CN/session.json
@@ -0,0 +1,237 @@
+{
+ "common": {
+ "cancel": "取消",
+ "delete": "删除",
+ "openContextPanel": "打开上下文面板",
+ "groupMode": "模式",
+ "groupAdd": "添加",
+ "planMode": "计划模式",
+ "goalMode": "目标模式",
+ "context": "上下文",
+ "screenshot": "截图",
+ "photo": "照片",
+ "takePhoto": "拍照",
+ "file": "文件",
+ "joinConversation": "加入对话({{num}} 张)",
+ "paletteLoading": "读取中",
+ "noMatchingCommands": "没有匹配的命令",
+ "noMatchingResources": "没有匹配的资源",
+ "keepTypingToNarrow": "继续输入以缩小结果",
+ "insertCommand": "插入命令 {{name}}",
+ "insertResource": "插入资源 {{name}}",
+ "openMicPermission": "打开麦克风权限设置",
+ "maxAttachments": "最多添加 {{max}} 个附件。",
+ "voiceStopRecording": "停止录音",
+ "capabilitiesUnsupported": "远程能力返回格式不支持"
+ },
+ "screen": {
+ "composerSyncing": "正在同步会话数据,同步完成后即可发送。",
+ "composerCreating": "会话创建中,首条消息发出后即可继续发送。",
+ "nextAgentSwitch": "下条切到 {{agent}} · {{model}}",
+ "createFailedTitle": "会话创建失败",
+ "createFailedDefault": "会话创建失败。",
+ "createFailedNotice": "会话创建失败:{{message}}",
+ "backToEdit": "返回编辑",
+ "retry": "重试",
+ "firstMessageNotSent": "首条消息没有发出,内容已还原到输入框。",
+ "locateMessageNotFound": "未找到要定位的消息。",
+ "shareNoLocalImage": "无法获取本地图片文件",
+ "shareFailedTitle": "分享失败",
+ "shareUnsupported": "当前客户端暂不支持分享,更新到最新版本后重试。",
+ "downloadFailed": "下载失败",
+ "voiceNoRemoteDevice": "缺少远程设备,不能开始语音输入。",
+ "voiceSenderNotReady": "消息发送器未初始化。",
+ "voiceStopAndSend": "结束语音输入并发送",
+ "sendMessage": "发送远程消息",
+ "voiceStartInput": "开始语音输入",
+ "stopSession": "停止远程会话",
+ "sessionNotFoundResync": "未找到当前远程会话,请重新同步后再发送。",
+ "missingWorkingDir": "当前会话缺少工作目录,不能发送消息。",
+ "queueMessageGone": "这条排队消息已不在队列里,修改未保存。",
+ "editQueueUnsupported": "电脑端版本过旧,还不支持安全修改排队引用、附件或清空文本。请升级电脑端,或仅修改普通文字。",
+ "sessionNotSyncedRetry": "会话尚未同步完成,请稍后再试。",
+ "savingPreviousQueueEdit": "正在保存上一条排队消息的修改,完成后再编辑。",
+ "attachmentsUploadingBeforeEdit": "还有附件正在上传,等上传完成后再编辑排队消息。",
+ "goalAlreadyActive": "该会话已有进行中的目标,请先在此处理它。",
+ "resetReconfirmTitle": "请重新确认",
+ "resetOfferExpired": "重置凭证已过期,请确认刷新后的额度信息。",
+ "resetOutcomeReset": "Codex 用量窗口已重置。",
+ "resetOutcomeNothing": "当前没有需要重置的用量窗口。",
+ "resetOutcomeNoCredit": "当前没有可用的重置次数。",
+ "resetOutcomeAlready": "这次重置请求已经处理过,用量已刷新。",
+ "resetDoneTitle": "重置完成",
+ "resetResultTitle": "重置结果",
+ "resetFailedTitle": "重置失败",
+ "operationFailed": "操作失败",
+ "sessionDeviceNotFound": "未找到这个会话所属的电脑,请确认对应设备已连接后重试。",
+ "deleteMessageTitle": "删除本条对话?",
+ "deleteMessageBody": "用户消息只删除本条;AI 消息会删除上一次用户输入之后产生的整轮输出。之后的对话继续保留。下次发送时,AI 上下文会从剩余记录重建。",
+ "deleteMessageAction": "删除本条对话",
+ "readingCapabilities": "正在读取 {{agent}} 运行能力…",
+ "editingQueueMessageNumbered": "正在编辑第 {{index}} 条排队消息",
+ "editingQueueMessage": "正在编辑排队消息",
+ "discardQueueEdit": "放弃编辑排队消息",
+ "savingHint": "正在保存修改,完成后再操作。",
+ "composerPlaceholder": "输入远程消息",
+ "openSessionMenu": "打开会话菜单",
+ "searchTitle": "搜索当前会话",
+ "searchPlaceholder": "搜索当前会话消息",
+ "searchEnterKeyword": "输入关键词",
+ "searchNoMatch": "没有匹配的消息",
+ "searchPrevious": "上一条搜索结果",
+ "searchNext": "下一条搜索结果",
+ "syncingSession": "正在同步会话",
+ "awaitingSync": "等待会话同步",
+ "resync": "重新同步远程会话",
+ "collapseHistory": "收起历史消息",
+ "expandHistory": "查看历史消息",
+ "readOnlyMode": "只读模式",
+ "accessRevokedShort": "访问已撤销",
+ "sessionNotSynced": "会话未同步",
+ "conversationFallback": "对话",
+ "accessRevoked": "访问权限已被被控电脑撤销",
+ "syncing": "正在同步",
+ "pendingCount": "待处理 {{num}}",
+ "archived": "已归档",
+ "queuePausedNotice": "队列已暂停"
+ },
+ "new": {
+ "selectDevice": "选择电脑",
+ "workspaceDialogue": "对话",
+ "workspaceProject": "项目",
+ "selectProject": "选择项目",
+ "composerPlaceholder": "今天我们做点什么呢~",
+ "voiceSelectDeviceFirst": "请选择电脑后再使用语音输入。",
+ "creatingSession": "正在创建会话",
+ "createAndSend": "创建会话并发送首条消息",
+ "modelAccessibility": "模型:{{model}}",
+ "voiceInput": "语音输入",
+ "selectDeviceError": "请选择电脑。",
+ "enterProjectPath": "请输入电脑端项目路径。",
+ "enterModel": "请输入模型。",
+ "enterFirstMessageOrAttachment": "请输入首条消息或添加附件。",
+ "noSessionIdReturned": "被控端没有返回新会话 id。",
+ "sessionIdNotAdopted": "被控端未采用预生成会话 id(电脑端版本异常),请更新电脑端后重试。",
+ "firstMessageMissingConfirm": "首条消息没有发出,内容已还原到输入框;发送前请确认会话里没有这条消息。",
+ "firstMessageUnconfirmed": "首条消息发送状态未确认,内容已还原到输入框,请先确认会话里是否已有这条消息再发送。",
+ "selectControlledDevice": "选择被控电脑",
+ "selectDeviceNamed": "选择电脑 {{name}}",
+ "selectAgent": "选择 Agent",
+ "switchToAgent": "切换到 {{label}}",
+ "selectWorkspace": "选择工作区",
+ "dialogueNoProject": "对话(不绑定项目)",
+ "selectProjectNamed": "选择项目 {{title}}",
+ "noProjects": "暂无项目",
+ "chooseOtherFolder": "选择其他项目文件夹",
+ "readingRemoteDir": "正在读取远程目录...",
+ "goParentDir": "返回上级目录",
+ "parentDir": "上级",
+ "useCurrentRemoteDir": "使用当前远程目录",
+ "useCurrent": "使用当前",
+ "firstMessagePlaceholder": "输入首条消息",
+ "noModelsAvailable": "暂无可用模型",
+ "selectDeviceFirst": "请先选择电脑",
+ "enterDir": "进入目录 {{name}}",
+ "selectDir": "选择目录 {{name}}",
+ "select": "选择",
+ "noModelSelected": "未选择模型",
+ "assignedDialogueDir": "电脑端分配对话目录",
+ "extraDirsSuffix": "+{{num}} 附加目录",
+ "noProjectPath": "未选择项目路径",
+ "dialogueWorkspace": "对话工作区",
+ "previewDevice": "电脑: {{name}}",
+ "unknownDevice": "未知设备",
+ "previewLocation": "位置: {{target}}",
+ "previewRuntime": "运行: {{runtime}}",
+ "previewFirstMessage": "首条: {{preview}}",
+ "previewFirstAttachmentOnly": "首条: 仅发送附件",
+ "previewFirstEmpty": "首条: 未填写",
+ "previewAttachments": "附件: {{num}} 个",
+ "previewReadyTitle": "准备创建并发送",
+ "previewNotReadyTitle": "还不能创建",
+ "previewReadySubtitle": "确认后会在被控电脑创建会话,并把首条消息加入队列。"
+ },
+ "menu": {
+ "chipPinned": "已置顶",
+ "chipArchived": "已归档",
+ "chipReadOnly": "只读",
+ "titleFallback": "远程会话",
+ "renameAction": "重命名对话",
+ "copyLinkAction": "复制对话链接",
+ "unpin": "取消置顶",
+ "pin": "置顶",
+ "restore": "恢复",
+ "archive": "归档",
+ "deleteAction": "删除会话",
+ "deleteConversation": "删除对话",
+ "workingDir": "工作目录",
+ "aiRenameUnsupported": "被控电脑版本过旧,暂不支持自动起名。",
+ "aiRenameOffline": "被控电脑不在线,稍后再试。",
+ "aiRenameFailed": "自动起名失败,请重试。",
+ "contextUsageSummary": "上下文 {{percent}}%",
+ "copied": "已复制",
+ "copyFailed": "复制失败",
+ "deleteConfirmTitle": "删除会话?",
+ "deleteConfirmBody": "删除后不可恢复。",
+ "dirAlreadyAdded": "这个目录已经在列表里。",
+ "resetCodexTitle": "重置 Codex 用量?",
+ "resetCodexBody": "将为 {{account}} 消耗 1 次重置。额度窗口会立即重开,此操作不能撤销。",
+ "currentCodexAccount": "当前 Codex 账号",
+ "resetConsumeOnce": "消耗 1 次重置",
+ "titlePlaceholder": "会话标题",
+ "aiRenameLabel": "AI 自动起名",
+ "viewUsageDetail": "查看会话用量详情",
+ "linkCopied": "链接已复制",
+ "sessionInfo": "会话信息",
+ "usageSection": "用量",
+ "refreshContextUsage": "刷新上下文用量",
+ "currentSessionSpend": "本次会话",
+ "noSessionSpend": "暂无会话用量",
+ "contextLabel": "上下文",
+ "accountLimits": "账号限额",
+ "quotaExhaustedResettable": "当前额度已耗尽。重置会立即消耗 1 次,且不能撤销。",
+ "resetting": "正在重置…",
+ "resetCodexUsage": "重置 Codex 用量",
+ "quotaExhaustedNoCredit": "当前额度已耗尽,但没有可用重置次数。",
+ "openDir": "打开目录",
+ "copyPath": "复制路径",
+ "extraDirsSection": "附加引用目录",
+ "noExtraDirs": "当前没有附加目录。附加目录会作为额外上下文提供给被控电脑上的 agent。",
+ "remove": "移除",
+ "collapseRemoteDir": "收起远程目录",
+ "browseRemoteDir": "浏览远程目录",
+ "reading": "正在读取…",
+ "parentDir": "上级",
+ "addCurrentDir": "添加当前目录",
+ "enterRemoteDir": "进入远程目录 {{name}}",
+ "add": "添加",
+ "noSubDirs": "这个目录下没有可进入的子目录。",
+ "dirLimitNotice": "仅显示前 30 个目录,可进入更具体的目录继续选择。",
+ "confirmRename": "确认重命名",
+ "confirm": "确定",
+ "cancelRename": "取消重命名",
+ "backToMenu": "返回会话菜单"
+ },
+ "tail": {
+ "interrupted": "任务执行到一半时应用退出,已被中断。",
+ "continueTask": "继续任务",
+ "retry": "重试",
+ "ignore": "忽略",
+ "codexThreadLost": "Codex 鉴权模式已切换,当前会话无法继续 —— 请新建会话后生效。",
+ "encryptedContentInvalid": "由于更换供应商导致加密不可用,本会话只能在原供应商下使用;请回到电脑端处理(可 Fork 丢弃协议加密内容后在新会话继续)。"
+ },
+ "row": {
+ "moreOptions": "更多选项",
+ "archiveConversation": "归档对话",
+ "closeActionMenu": "关闭会话操作菜单",
+ "referenceAroundAnchor": "链接附近",
+ "referenceRecent": "最近消息",
+ "referenceCount": "{{num}} 条",
+ "referenceTruncated": "已截断",
+ "pinnedSection": "置顶",
+ "extraDirsSummary": "当前 {{num}} 个附加目录",
+ "noExtraDirsSummary": "当前没有附加目录",
+ "attachmentUploadFailed": "附件上传失败,可重试或删除这条消息。",
+ "authGateHint": "{{agent}} 在这台电脑上还没有已连接的模型供应商,发送会失败。请在电脑端 {{appName}} 的「设置 → 模型供应商」完成配置。"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/zh-CN/settings.json b/apps/mobile/src/i18n/locales/zh-CN/settings.json
new file mode 100644
index 0000000000..df19ff592e
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/zh-CN/settings.json
@@ -0,0 +1,113 @@
+{
+ "title": "设置",
+ "language": {
+ "title": "语言",
+ "hint": "仅影响应用界面。Agent 回复语言由 Agent 自身决定。",
+ "options": {
+ "system": "跟随系统",
+ "zh-CN": "简体中文",
+ "en": "English",
+ "ja": "日本語",
+ "ko": "한국어"
+ }
+ },
+ "version": {
+ "sectionTitle": "版本",
+ "currentLabel": "当前版本",
+ "bundleVersion": "整包版本 {{version}}",
+ "otaVersion": "热更版本 {{version}}",
+ "desktopVersion": "桌面版 {{version}}",
+ "devNoOta": "开发版,热更不可用",
+ "checkAction": "检查更新",
+ "checking": "检查中",
+ "updating": "更新中",
+ "checkingAccessibility": "正在检查更新",
+ "bundleUpdateFound": "发现整包更新",
+ "upToDate": "已是最新版本",
+ "bundleUpToDateNoOta": "整包已是最新,当前版本不支持热更新",
+ "downloadedRestarting": "更新已下载,正在重启",
+ "bundleCheckFailed": "无法检查整包更新,请稍后重试",
+ "checkFailedDetail": "检查更新失败:{{detail}}",
+ "checkFailed": "检查更新失败,请稍后重试"
+ },
+ "notifications": {
+ "sectionTitle": "通知",
+ "taskDone": "任务完成通知",
+ "taskDoneHint": "电脑上的任务完成、出错或需要你回复时,推送到这台手机;完成或需要回复时附带最新回复内容。",
+ "permissionDenied": "系统通知权限未开启。请到 iOS「设置 → 通知 → {{appName}}」允许通知后重试。",
+ "unregisterQueued": "已关闭。当前网络下注销未完成,将在下次联网时自动补上。"
+ },
+ "about": {
+ "sectionTitle": "关于这台手机",
+ "deviceName": "设备名称",
+ "deviceNameDetail": "电脑端授权列表会显示这个名称。",
+ "platform": "平台",
+ "remoteControl": "被控权限",
+ "remoteControlValue": "电脑端管理",
+ "remoteControlDetail": "手机只作为控制端。允许被控、撤销和恢复权限仍在电脑端设置里完成。",
+ "editAccessibility": "修改{{label}}"
+ },
+ "relay": {
+ "online": "Relay 已连接",
+ "connecting": "正在连接 Relay",
+ "stopped": "Relay 未连接",
+ "lastSynced": "上次同步 {{time}}",
+ "canSync": "可以同步远程会话。",
+ "reconnectHint": "网络恢复后会自动重新订阅远程会话。",
+ "resumeHint": "回到前台或重新登录后会恢复连接。"
+ },
+ "header": {
+ "notSignedIn": "未登录",
+ "thisPhone": "当前手机"
+ },
+ "debug": {
+ "sectionTitle": "调试 / 开发者",
+ "userId": "用户 ID",
+ "notSynced": "未同步",
+ "deviceId": "设备 ID",
+ "initializing": "初始化中",
+ "authServer": "Auth Server",
+ "authRegion": "登录区域"
+ },
+ "updateInfo": {
+ "embedded": "随整包",
+ "unknown": "未知",
+ "source": "运行来源",
+ "sourceEmbedded": "内置版本(随包)",
+ "sourceOta": "OTA 热更新",
+ "updateId": "更新 ID",
+ "updatedAt": "更新时间",
+ "channel": "Channel",
+ "runtime": "Runtime",
+ "otaMarker": "热更标记"
+ },
+ "legal": {
+ "sectionTitle": "备案信息",
+ "privacyPolicy": "隐私政策",
+ "view": "查看",
+ "openPrivacyPolicy": "打开隐私政策",
+ "appFilingNumber": "App 备案号"
+ },
+ "account": {
+ "logoutHint": "退出只会清除这台手机上的登录态和本地远程镜像,不会影响电脑端会话。",
+ "logout": "退出登录",
+ "loggingOut": "退出中",
+ "loggingOutAccessibility": "正在退出登录"
+ },
+ "copyRow": {
+ "action": "复制",
+ "done": "已复制",
+ "accessibility": "复制{{label}}"
+ },
+ "deviceNameEditor": {
+ "screenTitle": "设备名称",
+ "placeholder": "本机名称",
+ "resetAccessibility": "恢复默认本机名称",
+ "emptyError": "设备名称不能为空。",
+ "deviceInitializing": "设备还在初始化,请稍后再试。",
+ "saving": "保存中…",
+ "saved": "已保存。",
+ "restoringDefault": "正在恢复默认名称…",
+ "restoredDefault": "已恢复默认名称。"
+ }
+}
diff --git a/apps/mobile/src/i18n/locales/zh-CN/shared.json b/apps/mobile/src/i18n/locales/zh-CN/shared.json
new file mode 100644
index 0000000000..4bbe31db45
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/zh-CN/shared.json
@@ -0,0 +1,6 @@
+{
+ "back": "返回",
+ "syncing": "正在同步",
+ "selectOption": "选择 {{label}}",
+ "closePanel": "关闭面板"
+}
diff --git a/apps/mobile/src/i18n/locales/zh-CN/startup.json b/apps/mobile/src/i18n/locales/zh-CN/startup.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/zh-CN/startup.json
@@ -0,0 +1 @@
+{}
diff --git a/apps/mobile/src/i18n/locales/zh-CN/update.json b/apps/mobile/src/i18n/locales/zh-CN/update.json
new file mode 100644
index 0000000000..f53c423dcf
--- /dev/null
+++ b/apps/mobile/src/i18n/locales/zh-CN/update.json
@@ -0,0 +1,17 @@
+{
+ "installHintTitle": "安装提示",
+ "installHintBody": "在系统弹框中点击「安装」后,请回到桌面查看安装进度;下载完成后系统会自动替换当前版本。",
+ "openInstallFailedTitle": "无法打开安装链接",
+ "openInstallFailedBody": "请手动复制安装地址在 Safari 中打开。",
+ "bundleAvailableBody": "发现新版本,需要下载安装整包更新。",
+ "releaseNotes": "\n更新内容:\n{{notes}}",
+ "forcedTitle": "需要更新",
+ "goUpdate": "去更新",
+ "newVersionTitle": "发现新版本",
+ "later": "稍后",
+ "upToDateTitle": "已是最新版本",
+ "upToDateBody": "当前已是最新整包版本。",
+ "checkFailedTitle": "检查失败",
+ "checkFailedBody": "无法连接更新服务器,请稍后重试。",
+ "latestRequestFailed": "latest 请求失败:HTTP {{status}}"
+}
diff --git a/apps/mobile/src/i18n/systemLocale.ts b/apps/mobile/src/i18n/systemLocale.ts
new file mode 100644
index 0000000000..b822cd9b4c
--- /dev/null
+++ b/apps/mobile/src/i18n/systemLocale.ts
@@ -0,0 +1,13 @@
+/**
+ * 系统语言探测(依赖 expo-localization,与纯函数层 locale.ts 分离,
+ * 让偏好存储等纯逻辑模块及其测试不用拖 RN 依赖链)。
+ */
+
+import { getLocales } from 'expo-localization';
+
+import { resolveSystemLocale, type SupportedLocale } from './locale';
+
+/** 读取当前系统首选语言并解析为支持的 locale。 */
+export function detectSystemLocale(): SupportedLocale {
+ return resolveSystemLocale(getLocales()[0]?.languageTag);
+}
diff --git a/apps/mobile/src/i18n/useLocale.tsx b/apps/mobile/src/i18n/useLocale.tsx
new file mode 100644
index 0000000000..619602d9ea
--- /dev/null
+++ b/apps/mobile/src/i18n/useLocale.tsx
@@ -0,0 +1,97 @@
+/**
+ * LocaleProvider / useLocale —— 显示语言偏好 + 实际生效语言(镜像 desktop hooks/useLocale)。
+ *
+ * 与 desktop 的差异:
+ * - 持久化走 AsyncStorage(languagePreferenceStore),读出是异步的:Provider 先以
+ * 系统语言渲染首帧(与 i18n init 值一致),挂载后读出 override 再切换。启动期
+ * 有 StartupSplashOverlay 顶着,切换不产生可见闪变。
+ * - 除 i18next 外还要同步 appLanguage 的手动 override 桥,让手写 catalog
+ * (loginMessages 等)与 i18next 消费方看到同一个生效语言。
+ *
+ * 不做系统语言运行时监听:用户改系统语言后冷启动生效,与现有 catalog 行为一致。
+ */
+
+import {
+ createContext,
+ useCallback,
+ useContext,
+ useEffect,
+ useMemo,
+ useRef,
+ useState,
+ type ReactNode,
+} from 'react';
+
+import { setManualLocaleOverride } from './appLanguage';
+import { i18n, detectSystemLocale, type LocalePreference, type SupportedLocale } from './index';
+import {
+ readLanguagePreference,
+ saveLanguagePreference,
+} from './languagePreferenceStore';
+
+interface LocaleContextValue {
+ /** 用户的偏好选择(含 'system')。 */
+ locale: LocalePreference;
+ /** 实际生效的语言('system' 已解析为系统语言)。 */
+ effectiveLocale: SupportedLocale;
+ /** 设置偏好 —— 持久化 override、刷 i18next、同步手写 catalog 桥。 */
+ setLocale: (next: LocalePreference) => void;
+}
+
+const LocaleContext = createContext<LocaleContextValue | undefined>(undefined);
+
+function effectiveOf(pref: LocalePreference): SupportedLocale {
+ return pref === 'system' ? detectSystemLocale() : pref;
+}
+
+function applyLocale(pref: LocalePreference): SupportedLocale {
+ const effective = effectiveOf(pref);
+ // i18next 同步资源 + 同步 init,changeLanguage 立即生效。
+ void i18n.changeLanguage(effective);
+ setManualLocaleOverride(pref === 'system' ? null : pref);
+ return effective;
+}
+
+export function LocaleProvider({ children }: { children: ReactNode }) {
+ const [locale, setLocaleState] = useState<LocalePreference>('system');
+ const [effectiveLocale, setEffectiveLocale] = useState<SupportedLocale>(detectSystemLocale);
+ // 用户已手动选择过语言时置位:挂载期的异步读回不得覆盖更晚的手动选择。
+ const userChoseRef = useRef(false);
+
+ // 挂载后恢复持久化的 override;读出前按系统语言渲染(与 i18n init 值一致,
+ // 未设置 override 的用户全程无切换)。
+ useEffect(() => {
+ let cancelled = false;
+ void readLanguagePreference().then((pref) => {
+ if (cancelled || userChoseRef.current || pref === 'system') return;
+ setLocaleState(pref);
+ setEffectiveLocale(applyLocale(pref));
+ });
+ return () => {
+ cancelled = true;
+ };
+ }, []);
+
+ const setLocale = useCallback((next: LocalePreference) => {
+ userChoseRef.current = true;
+ setLocaleState(next);
+ // 持久化失败不影响当前会话切换('system' = 删除 override)。
+ void saveLanguagePreference(next);
+ setEffectiveLocale(applyLocale(next));
+ }, []);
+
+ const value = useMemo<LocaleContextValue>(
+ () => ({ locale, effectiveLocale, setLocale }),
+ [locale, effectiveLocale, setLocale],
+ );
+
+ return <LocaleContext.Provider value={value}>{children}</LocaleContext.Provider>;
+}
+
+export function useLocale(): LocaleContextValue {
+ const ctx = useContext(LocaleContext);
+ if (ctx === undefined) {
+ throw new Error('useLocale must be used within a LocaleProvider');
+ }
+ return ctx;
+}
diff --git a/apps/mobile/src/session/ChatFileChipMenuSheet.tsx b/apps/mobile/src/session/ChatFileChipMenuSheet.tsx
index 45a0f3eba0..a63e5fa4b6 100644
--- a/apps/mobile/src/session/ChatFileChipMenuSheet.tsx
+++ b/apps/mobile/src/session/ChatFileChipMenuSheet.tsx
@@ -16,6 +16,7 @@
import { Copy, Eye, FolderOpen, MessageSquarePlus, Share as ShareIcon } from 'lucide-react-native';
import { useRef } from 'react';
+import { useTranslation } from 'react-i18next';
import { ContextSheet, ContextSheetGroup, ContextSheetRow } from '@/session/ContextSheet';
import {
@@ -44,6 +45,7 @@ export function ChatFileChipMenuSheet({
shareBusy,
onAction,
}: ChatFileChipMenuSheetProps) {
+ const { t } = useTranslation();
const { colors } = useTheme();
// target 变 null 时不能立即卸载 Modal(会丢下拉收起动画,规则 7 视觉连续性)。
// 与 ModelPickerSheet 同模式:visible 布尔驱动开/关动画,关闭动画期间用
@@ -75,7 +77,7 @@ export function ChatFileChipMenuSheet({
title={chatFileChipMenuTitle(renderTarget)}
visible={target != null}
>
- <ContextSheetGroup label={renderTarget.kind === 'directory' ? '文件夹' : '文件'}>
+ <ContextSheetGroup label={renderTarget.kind === 'directory' ? t('composer.attachments.fileMenu.folder') : t('composer.attachments.fileMenu.file')}>
{chatFileChipMenuRows(renderTarget).map((row) => (
<ContextSheetRow
busy={row.key === 'share' && shareBusy}
diff --git a/apps/mobile/src/session/ComposerAttachmentTray.tsx b/apps/mobile/src/session/ComposerAttachmentTray.tsx
index 40e13da3a9..5afa92c4e4 100644
--- a/apps/mobile/src/session/ComposerAttachmentTray.tsx
+++ b/apps/mobile/src/session/ComposerAttachmentTray.tsx
@@ -11,6 +11,7 @@
*/
import { Pen, RefreshCw, X } from 'lucide-react-native';
import { Image } from 'expo-image';
+import { useTranslation } from 'react-i18next';
import { ActivityIndicator, Pressable, StyleSheet, View } from 'react-native';
import { Text } from '@/components/AppText';
import type { RemoteSerializedAttachment } from '@/session/types';
@@ -59,6 +60,7 @@ export function ComposerAttachmentTray({
removeDisabledReason,
testIDPrefix,
}: ComposerAttachmentTrayProps) {
+ const { t } = useTranslation();
const styles = useThemedStyles(makeTrayStyles);
const { colors } = useTheme();
if (attachments.length === 0 && pendingUploads.length === 0 && pastePlaceholderCount === 0) return null;
@@ -70,7 +72,7 @@ export function ComposerAttachmentTray({
return (
<View key={attachment.id} style={styles.thumbCard} testID={`${testIDPrefix}.attachmentThumb`}>
<Pressable
- accessibilityLabel={`查看图片 ${attachment.name}`}
+ accessibilityLabel={t('composer.attachments.viewImage', { name: attachment.name })}
accessibilityRole="button"
onPress={() => onPreview(attachment.id)}
style={({ pressed }) => [styles.thumbPressable, pressed && styles.pressed]}
@@ -88,7 +90,7 @@ export function ComposerAttachmentTray({
</Pressable>
<Pressable
accessibilityHint={removeDisabledReason}
- accessibilityLabel={`移除附件 ${attachment.name}`}
+ accessibilityLabel={t('composer.attachments.removeAttachment', { name: attachment.name })}
accessibilityRole="button"
disabled={removeDisabled}
hitSlop={6}
@@ -108,7 +110,7 @@ export function ComposerAttachmentTray({
</Text>
<Pressable
accessibilityHint={removeDisabledReason}
- accessibilityLabel={`移除附件 ${attachment.name}`}
+ accessibilityLabel={t('composer.attachments.removeAttachment', { name: attachment.name })}
accessibilityRole="button"
disabled={removeDisabled}
hitSlop={8}
@@ -128,14 +130,14 @@ export function ComposerAttachmentTray({
{pending.failed ? (
// 失败态:遮罩变为可点的「重试」——弱网下让用户原地重试,不用重新找图。
<Pressable
- accessibilityLabel={`重试上传 ${pending.name}`}
+ accessibilityLabel={t('composer.attachments.retryUpload', { name: pending.name })}
accessibilityRole="button"
onPress={() => onRetryPending?.(pending.localId)}
style={({ pressed }) => [styles.thumbBusyOverlay, pressed && styles.pressed]}
testID={`${testIDPrefix}.attachmentPendingRetryButton`}
>
<RefreshCw color={colors.ctaText} size={iconSize.md} strokeWidth={iconStroke.bold} />
- <Text style={styles.thumbFailedText}>重试</Text>
+ <Text style={styles.thumbFailedText}>{t('composer.attachments.retry')}</Text>
</Pressable>
) : (
<View style={styles.thumbBusyOverlay}>
@@ -145,7 +147,7 @@ export function ComposerAttachmentTray({
</View>
<Pressable
accessibilityHint={removeDisabledReason}
- accessibilityLabel={pending.failed ? `移除失败的附件 ${pending.name}` : `取消上传 ${pending.name}`}
+ accessibilityLabel={pending.failed ? t('composer.attachments.removeFailed', { name: pending.name }) : t('composer.attachments.cancelUpload', { name: pending.name })}
accessibilityRole="button"
disabled={removeDisabled}
hitSlop={6}
@@ -160,7 +162,7 @@ export function ComposerAttachmentTray({
<View key={pending.localId} style={styles.chip} testID={`${testIDPrefix}.attachmentPendingChip`}>
{pending.failed ? (
<Pressable
- accessibilityLabel={`重试上传 ${pending.name}`}
+ accessibilityLabel={t('composer.attachments.retryUpload', { name: pending.name })}
accessibilityRole="button"
hitSlop={8}
onPress={() => onRetryPending?.(pending.localId)}
@@ -173,11 +175,11 @@ export function ComposerAttachmentTray({
<ActivityIndicator color={colors.textSecondary} size="small" />
)}
<Text numberOfLines={1} style={styles.chipText}>
- {pending.failed ? `${pending.name} · 上传失败` : pendingUploadDisplayLabel(pending)}
+ {pending.failed ? t('composer.attachments.uploadFailed', { name: pending.name }) : pendingUploadDisplayLabel(pending)}
</Text>
<Pressable
accessibilityHint={removeDisabledReason}
- accessibilityLabel={pending.failed ? `移除失败的附件 ${pending.name}` : `取消上传 ${pending.name}`}
+ accessibilityLabel={pending.failed ? t('composer.attachments.removeFailed', { name: pending.name }) : t('composer.attachments.cancelUpload', { name: pending.name })}
accessibilityRole="button"
disabled={removeDisabled}
hitSlop={8}
@@ -233,6 +235,7 @@ export function ComposerAttachmentCollapsedBadge({
onPress,
testID,
}: ComposerAttachmentCollapsedBadgeProps) {
+ const { t } = useTranslation();
const styles = useThemedStyles(makeTrayStyles);
const count = attachments.length + pendingUploads.length + pastePlaceholderCount;
if (count === 0) return null;
@@ -249,7 +252,7 @@ export function ComposerAttachmentCollapsedBadge({
const extra = count - 1;
return (
<Pressable
- accessibilityLabel={`${count} 个附件,点击展开`}
+ accessibilityLabel={t('composer.attachments.collapsedBadge', { count })}
accessibilityRole="button"
onPress={onPress}
style={({ pressed }) => [styles.collapsedBadge, pressed && styles.pressed]}
diff --git a/apps/mobile/src/session/ContextSheet.tsx b/apps/mobile/src/session/ContextSheet.tsx
index 29f6f83e3b..a70f04d496 100644
--- a/apps/mobile/src/session/ContextSheet.tsx
+++ b/apps/mobile/src/session/ContextSheet.tsx
@@ -9,6 +9,7 @@
* 会话页与新建会话页共用本组件(同 MobileComposerInputRow 的共享约定)。
*/
import { useEffect, useMemo, useState, type ReactNode } from 'react';
+import { useTranslation } from 'react-i18next';
import { ChevronRight } from 'lucide-react-native';
import {
ActivityIndicator,
@@ -59,6 +60,7 @@ export function ContextSheet({
testID,
}: ContextSheetProps) {
const styles = useThemedStyles(makeContextSheetStyles);
+ const { t } = useTranslation();
const { height: windowHeight } = useWindowDimensions();
const insets = useSafeAreaInsets();
const [snap, setSnap] = useState<ContextSheetSnap>('half');
@@ -87,7 +89,7 @@ export function ContextSheet({
visible={visible}
>
<SheetSurface
- backAccessibilityLabel="返回上下文面板"
+ backAccessibilityLabel={t('interaction.contextSheet.backAccessibility')}
bottomInset={insets.bottom}
footer={footer}
heights={heights}
diff --git a/apps/mobile/src/session/ContextSheetGoalView.tsx b/apps/mobile/src/session/ContextSheetGoalView.tsx
index d32fbc7666..e04b6acb0e 100644
--- a/apps/mobile/src/session/ContextSheetGoalView.tsx
+++ b/apps/mobile/src/session/ContextSheetGoalView.tsx
@@ -9,6 +9,7 @@
* remoteSessionStore 镜像的状态投影。
*/
import { useState } from 'react';
+import { useTranslation } from 'react-i18next';
import { ChevronDown, ChevronRight } from 'lucide-react-native';
import {
ActivityIndicator,
@@ -22,6 +23,7 @@ import type {
MobileGoalStatus,
MobileGoalStatusPayload,
} from '@cindy/maker-shared/device-link-contract';
+import { i18n } from '@/i18n';
import { fontWeight, iconSize, iconStroke, lineHeight, radius, spacing, typeScale, useTheme, useThemedStyles, type ThemeColors } from '@/theme';
/** 三项上限的推荐预设(与桌面 GoalAdvancedLimits 一致,2026-06 与用户确认)。 */
@@ -44,13 +46,17 @@ function formatTokenPreset(n: number): string {
return String(n);
}
+/**
+ * 状态标签映射。值用 getter 惰性求值(i18n.t 在访问时调用,不冻结语言),
+ * 既保留 `GOAL_STATUS_LABEL[status]` 索引用法给外部调用方,又跟随语言切换。
+ */
export const GOAL_STATUS_LABEL: Record<MobileGoalStatus, string> = {
- active: '进行中',
- paused: '已暂停',
- blocked: '待处理',
- complete: '已完成',
- budgetLimited: '已达上限',
- usageLimited: '用量受限',
+ get active() { return i18n.t('interaction.contextSheet.goalStatus.active'); },
+ get paused() { return i18n.t('interaction.contextSheet.goalStatus.paused'); },
+ get blocked() { return i18n.t('interaction.contextSheet.goalStatus.blocked'); },
+ get complete() { return i18n.t('interaction.contextSheet.goalStatus.complete'); },
+ get budgetLimited() { return i18n.t('interaction.contextSheet.goalStatus.budgetLimited'); },
+ get usageLimited() { return i18n.t('interaction.contextSheet.goalStatus.usageLimited'); },
};
export interface ContextSheetGoalViewProps {
@@ -115,6 +121,7 @@ export function ContextSheetGoalCreateForm({
}) {
const styles = useThemedStyles(makeGoalStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const [objective, setObjective] = useState(initial?.objective ?? '');
const [limits, setLimits] = useState<MobileGoalLimitsInput>(initial?.limits ?? DEFAULT_GOAL_LIMITS);
// 规则 20:只有用户显式改过上限才回传 limits;从未改动 → 省略,让被控端
@@ -137,20 +144,20 @@ export function ContextSheetGoalCreateForm({
return (
<View testID={testID}>
- <Text style={styles.groupLabel}>目标</Text>
+ <Text style={styles.groupLabel}>{t('interaction.contextSheet.goalLabel')}</Text>
<TextInput
- accessibilityLabel="目标内容"
+ accessibilityLabel={t('interaction.contextSheet.goalObjectiveAccessibility')}
editable={!busy}
multiline
onChangeText={setObjective}
- placeholder="想要达成什么?agent 会围绕这个目标自动续跑,直到完成或达到限制。"
+ placeholder={t('interaction.contextSheet.goalPlaceholder')}
placeholderTextColor={colors.textTertiary}
style={styles.objectiveInput}
testID="contextSheet.goalObjectiveInput"
value={objective}
/>
<Pressable
- accessibilityLabel="高级设置"
+ accessibilityLabel={t('interaction.contextSheet.advancedSettings')}
accessibilityRole="button"
accessibilityState={{ expanded: advancedOpen }}
onPress={() => setAdvancedOpen((open) => !open)}
@@ -160,15 +167,15 @@ export function ContextSheetGoalCreateForm({
{advancedOpen
? <ChevronDown color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />
: <ChevronRight color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />}
- <Text style={styles.advancedToggleText}>高级设置</Text>
+ <Text style={styles.advancedToggleText}>{t('interaction.contextSheet.advancedSettings')}</Text>
</Pressable>
{advancedOpen ? (
<>
- <Text style={styles.hintText}>未改动时跟随被控端的默认限制;达到任一上限时目标自动停止,可随时手动终止;「不限」表示不设该上限。</Text>
+ <Text style={styles.hintText}>{t('interaction.contextSheet.limitsHint')}</Text>
<LimitOptionsRow
disabled={busy}
format={(n) => String(n)}
- label="最大轮数"
+ label={t('interaction.contextSheet.maxTurns')}
onSelect={(next) => patchLimits({ maxTurns: next })}
presets={MAX_TURNS_PRESETS}
testID="contextSheet.goalMaxTurnsOptions"
@@ -177,7 +184,7 @@ export function ContextSheetGoalCreateForm({
<LimitOptionsRow
disabled={busy}
format={formatTokenPreset}
- label="Token 预算"
+ label={t('interaction.contextSheet.tokenBudget')}
onSelect={(next) => patchLimits({ budgetTokens: next })}
presets={BUDGET_PRESETS}
testID="contextSheet.goalBudgetOptions"
@@ -186,7 +193,7 @@ export function ContextSheetGoalCreateForm({
<LimitOptionsRow
disabled={busy}
format={(n) => String(n)}
- label="无进展上限"
+ label={t('interaction.contextSheet.noProgressLimit')}
onSelect={(next) => patchLimits({ noProgressLimit: next })}
presets={NO_PROGRESS_PRESETS}
testID="contextSheet.goalNoProgressOptions"
@@ -196,7 +203,7 @@ export function ContextSheetGoalCreateForm({
) : null}
{error ? <Text style={styles.errorText}>{error}</Text> : null}
<Pressable
- accessibilityLabel="开始目标"
+ accessibilityLabel={t('interaction.contextSheet.startGoal')}
accessibilityRole="button"
accessibilityState={{ disabled: busy || !objective.trim() }}
disabled={busy || !objective.trim()}
@@ -211,7 +218,7 @@ export function ContextSheetGoalCreateForm({
{busy ? (
<ActivityIndicator color={colors.ctaText} size="small" />
) : (
- <Text style={styles.ctaLabel}>开始目标</Text>
+ <Text style={styles.ctaLabel}>{t('interaction.contextSheet.startGoal')}</Text>
)}
</Pressable>
</View>
@@ -237,8 +244,11 @@ function GoalStatusView({
}) {
const styles = useThemedStyles(makeGoalStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const canPause = goal.status === 'active';
const canResume = goal.status === 'paused' || goal.status === 'blocked' || goal.status === 'usageLimited';
+ const turnsText = `${goal.turnsUsed}${goal.maxTurns !== null ? ` / ${goal.maxTurns}` : ''}`;
+ const tokensText = `${formatTokens(goal.tokensUsed)}${goal.budgetTokens !== null ? ` / ${formatTokens(goal.budgetTokens)}` : ''}`;
return (
<View testID={testID}>
<View style={styles.statusHeader}>
@@ -248,7 +258,7 @@ function GoalStatusView({
</Text>
</View>
<Text style={styles.statusMeta}>
- {`${goal.turnsUsed}${goal.maxTurns !== null ? ` / ${goal.maxTurns}` : ''} 轮 · ${formatTokens(goal.tokensUsed)}${goal.budgetTokens !== null ? ` / ${formatTokens(goal.budgetTokens)}` : ''} token`}
+ {t('interaction.contextSheet.goalMeta', { turns: turnsText, tokens: tokensText })}
</Text>
</View>
<Text style={styles.objectiveText} testID="contextSheet.goalObjectiveText">{goal.objective}</Text>
@@ -256,14 +266,14 @@ function GoalStatusView({
{error ? <Text style={styles.errorText}>{error}</Text> : null}
<View style={styles.actionRow}>
{canPause ? (
- <GoalActionButton busy={busy} label="暂停" onPress={onPauseGoal} testID="contextSheet.goalPauseButton" />
+ <GoalActionButton busy={busy} label={t('interaction.contextSheet.pause')} onPress={onPauseGoal} testID="contextSheet.goalPauseButton" />
) : null}
{canResume ? (
- <GoalActionButton busy={busy} label="继续" onPress={onResumeGoal} testID="contextSheet.goalResumeButton" />
+ <GoalActionButton busy={busy} label={t('interaction.contextSheet.resume')} onPress={onResumeGoal} testID="contextSheet.goalResumeButton" />
) : null}
<GoalActionButton
busy={busy}
- label="终止目标"
+ label={t('interaction.contextSheet.clearGoal')}
onPress={onClearGoal}
testID="contextSheet.goalClearButton"
textColor={colors.statusRecording}
@@ -324,6 +334,7 @@ function LimitOptionsRow({
testID?: string;
}) {
const styles = useThemedStyles(makeGoalStyles);
+ const { t } = useTranslation();
const options = value != null && !presets.includes(value) ? [value, ...presets] : presets;
return (
<View style={styles.limitOptionsRow} testID={testID}>
@@ -340,7 +351,7 @@ function LimitOptionsRow({
))}
<LimitPill
disabled={disabled}
- label="不限"
+ label={t('interaction.contextSheet.unlimited')}
onPress={() => onSelect(null)}
selected={value === null}
/>
diff --git a/apps/mobile/src/session/ContextSheetMediaViews.tsx b/apps/mobile/src/session/ContextSheetMediaViews.tsx
index f8c638042f..5add25d011 100644
--- a/apps/mobile/src/session/ContextSheetMediaViews.tsx
+++ b/apps/mobile/src/session/ContextSheetMediaViews.tsx
@@ -6,6 +6,7 @@
* 选中态由页面传入 selectedAssetIds(assetId ↔ 附件映射的真相在页面)。
*/
import { Check } from 'lucide-react-native';
+import { useTranslation } from 'react-i18next';
// RN 的 Image 在新架构下不支持 ph:// 相册 URI(facebook/react-native#36136),
// 缩略图走 expo-image:原生支持 ph://,且按视图尺寸解码,不会整张原图进内存。
import { Image } from 'expo-image';
@@ -99,6 +100,7 @@ export function ScreenshotsGrid({
testID,
}: ContextSheetMediaCallbacks & { enabled: boolean; contentWidth: number; testID?: string }) {
const styles = useThemedStyles(makeMediaStyles);
+ const { t } = useTranslation();
const media = useContextSheetMediaAssets({ enabled, kind: 'screenshots' });
const thumbSize = Math.floor((contentWidth - spacing.sm * (GRID_COLUMNS - 1)) / GRID_COLUMNS);
@@ -111,7 +113,7 @@ export function ScreenshotsGrid({
);
}
if (media.status === 'unavailable' || (media.status === 'ready' && media.assets.length === 0)) {
- return <Text style={styles.emptyText}>没有找到截图。</Text>;
+ return <Text style={styles.emptyText}>{t('interaction.contextSheet.noScreenshots')}</Text>;
}
const rows: ContextSheetMediaAsset[][] = [];
for (let i = 0; i < media.assets.length; i += GRID_COLUMNS) {
@@ -159,11 +161,12 @@ function MediaThumb({
}) {
const styles = useThemedStyles(makeMediaStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const accessibilityLabel = selected
- ? `移除照片附件 ${asset.filename}`
+ ? t('interaction.contextSheet.mediaRemove', { name: asset.filename })
: pendingIndex
- ? `取消选择照片 ${asset.filename}`
- : `选择照片 ${asset.filename}`;
+ ? t('interaction.contextSheet.mediaDeselect', { name: asset.filename })
+ : t('interaction.contextSheet.mediaSelect', { name: asset.filename });
return (
<Pressable
accessibilityLabel={accessibilityLabel}
@@ -199,16 +202,17 @@ function MediaThumb({
function PermissionHint({ onRequest, testID }: { onRequest: () => void; testID?: string }) {
const styles = useThemedStyles(makeMediaStyles);
+ const { t } = useTranslation();
return (
<View style={styles.permissionHint} testID={testID}>
- <Text style={styles.permissionText}>照片权限未开启,开启后可快速添加最近照片。</Text>
+ <Text style={styles.permissionText}>{t('interaction.contextSheet.photoPermissionHint')}</Text>
<Pressable
- accessibilityLabel="开启照片权限"
+ accessibilityLabel={t('interaction.contextSheet.enablePhotoPermission')}
accessibilityRole="button"
onPress={onRequest}
style={({ pressed }) => [styles.permissionButton, pressed && styles.thumbPressed]}
>
- <Text style={styles.permissionButtonText}>去开启</Text>
+ <Text style={styles.permissionButtonText}>{t('interaction.contextSheet.enable')}</Text>
</Pressable>
</View>
);
diff --git a/apps/mobile/src/session/ImageLightbox.tsx b/apps/mobile/src/session/ImageLightbox.tsx
index c6cc823cc7..3ec96d18c1 100644
--- a/apps/mobile/src/session/ImageLightbox.tsx
+++ b/apps/mobile/src/session/ImageLightbox.tsx
@@ -12,6 +12,7 @@
* lightbox 是常黑沉浸语境,黑白系颜色为刻意豁免(对齐桌面 docs/design-rules/cindy-design-system.md overlay/lightbox 语义豁免),不走主题 token。
*/
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
+import { useTranslation } from 'react-i18next';
import {
ActivityIndicator,
FlatList,
@@ -157,6 +158,7 @@ export const ImageLightbox = memo(function ImageLightbox({
showFileHeader,
annotation,
}: ImageLightboxProps) {
+ const { t } = useTranslation();
const { width, height } = useWindowDimensions();
const insets = useSafeAreaInsets();
const urls = useMemo(() => images.map((image) => image.url), [images]);
@@ -476,7 +478,7 @@ export const ImageLightbox = memo(function ImageLightbox({
<View pointerEvents="box-none" style={[styles.actionBar, { bottom: insets.bottom + 12 }]}>
<View style={styles.actionBarPill}>
<Pressable
- accessibilityLabel="取消标注"
+ accessibilityLabel={t('message.lightbox.cancelAnnotation')}
disabled={annotationSubmitting}
hitSlop={8}
onPress={exitAnnotationMode}
@@ -484,10 +486,10 @@ export const ImageLightbox = memo(function ImageLightbox({
testID="message.imageLightboxAnnotationCancel"
>
<X color="#ffffff" size={iconSize.action} strokeWidth={iconStroke.regular} />
- <Text style={styles.actionLabel}>取消</Text>
+ <Text style={styles.actionLabel}>{t('message.lightbox.cancel')}</Text>
</Pressable>
<Pressable
- accessibilityLabel="撤销上一笔"
+ accessibilityLabel={t('message.lightbox.undoLastStroke')}
disabled={strokes.length === 0 || annotationSubmitting}
hitSlop={8}
onPress={undoLastStroke}
@@ -499,10 +501,10 @@ export const ImageLightbox = memo(function ImageLightbox({
size={iconSize.action}
strokeWidth={iconStroke.regular}
/>
- <Text style={[styles.actionLabel, strokes.length === 0 && styles.actionLabelDisabled]}>撤销</Text>
+ <Text style={[styles.actionLabel, strokes.length === 0 && styles.actionLabelDisabled]}>{t('message.lightbox.undo')}</Text>
</Pressable>
<Pressable
- accessibilityLabel={annotation?.submitLabel ?? '完成'}
+ accessibilityLabel={annotation?.submitLabel ?? t('message.lightbox.done')}
disabled={annotationSubmitting}
hitSlop={8}
onPress={handleSubmitAnnotation}
@@ -514,14 +516,14 @@ export const ImageLightbox = memo(function ImageLightbox({
) : (
<MessageSquarePlus color="#ffffff" size={iconSize.action} strokeWidth={iconStroke.regular} />
)}
- <Text style={styles.actionLabel}>{annotation?.submitLabel ?? '完成'}</Text>
+ <Text style={styles.actionLabel}>{annotation?.submitLabel ?? t('message.lightbox.done')}</Text>
</Pressable>
</View>
</View>
) : showFileHeader ? (
<View pointerEvents="box-none" style={styles.fileHeader}>
- <Pressable accessibilityLabel="完成" hitSlop={10} onPress={onClose} testID="message.imageLightboxDone">
- <Text style={styles.fileHeaderDone}>完成</Text>
+ <Pressable accessibilityLabel={t('message.lightbox.done')} hitSlop={10} onPress={onClose} testID="message.imageLightboxDone">
+ <Text style={styles.fileHeaderDone}>{t('message.lightbox.done')}</Text>
</Pressable>
<View pointerEvents="none" style={styles.fileHeaderTitleCol}>
<Text numberOfLines={1} style={styles.fileHeaderTitle} testID="message.imageLightboxTitle">
@@ -533,7 +535,7 @@ export const ImageLightbox = memo(function ImageLightbox({
</View>
{shareVisible ? (
<Pressable
- accessibilityLabel="分享图片"
+ accessibilityLabel={t('message.lightbox.shareImage')}
hitSlop={10}
onPress={handleShare}
testID="message.imageLightboxShareButton"
@@ -552,14 +554,14 @@ export const ImageLightbox = memo(function ImageLightbox({
<View style={styles.actionBarPill}>
{annotateVisible ? (
<Pressable
- accessibilityLabel="标注图片"
+ accessibilityLabel={t('message.lightbox.annotateImage')}
hitSlop={8}
onPress={() => setIsAnnotating(true)}
style={styles.actionItem}
testID="message.imageLightboxAnnotateButton"
>
<Pen color="#ffffff" size={iconSize.action} strokeWidth={iconStroke.regular} />
- <Text style={styles.actionLabel}>标注</Text>
+ <Text style={styles.actionLabel}>{t('message.lightbox.annotate')}</Text>
</Pressable>
) : null}
{extraActions.map((action) => (
@@ -577,14 +579,14 @@ export const ImageLightbox = memo(function ImageLightbox({
))}
{shareVisible && !showFileHeader ? (
<Pressable
- accessibilityLabel="分享图片"
+ accessibilityLabel={t('message.lightbox.shareImage')}
hitSlop={8}
onPress={handleShare}
style={styles.actionItem}
testID="message.imageLightboxShareButton"
>
<ShareIcon color="#ffffff" size={iconSize.action} strokeWidth={iconStroke.regular} />
- <Text style={styles.actionLabel}>导出 / 分享</Text>
+ <Text style={styles.actionLabel}>{t('message.lightbox.exportShare')}</Text>
</Pressable>
) : null}
</View>
@@ -597,19 +599,19 @@ export const ImageLightbox = memo(function ImageLightbox({
<View style={styles.actionBarPill}>
{annotateVisible ? (
<Pressable
- accessibilityLabel="标注图片"
+ accessibilityLabel={t('message.lightbox.annotateImage')}
hitSlop={8}
onPress={() => setIsAnnotating(true)}
style={styles.actionItem}
testID="message.imageLightboxAnnotateButton"
>
<Pen color="#ffffff" size={iconSize.action} strokeWidth={iconStroke.regular} />
- <Text style={styles.actionLabel}>标注</Text>
+ <Text style={styles.actionLabel}>{t('message.lightbox.annotate')}</Text>
</Pressable>
) : null}
{directSubmitVisible ? (
<Pressable
- accessibilityLabel={annotation?.submitLabel ?? '发送到对话'}
+ accessibilityLabel={annotation?.submitLabel ?? t('message.lightbox.sendToChat')}
disabled={annotationSubmitting}
hitSlop={8}
onPress={handleSubmitAnnotation}
@@ -621,7 +623,7 @@ export const ImageLightbox = memo(function ImageLightbox({
) : (
<MessageSquarePlus color="#ffffff" size={iconSize.action} strokeWidth={iconStroke.regular} />
)}
- <Text style={styles.actionLabel}>{annotation?.submitLabel ?? '发送到对话'}</Text>
+ <Text style={styles.actionLabel}>{annotation?.submitLabel ?? t('message.lightbox.sendToChat')}</Text>
</Pressable>
) : null}
{shareVisible && (annotateVisible || directSubmitVisible) ? (
@@ -629,14 +631,14 @@ export const ImageLightbox = memo(function ImageLightbox({
) : null}
{shareVisible ? (
<Pressable
- accessibilityLabel="分享图片"
+ accessibilityLabel={t('message.lightbox.shareImage')}
hitSlop={8}
onPress={handleShare}
style={styles.actionItem}
testID="message.imageLightboxShareButton"
>
<ShareIcon color="#ffffff" size={iconSize.action} strokeWidth={iconStroke.regular} />
- <Text style={styles.actionLabel}>导出 / 分享</Text>
+ <Text style={styles.actionLabel}>{t('message.lightbox.exportShare')}</Text>
</Pressable>
) : null}
</View>
@@ -703,6 +705,7 @@ const LightboxPage = memo(function LightboxPage({
uri: string | null;
width: number;
}) {
+ const { t } = useTranslation();
const scale = useSharedValue(1);
const savedScale = useSharedValue(1);
const translateX = useSharedValue(0);
@@ -929,21 +932,21 @@ const LightboxPage = memo(function LightboxPage({
// 取件中 / 失败分支没有图片手势层,必须自带关闭途径(单击空白处关闭),
// 否则 iOS 上打开离线图会困在全屏 Modal 里;重试按钮自己消费点击不受影响。
<Pressable
- accessibilityLabel="关闭图片"
+ accessibilityLabel={t('message.lightbox.closeImage')}
onPress={onRequestClose}
style={[styles.pageFill, styles.pageCenter]}
>
{resolveState?.status === 'error' || resolvedUnsupported || (!retryable && !media.previewable) ? (
<>
- <Text style={styles.stateText}>图片加载失败</Text>
+ <Text style={styles.stateText}>{t('message.lightbox.loadFailed')}</Text>
{retryable ? (
<Pressable
- accessibilityLabel="重试加载图片"
+ accessibilityLabel={t('message.lightbox.retryLoadImage')}
onPress={() => onRetry(image)}
style={styles.retryButton}
testID="message.imageLightboxRetryButton"
>
- <Text style={styles.retryText}>重试</Text>
+ <Text style={styles.retryText}>{t('message.lightbox.retry')}</Text>
</Pressable>
) : null}
</>
diff --git a/apps/mobile/src/session/InlineQueueSection.tsx b/apps/mobile/src/session/InlineQueueSection.tsx
index f53a379bd3..e57d055f0d 100644
--- a/apps/mobile/src/session/InlineQueueSection.tsx
+++ b/apps/mobile/src/session/InlineQueueSection.tsx
@@ -17,6 +17,7 @@
* 避免「排队气泡 + 正式消息」双显(排队气泡消失的同帧正式气泡已在流里,无跳变)。
*/
import { useState, type ReactNode } from 'react';
+import { useTranslation } from 'react-i18next';
import {
ActivityIndicator,
Pressable,
@@ -51,6 +52,7 @@ import type { MobileOutboxDisplayItem, MobileOutboxThumb } from '@/session/sessi
import type { InputProjection, QueuedRemoteMessage } from '@/session/types';
import { iconSize, iconStroke, fontWeight, lineHeight, useTheme, useThemedStyles, type ThemeColors } from '@/theme';
import { radius, spacing, typeScale } from '@/theme/tokens';
+import { i18n } from '@/i18n';
/** 折叠时挂载的排队行数(与旧 QueuePanel 同档),其余收进「展开剩余 N 条」。 */
const COLLAPSED_VISIBLE_ROWS = 3;
@@ -64,8 +66,8 @@ function queueBubbleText(item: Pick<QueuedRemoteMessage, 'text' | 'chatMessage'>
? stripChatQuoteMarkerLines(item.text)
: item.text;
const kind = syntheticTriggerKind(visibleText);
- if (kind === 'continue') return '继续未完成的任务(系统指令)';
- if (kind === 'generic') return '系统指令';
+ if (kind === 'continue') return i18n.t('message.queue.continueSystemInstruction');
+ if (kind === 'generic') return i18n.t('message.queue.systemInstruction');
return visibleText;
}
@@ -185,6 +187,7 @@ export function InlineQueueSection({
}: InlineQueueSectionProps) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
// 本区在 FlatList 的 ListFooterComponent 里,行不参与虚拟化:默认只挂前
// COLLAPSED_VISIBLE_ROWS 条(最先发送的在前),其余折叠为「展开剩余 N 条」,
// 防止排队几十条时打开会话即整段挂载导致卡顿(review P2)。展开是用户显式
@@ -214,14 +217,14 @@ export function InlineQueueSection({
<ActionPill
busy={busy}
disabled={controlsDisabled || !projection.errorRetryText}
- label="重试发送"
+ label={t('message.queue.retrySend')}
onPress={onRetryError}
testID="queue.inline.retryButton"
/>
<ActionPill
busy={busy}
disabled={controlsDisabled}
- label="清除错误"
+ label={t('message.queue.clearError')}
onPress={onClearError}
testID="queue.inline.clearErrorButton"
/>
@@ -232,21 +235,21 @@ export function InlineQueueSection({
{projection.credentialSwitchWait ? (
<View style={styles.banner} testID="queue.inline.credentialSwitchWaitBanner">
<ActivityIndicator color={colors.textTertiary} size="small" />
- <Text style={styles.bannerText}>正在等待其它 Codex 任务结束,结束后自动发送</Text>
+ <Text style={styles.bannerText}>{t('message.queue.credentialSwitchWait')}</Text>
</View>
) : null}
{projection.queueAbortPending ? (
<View style={styles.banner} testID="queue.inline.abortBanner">
<ActivityIndicator color={colors.textTertiary} size="small" />
- <Text style={styles.bannerText}>正在停止,排队消息会保留在这里</Text>
+ <Text style={styles.bannerText}>{t('message.queue.aborting')}</Text>
</View>
) : projection.queuePaused ? (
<View style={styles.banner} testID="queue.inline.pausedBanner">
<Pause color={colors.textTertiary} size={iconSize.sm} strokeWidth={iconStroke.regular} />
- <Text style={styles.bannerText}>队列已暂停,排队消息不会自动发送</Text>
+ <Text style={styles.bannerText}>{t('message.queue.paused')}</Text>
<QueueTouchButton
- accessibilityLabel="继续发送队列"
+ accessibilityLabel={t('message.queue.resumeSendQueue')}
busy={busy}
disabled={controlsDisabled}
disabledReason={readOnlyReason}
@@ -255,7 +258,7 @@ export function InlineQueueSection({
testID="queue.inline.resumeButton"
>
<Play color={colors.ctaText} fill={colors.ctaText} size={iconSize.xs} strokeWidth={iconStroke.regular} />
- <Text style={styles.resumePillText}>继续</Text>
+ <Text style={styles.resumePillText}>{t('message.queue.resume')}</Text>
</QueueTouchButton>
</View>
) : null}
@@ -276,7 +279,7 @@ export function InlineQueueSection({
{settlingThumbs.fileCount > 0 ? (
<View style={styles.attachmentLine}>
<Paperclip color={colors.textTertiary} size={iconSize.xs} strokeWidth={iconStroke.regular} />
- <Text style={styles.attachmentLineText}>{`${settlingThumbs.fileCount} 个附件`}</Text>
+ <Text style={styles.attachmentLineText}>{t('message.queue.attachmentCount', { n: settlingThumbs.fileCount })}</Text>
</View>
) : null}
</View>
@@ -313,8 +316,8 @@ export function InlineQueueSection({
<Pressable
accessibilityHint={presentation.hint ?? undefined}
accessibilityLabel={presentation.steering
- ? `插话发送中:${queueBubbleText(item) || '附件消息'}`
- : `排队消息 ${originalIndex + 1}:${queueBubbleText(item) || '附件消息'}`}
+ ? t('message.queue.steeringLabel', { text: queueBubbleText(item) || t('message.queue.attachmentMessage') })
+ : t('message.queue.queuedMessageLabel', { index: originalIndex + 1, text: queueBubbleText(item) || t('message.queue.attachmentMessage') })}
accessibilityRole="button"
accessibilityState={{ expanded: selected, disabled: editing }}
disabled={editing}
@@ -336,12 +339,12 @@ export function InlineQueueSection({
{queuedThumbs.fileCount > 0 ? (
<View style={styles.attachmentLine}>
<Paperclip color={colors.textTertiary} size={iconSize.xs} strokeWidth={iconStroke.regular} />
- <Text style={styles.attachmentLineText}>{`${queuedThumbs.fileCount} 个附件`}</Text>
+ <Text style={styles.attachmentLineText}>{t('message.queue.attachmentCount', { n: queuedThumbs.fileCount })}</Text>
</View>
) : null}
{editing ? (
<Text style={styles.editingHint} testID={`queue.inline.editingHint.${originalIndex + 1}`}>
- 正在下方输入框编辑…
+ {t('message.queue.editingInComposer')}
</Text>
) : null}
</Pressable>
@@ -358,7 +361,7 @@ export function InlineQueueSection({
disabled={presentation.actions.remove.disabled}
disabledReason={presentation.actions.remove.disabledReason}
icon={Trash2}
- label="取消"
+ label={t('message.queue.cancel')}
onPress={() => onRemove(item.clientId)}
testID={`queue.inline.remove.${originalIndex + 1}`}
/>
@@ -367,7 +370,7 @@ export function InlineQueueSection({
disabled={presentation.actions.edit.disabled}
disabledReason={presentation.actions.edit.disabledReason}
icon={Pencil}
- label="编辑"
+ label={t('message.queue.edit')}
onPress={() => onBeginEdit(item)}
testID={`queue.inline.edit.${originalIndex + 1}`}
/>
@@ -377,7 +380,7 @@ export function InlineQueueSection({
disabled={presentation.actions.steer.disabled}
disabledReason={presentation.actions.steer.disabledReason}
icon={ArrowUp}
- label="插话"
+ label={t('message.queue.steer')}
onPress={() => onSteer(item)}
testID={`queue.inline.steer.${originalIndex + 1}`}
/>
@@ -389,13 +392,13 @@ export function InlineQueueSection({
{hiddenRowCount > 0 || (expanded && visibleQueue.length > COLLAPSED_VISIBLE_ROWS) ? (
<View style={styles.toggleRow}>
<QueueTouchButton
- accessibilityLabel={expanded ? '收起排队消息' : `展开剩余 ${hiddenRowCount} 条排队消息`}
+ accessibilityLabel={expanded ? t('message.queue.collapseQueued') : t('message.queue.expandRemainingQueued', { n: hiddenRowCount })}
onPress={() => setExpanded(!expanded)}
style={styles.togglePill}
testID="queue.inline.toggle"
>
<Text style={styles.togglePillText}>
- {expanded ? '收起' : `展开剩余 ${hiddenRowCount} 条`}
+ {expanded ? t('message.queue.collapse') : t('message.queue.expandRemaining', { n: hiddenRowCount })}
</Text>
</QueueTouchButton>
</View>
@@ -418,8 +421,8 @@ export function InlineQueueSection({
</View>
<Pressable
accessibilityLabel={item.failed
- ? `发送失败的消息:${visibleText || '附件消息'}`
- : `发送中的消息:${visibleText || '附件消息'}`}
+ ? t('message.queue.sendFailedMessage', { text: visibleText || t('message.queue.attachmentMessage') })
+ : t('message.queue.sendingMessage', { text: visibleText || t('message.queue.attachmentMessage') })}
accessibilityRole="button"
accessibilityState={{ expanded: selected }}
onPress={() => onSelect(selected ? null : item.clientId)}
@@ -439,8 +442,8 @@ export function InlineQueueSection({
<Paperclip color={colors.textTertiary} size={iconSize.xs} strokeWidth={iconStroke.regular} />
<Text style={styles.attachmentLineText}>
{uploadsPending
- ? `附件上传中 ${item.uploadedCount}/${item.attachmentCount}`
- : `${item.fileCount} 个附件`}
+ ? t('message.queue.uploadingAttachments', { uploaded: item.uploadedCount, total: item.attachmentCount })
+ : t('message.queue.attachmentCount', { n: item.fileCount })}
</Text>
</View>
) : null}
@@ -456,7 +459,7 @@ export function InlineQueueSection({
<ActionPill
busy={busy}
icon={Trash2}
- label="删除"
+ label={t('message.queue.delete')}
onPress={() => onRemoveOutboxItem?.(item.clientId)}
testID={`queue.inline.outboxRemove.${outboxIndex + 1}`}
/>
@@ -465,7 +468,7 @@ export function InlineQueueSection({
busy={busy}
cta
icon={RotateCcw}
- label="重试"
+ label={t('message.queue.retry')}
onPress={() => onRetryOutboxItem?.(item.clientId)}
testID={`queue.inline.outboxRetry.${outboxIndex + 1}`}
/>
diff --git a/apps/mobile/src/session/InteractionPanel.tsx b/apps/mobile/src/session/InteractionPanel.tsx
index a00677d140..4733d61d81 100644
--- a/apps/mobile/src/session/InteractionPanel.tsx
+++ b/apps/mobile/src/session/InteractionPanel.tsx
@@ -1,4 +1,5 @@
import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react';
+import { useTranslation } from 'react-i18next';
import {
Check,
CornerDownLeft,
@@ -97,6 +98,7 @@ export function InteractionPanel({
onError(message: string | null): void;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
const sortedInteractions = useMemo(
() => sortPendingInteractions(interactions),
[interactions],
@@ -161,8 +163,8 @@ export function InteractionPanel({
touchLayout={touchLayout}
/>
<View style={[styles.card, cardLayoutStyle]} testID="interaction.readOnlyCard">
- <Text style={styles.kind}>待确认</Text>
- <Text style={styles.cardTitle}>电脑端正在等待确认</Text>
+ <Text style={styles.kind}>{t('interaction.panel.readOnlyKind')}</Text>
+ <Text style={styles.cardTitle}>{t('interaction.panel.readOnlyTitle')}</Text>
<Text style={styles.body}>{readOnlyReason}</Text>
</View>
</View>
@@ -237,6 +239,7 @@ function PendingTaskHeader({
touchLayout: InteractionTouchLayout;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
const activeIndex = Math.max(0, presentation.items.findIndex((item) => item.active));
const nextItem = presentation.items.length > 1
? presentation.items[(activeIndex + 1) % presentation.items.length]
@@ -253,12 +256,12 @@ function PendingTaskHeader({
]}
>
<View style={styles.taskHeaderText}>
- <Text style={styles.taskEyebrow}>待处理请求</Text>
+ <Text style={styles.taskEyebrow}>{t('interaction.panel.pendingRequests')}</Text>
<Text numberOfLines={1} style={styles.taskTitle}>{presentation.title}</Text>
</View>
{presentation.totalCount > 1 ? (
<InteractionTouchButton
- accessibilityLabel={nextItem ? `切换到${nextItem.positionLabel}待处理请求: ${nextItem.label}` : '切换待处理请求'}
+ accessibilityLabel={nextItem ? t('interaction.panel.queueSwitchTo', { position: nextItem.positionLabel, label: nextItem.label }) : t('interaction.panel.queueSwitchGeneric')}
disabled={!nextItem?.requestId}
onPress={() => onSelectRequest(nextItem?.requestId ?? null)}
style={[styles.taskCountPill, { minHeight: touchLayout.taskCountPillMinHeight }]}
@@ -291,6 +294,7 @@ function InteractionItem({
onError(message: string | null): void;
touchLayout: InteractionTouchLayout;
}) {
+ const { t } = useTranslation();
const maker = useMobileMakerTransport(deviceId);
const [busy, setBusy] = useState(false);
const submittingRequestIdRef = useRef<string | null>(null);
@@ -334,7 +338,7 @@ function InteractionItem({
return (
<UnsupportedCard
kind={kind}
- message="这个远程交互缺少 requestId,无法回传决定。"
+ message={t('interaction.panel.missingRequestId')}
request={item.request}
touchLayout={touchLayout}
/>
@@ -377,7 +381,7 @@ function InteractionItem({
return (
<UnsupportedCard
kind={kind}
- message="Issue 提交确认只在电脑端处理。请回到桌面端确认或取消提交。"
+ message={t('interaction.panel.issueConfirmUnsupported')}
request={item.request}
touchLayout={touchLayout}
/>
@@ -386,7 +390,7 @@ function InteractionItem({
return (
<UnsupportedCard
kind={kind}
- message="手机版暂不支持这个远程交互类型。"
+ message={t('interaction.panel.unsupportedType')}
request={item.request}
touchLayout={touchLayout}
/>
@@ -405,6 +409,7 @@ function PermissionCard({
touchLayout: InteractionTouchLayout;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
const presentation = useMemo(() => buildPermissionReviewPresentation(item.request), [item.request]);
const suggestions = sessionScopedPermissionSuggestions(item.request.suggestions);
const requestId = readRequestId(item);
@@ -424,7 +429,7 @@ function PermissionCard({
return (
<View style={cardStyle(styles, touchLayout)} testID="interaction.permission.card">
<View style={styles.compactCardHeader}>
- <Text style={styles.kind}>权限确认</Text>
+ <Text style={styles.kind}>{t('interaction.permission.kind')}</Text>
<Text numberOfLines={1} style={styles.compactCardTitle}>{permissionState.title}</Text>
</View>
<PermissionEvidence
@@ -435,9 +440,9 @@ function PermissionCard({
/>
<View style={actionsStyle(styles, touchLayout)}>
<ResolveButton
- accessibilityLabel="拒绝权限请求"
+ accessibilityLabel={t('interaction.permission.denyAccessibility')}
busy={busy}
- label="拒绝"
+ label={t('interaction.permission.deny')}
onPress={() => onDecision(buildPermissionDecision('deny', { reason: 'User denied' }))}
requestId={requestId}
touchStyle={resolveButtonLayoutStyle(touchLayout, 'secondary')}
@@ -446,11 +451,11 @@ function PermissionCard({
/>
{permissionState.canShowAlwaysAllow ? (
<ResolveButton
- accessibilityLabel="本会话总是允许权限请求"
+ accessibilityLabel={t('interaction.permission.alwaysAllowAccessibility')}
armed={armedDecision === 'always-allow'}
busy={busy}
- confirmLabel="确认本会话允许"
- label="本会话总是允许"
+ confirmLabel={t('interaction.permission.alwaysAllowConfirm')}
+ label={t('interaction.permission.alwaysAllow')}
onPress={() => requestDecision(
'always-allow',
buildPermissionDecision('allow', { permissionUpdates: suggestions }),
@@ -462,11 +467,11 @@ function PermissionCard({
/>
) : null}
<ResolveButton
- accessibilityLabel="允许一次权限请求"
+ accessibilityLabel={t('interaction.permission.allowOnceAccessibility')}
armed={armedDecision === 'allow-once'}
busy={busy}
- confirmLabel="确认允许一次"
- label="允许一次"
+ confirmLabel={t('interaction.permission.allowOnceConfirm')}
+ label={t('interaction.permission.allowOnce')}
onPress={() => requestDecision('allow-once', buildPermissionDecision('allow'))}
requestId={requestId}
touchStyle={resolveButtonLayoutStyle(touchLayout, 'primary')}
@@ -490,6 +495,7 @@ function PermissionEvidence({
touchLayout: InteractionTouchLayout;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
return (
<View
style={[
@@ -518,7 +524,7 @@ function PermissionEvidence({
style={[styles.permissionRiskRow, armed && styles.permissionRiskRowArmed]}
testID="interaction.permission.riskWarning"
>
- <Text style={styles.permissionRiskLabel}>高风险</Text>
+ <Text style={styles.permissionRiskLabel}>{t('interaction.permission.highRisk')}</Text>
<Text style={styles.permissionRiskText}>{riskWarningText}</Text>
</View>
) : null}
@@ -542,6 +548,7 @@ function AskUserQuestionCard({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const requestId = readRequestId(item) ?? '';
const questions = useMemo(() => normalizeAskQuestions(item.request.questions), [item.request.questions]);
const draftCompletedRef = useRef(false);
@@ -596,14 +603,14 @@ function AskUserQuestionCard({
if (questions.length === 0) {
return (
<View style={cardStyle(styles, touchLayout)} testID="interaction.ask.card">
- <Text style={styles.kind}>等待回答</Text>
+ <Text style={styles.kind}>{t('interaction.panel.awaitingAnswer')}</Text>
<Text style={styles.askQuestion} testID="interaction.ask.question">{presentation.title}</Text>
<Text style={styles.askMetaCaption}>{presentation.summary.detail}</Text>
<View style={actionsStyle(styles, touchLayout)}>
<ResolveButton
- accessibilityLabel="继续远程提问"
+ accessibilityLabel={t('interaction.panel.continueAccessibility')}
busy={busy}
- label="继续"
+ label={t('interaction.panel.continue')}
onPress={() => {
draftCompletedRef.current = true;
clearAskUserDraft(requestId);
@@ -630,8 +637,13 @@ function AskUserQuestionCard({
const canSubmitMulti = selectedLabels.size > 0 || trimmedCustomInput.length > 0;
const singleAnswer = customModeActive ? trimmedCustomInput : existingAnswer;
const canSubmitSingle = !isMulti && (singleAnswer ?? '').trim().length > 0;
- const optionsCaption = options.length > 0 ? `${options.length} 个选项` : '自由输入';
- const metaCaption = `${optionsCaption} · ${isMulti ? '多选' : '单选'} · 支持其他回答`;
+ const optionsCaption = options.length > 0
+ ? t('interaction.panel.askOptionCount', { count: options.length })
+ : t('interaction.panel.askFreeInput');
+ const metaCaption = t('interaction.panel.askMetaCaption', {
+ options: optionsCaption,
+ mode: isMulti ? t('interaction.panel.askModeMulti') : t('interaction.panel.askModeSingle'),
+ });
const advance = (answer: string) => {
const nextAnswers = { ...answers, [currentAnswerKey]: answer };
@@ -682,13 +694,13 @@ function AskUserQuestionCard({
if (collapsed) {
return (
<InteractionTouchButton
- accessibilityLabel="展开问题卡片"
+ accessibilityLabel={t('interaction.panel.expandQuestionCard')}
onPress={() => setCollapsed(false)}
style={[cardStyle(styles, touchLayout), styles.collapsedInteractionBar]}
testID="interaction.ask.collapsedCard"
>
<View style={styles.collapsedInteractionText}>
- <Text style={styles.collapsedInteractionLabel}>等待回答</Text>
+ <Text style={styles.collapsedInteractionLabel}>{t('interaction.panel.awaitingAnswer')}</Text>
<Text numberOfLines={1} style={styles.collapsedInteractionTitle}>{presentation.title}</Text>
</View>
<View style={styles.compactHeaderActions}>
@@ -708,11 +720,11 @@ function AskUserQuestionCard({
return (
<View style={cardStyle(styles, touchLayout)} testID="interaction.ask.card">
<View style={styles.compactCardHeader}>
- <Text style={styles.askHeaderKind}>等待回答</Text>
+ <Text style={styles.askHeaderKind}>{t('interaction.panel.awaitingAnswer')}</Text>
<View style={styles.compactHeaderActions}>
<Text style={styles.pageText}>{presentation.pageLabel}</Text>
<InteractionTouchButton
- accessibilityLabel="收起问题卡片"
+ accessibilityLabel={t('interaction.panel.collapseQuestionCard')}
busy={busy}
onPress={() => setCollapsed(true)}
style={styles.iconControl}
@@ -733,8 +745,8 @@ function AskUserQuestionCard({
: existingAnswer === option.label;
return (
<InteractionTouchButton
- accessibilityLabel={`选择回答 ${option.label}`}
- accessibilityHint={busy ? '正在把决定回传到电脑端,请不要重复提交。' : undefined}
+ accessibilityLabel={t('interaction.panel.selectAnswer', { label: option.label })}
+ accessibilityHint={busy ? t('interaction.panel.submittingHint') : undefined}
disabled={busy}
key={option.label}
onPress={() => toggleLabel(option.label)}
@@ -781,10 +793,10 @@ function AskUserQuestionCard({
touchLayout.stackInlineInputRows && styles.customInputRowStacked,
]}>
<TextInput
- accessibilityLabel="输入自定义回答"
+ accessibilityLabel={t('interaction.panel.customAnswerInputAccessibility')}
autoFocus
onChangeText={setCustomInput}
- placeholder="输入其他回答"
+ placeholder={t('interaction.panel.customAnswerPlaceholder')}
placeholderTextColor={colors.textTertiary}
style={styles.inlineInput}
testID="interaction.ask.customInput"
@@ -793,7 +805,7 @@ function AskUserQuestionCard({
</View>
) : (
<InteractionTouchButton
- accessibilityLabel="输入其他回答"
+ accessibilityLabel={t('interaction.panel.customAnswerPlaceholder')}
disabled={busy}
onPress={() => {
if (!isMulti) {
@@ -813,7 +825,7 @@ function AskUserQuestionCard({
]}
testID="interaction.ask.showCustomButton"
>
- <Text style={styles.optionCustom}>输入其他回答...</Text>
+ <Text style={styles.optionCustom}>{t('interaction.panel.customAnswerButtonText')}</Text>
</InteractionTouchButton>
)}
</View>
@@ -824,10 +836,10 @@ function AskUserQuestionCard({
touchLayout.stackInlineInputRows && styles.customInputRowStacked,
]}>
<TextInput
- accessibilityLabel="输入回答"
+ accessibilityLabel={t('interaction.panel.answerInput')}
autoFocus
onChangeText={setCustomInput}
- placeholder="输入回答"
+ placeholder={t('interaction.panel.answerInput')}
placeholderTextColor={colors.textTertiary}
style={styles.inlineInput}
testID="interaction.ask.textInput"
@@ -839,7 +851,7 @@ function AskUserQuestionCard({
<View style={actionsStyle(styles, touchLayout)}>
{currentIndex > 0 ? (
<InteractionTouchButton
- accessibilityLabel="上一步"
+ accessibilityLabel={t('interaction.panel.previous')}
disabled={busy}
onPress={() => setCurrentIndex((idx) => Math.max(0, idx - 1))}
style={[
@@ -848,13 +860,13 @@ function AskUserQuestionCard({
]}
testID="interaction.ask.previousButton"
>
- <Text style={styles.secondaryText}>上一步</Text>
+ <Text style={styles.secondaryText}>{t('interaction.panel.previous')}</Text>
</InteractionTouchButton>
) : null}
<ResolveButton
- accessibilityLabel="跳过问题"
+ accessibilityLabel={t('interaction.panel.skipAccessibility')}
busy={busy}
- label="跳过"
+ label={t('interaction.panel.skip')}
onPress={() => advance('')}
requestId={requestId}
touchStyle={resolveButtonLayoutStyle(touchLayout, 'secondary')}
@@ -863,10 +875,10 @@ function AskUserQuestionCard({
/>
{isMulti ? (
<ResolveButton
- accessibilityLabel={isLast ? '提交回答' : '下一步'}
+ accessibilityLabel={isLast ? t('interaction.panel.submitAnswerAccessibility') : t('interaction.panel.next')}
busy={busy}
- invalidReason={!canSubmitMulti ? '选择或输入回答后才能继续。' : null}
- label={isLast ? '提交' : '下一步'}
+ invalidReason={!canSubmitMulti ? t('interaction.panel.answerRequired') : null}
+ label={isLast ? t('interaction.panel.submit') : t('interaction.panel.next')}
onPress={submitMulti}
requestId={requestId}
touchStyle={resolveButtonLayoutStyle(touchLayout, 'primary')}
@@ -875,10 +887,10 @@ function AskUserQuestionCard({
/>
) : (
<ResolveButton
- accessibilityLabel={isLast ? '提交回答' : '下一步'}
+ accessibilityLabel={isLast ? t('interaction.panel.submitAnswerAccessibility') : t('interaction.panel.next')}
busy={busy}
- invalidReason={!canSubmitSingle ? '选择或输入回答后才能继续。' : null}
- label={isLast ? '提交' : '下一步'}
+ invalidReason={!canSubmitSingle ? t('interaction.panel.answerRequired') : null}
+ label={isLast ? t('interaction.panel.submit') : t('interaction.panel.next')}
onPress={submitSingle}
requestId={requestId}
touchStyle={resolveButtonLayoutStyle(touchLayout, 'primary')}
@@ -908,6 +920,7 @@ function PlanReviewCard({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const requestId = readRequestId(item) ?? '';
const [planText, setPlanText] = useState(() =>
readPlanReviewDraft(requestId)?.planText ?? planReviewPlan(item.request)
@@ -1003,13 +1016,13 @@ function PlanReviewCard({
>
{isMinimized ? (
<InteractionTouchButton
- accessibilityLabel="展开计划"
+ accessibilityLabel={t('interaction.panel.planExpand')}
disabled={resolveBusy}
onPress={() => updateViewerState(lastExpandedState)}
style={styles.planMinimizedBar}
testID="interaction.plan.expandButton"
>
- <Text numberOfLines={1} style={styles.planMinimizedTitle}>审阅 Claude 的计划</Text>
+ <Text numberOfLines={1} style={styles.planMinimizedTitle}>{t('interaction.panel.planReviewTitle')}</Text>
<View style={styles.iconControl}>
<Plus color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />
</View>
@@ -1018,14 +1031,14 @@ function PlanReviewCard({
<>
<View style={styles.planViewerHeader}>
<View style={styles.planViewerTitleWrap}>
- <Text numberOfLines={1} style={styles.planViewerTitle}>审阅 Claude 的计划</Text>
+ <Text numberOfLines={1} style={styles.planViewerTitle}>{t('interaction.panel.planReviewTitle')}</Text>
<Text numberOfLines={1} style={styles.planViewerHint}>
- {isEdit ? '使用编辑模式调整计划' : '选中章节即可跳转浏览'}
+ {isEdit ? t('interaction.panel.planEditHint') : t('interaction.panel.planBrowseHint')}
</Text>
</View>
<View style={styles.planToolbar}>
<InteractionTouchButton
- accessibilityLabel={isEdit ? '退出计划编辑' : '编辑计划'}
+ accessibilityLabel={isEdit ? t('interaction.panel.planEditExit') : t('interaction.panel.planEditToggle')}
disabled={resolveBusy}
onPress={() => updateViewerState(isEdit ? 'expanded' : 'edit')}
selected={isEdit}
@@ -1035,7 +1048,7 @@ function PlanReviewCard({
<Pencil color={colors.textSecondary} size={iconSize.sm} strokeWidth={iconStroke.regular} />
</InteractionTouchButton>
<InteractionTouchButton
- accessibilityLabel="收起计划"
+ accessibilityLabel={t('interaction.panel.planCollapse')}
disabled={resolveBusy}
onPress={() => updateViewerState('minimized')}
style={styles.planToolbarButton}
@@ -1044,7 +1057,7 @@ function PlanReviewCard({
<Minus color={colors.textSecondary} size={iconSize.sm} strokeWidth={iconStroke.regular} />
</InteractionTouchButton>
<InteractionTouchButton
- accessibilityLabel={viewerState === 'half' ? '展开计划浏览区' : '切换到半屏计划'}
+ accessibilityLabel={viewerState === 'half' ? t('interaction.panel.planExpandArea') : t('interaction.panel.planHalf')}
disabled={resolveBusy}
onPress={() => updateViewerState(viewerState === 'half' ? 'expanded' : 'half')}
selected={expandedPlan}
@@ -1072,10 +1085,10 @@ function PlanReviewCard({
>
{isEdit ? (
<TextInput
- accessibilityLabel="计划编辑器"
+ accessibilityLabel={t('interaction.panel.planEditorAccessibility')}
multiline
onChangeText={setPlanText}
- placeholder="编辑计划"
+ placeholder={t('interaction.panel.planEditorPlaceholder')}
placeholderTextColor={colors.textTertiary}
style={[
styles.planEditor,
@@ -1097,12 +1110,12 @@ function PlanReviewCard({
testID="interaction.plan.outline"
>
<View style={styles.planOutlineRow}>
- <Text style={styles.planOutlineLabel}>目录</Text>
+ <Text style={styles.planOutlineLabel}>{t('interaction.panel.planOutline')}</Text>
{evidence.outlineItems.map((entry) => {
const active = entry.id === activeOutlineId;
return (
<InteractionTouchButton
- accessibilityLabel={`跳到计划章节 ${entry.title}`}
+ accessibilityLabel={t('interaction.panel.planJumpTo', { title: entry.title })}
key={entry.id}
onPress={() => jumpToOutline(entry)}
selected={active}
@@ -1144,7 +1157,7 @@ function PlanReviewCard({
nestedScrollEnabled
testID="interaction.plan.preview"
>
- <Text selectable style={styles.planText}>{planText || '计划内容为空。'}</Text>
+ <Text selectable style={styles.planText}>{planText || t('interaction.panel.planEmpty')}</Text>
</ScrollView>
</>
)}
@@ -1163,7 +1176,7 @@ function PlanReviewCard({
testID="interaction.plan.actionCard"
>
<InteractionTouchButton
- accessibilityLabel="批准执行计划"
+ accessibilityLabel={t('interaction.panel.planApproveAccessibility')}
busy={resolveBusy}
disabled={resolveBusy}
onPress={approvePlan}
@@ -1173,7 +1186,7 @@ function PlanReviewCard({
<View style={styles.planApproveIcon}>
<Check color={colors.ctaText} size={iconSize.sm} strokeWidth={iconStroke.bold} />
</View>
- <Text numberOfLines={1} style={styles.planApproveText}>批准 Claude 的计划并开始编码</Text>
+ <Text numberOfLines={1} style={styles.planApproveText}>{t('interaction.panel.planApprove')}</Text>
<CornerDownLeft color={colors.textTertiary} size={iconSize.md} strokeWidth={iconStroke.regular} />
</InteractionTouchButton>
@@ -1181,18 +1194,18 @@ function PlanReviewCard({
<View style={styles.planFeedbackEditorRow}>
<Pencil color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />
<TextInput
- accessibilityLabel="计划反馈"
+ accessibilityLabel={t('interaction.panel.planFeedbackLabel')}
multiline
onChangeText={setFeedback}
- placeholder="告诉 Claude 应该怎么做"
+ placeholder={t('interaction.panel.planFeedbackPlaceholder')}
placeholderTextColor={colors.textTertiary}
style={styles.planFeedbackInput}
testID="interaction.plan.feedbackInput"
value={feedback}
/>
<InteractionTouchButton
- accessibilityHint={feedback.trim().length === 0 ? '输入反馈后才能提交。' : undefined}
- accessibilityLabel="提交计划反馈"
+ accessibilityHint={feedback.trim().length === 0 ? t('interaction.panel.planFeedbackRequired') : undefined}
+ accessibilityLabel={t('interaction.panel.planFeedbackSubmit')}
busy={resolveBusy}
disabled={feedback.trim().length === 0 || resolveBusy}
onPress={denyWithFeedback}
@@ -1208,7 +1221,7 @@ function PlanReviewCard({
</View>
) : (
<InteractionTouchButton
- accessibilityLabel="反馈修改计划"
+ accessibilityLabel={t('interaction.panel.planFeedbackAccessibility')}
busy={resolveBusy}
disabled={resolveBusy}
onPress={() => setFeedbackOpen(true)}
@@ -1216,7 +1229,7 @@ function PlanReviewCard({
testID="interaction.plan.feedbackButton"
>
<Pencil color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />
- <Text numberOfLines={1} style={styles.planFeedbackPlaceholder}>告诉 Claude 应该怎么做</Text>
+ <Text numberOfLines={1} style={styles.planFeedbackPlaceholder}>{t('interaction.panel.planFeedbackPlaceholder')}</Text>
</InteractionTouchButton>
)}
</View>
@@ -1236,9 +1249,10 @@ function UnsupportedCard({
touchLayout: InteractionTouchLayout;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
return (
<View style={cardStyle(styles, touchLayout)} testID="interaction.unsupported.card">
- <Text style={styles.kind}>暂不支持</Text>
+ <Text style={styles.kind}>{t('interaction.panel.unsupportedKind')}</Text>
<Text style={styles.cardTitle}>{message}</Text>
<Text style={styles.body} numberOfLines={6}>{contentToPreview(request)}</Text>
</View>
diff --git a/apps/mobile/src/session/MarkdownFileReader.tsx b/apps/mobile/src/session/MarkdownFileReader.tsx
index 86fd29fb16..a4807418a5 100644
--- a/apps/mobile/src/session/MarkdownFileReader.tsx
+++ b/apps/mobile/src/session/MarkdownFileReader.tsx
@@ -14,17 +14,16 @@
* 浮动按钮——真机实测浮层与系统选择菜单撞位。
*/
import { useCallback, useMemo, useRef } from 'react';
+import { useTranslation } from 'react-i18next';
import { Linking, StyleSheet, View } from 'react-native';
import { WebView } from 'react-native-webview';
import type { ShouldStartLoadRequest } from 'react-native-webview/lib/WebViewTypes';
import { buildSelectableMarkdownHtml } from '@/session/selectableMarkdownHtml';
-import { SELECTION_QUOTE_MENU_LABEL } from '@/session/selectionQuote';
+import { selectionQuoteMenuLabel } from '@/session/selectionQuote';
import { lineHeight, useTheme } from '@/theme';
import { typeScale } from '@/theme/tokens';
-const QUOTE_MENU_ITEMS = [{ key: 'xdtQuote', label: SELECTION_QUOTE_MENU_LABEL }];
-
export function MarkdownFileReader({
markdown,
onQuoteSelection,
@@ -38,8 +37,14 @@ export function MarkdownFileReader({
targetLine?: number | null;
testID?: string;
}) {
+ const { t } = useTranslation();
const { colors } = useTheme();
const quoteEnabled = !!onQuoteSelection;
+ // 菜单项在渲染时构造(而非模块常量):label 走 i18n;依赖 t 使语言切换后随重渲更新。
+ const quoteMenuItems = useMemo(
+ () => [{ key: 'xdtQuote', label: selectionQuoteMenuLabel() }],
+ [t],
+ );
const html = useMemo(() => buildSelectableMarkdownHtml(markdown, {
borderColor: colors.border,
chipColor: colors.surfaceChip,
@@ -65,7 +70,7 @@ export function MarkdownFileReader({
return (
<View style={styles.fill} testID={testID}>
<WebView
- menuItems={quoteEnabled ? QUOTE_MENU_ITEMS : undefined}
+ menuItems={quoteEnabled ? quoteMenuItems : undefined}
onCustomMenuSelection={quoteEnabled ? handleCustomMenuSelection : undefined}
onShouldStartLoadWithRequest={interceptNavigation}
originWhitelist={['about:blank']}
diff --git a/apps/mobile/src/session/MessageRenderer.tsx b/apps/mobile/src/session/MessageRenderer.tsx
index eb7fa15b05..8f1fae4eec 100644
--- a/apps/mobile/src/session/MessageRenderer.tsx
+++ b/apps/mobile/src/session/MessageRenderer.tsx
@@ -1,4 +1,5 @@
import { memo, useCallback, useContext, useEffect, useMemo, useRef, useState, type ComponentProps, type ReactNode } from 'react';
+import { useTranslation } from 'react-i18next';
import {
ArrowLeftRight,
ArrowUp,
@@ -81,7 +82,7 @@ import {
type SentInlineToken,
} from '@/session/sentMessageAtoms';
import {
- SELECTION_QUOTE_MENU_LABEL,
+ selectionQuoteMenuLabel,
SelectionQuoteContext,
handleSelectionQuoteMenuAction,
} from '@/session/selectionQuote';
@@ -295,6 +296,7 @@ import { latexToUnicodeApproximation } from '@cindy/maker-shared/math-markdown';
import type { RemoteTextFilePreviewResult } from '@/device-link/mobileMakerTransport';
import { fontWeight, lineHeight, radius, spacing, typeScale } from '@/theme/tokens';
import { iconSize, iconStroke, monoFont, useTheme, useThemedStyles, type ThemeColors } from '@/theme';
+import { i18n } from '@/i18n';
const MESSAGE_CONTROL_HIT_SLOP = { bottom: 10, left: 10, right: 10, top: 10 };
// LegendList 变高 item 的初始估高(仅影响首帧布局定位,LegendList 挂载后按实测尺寸修正)。
@@ -383,7 +385,7 @@ function MarkdownSelectableText({
// menuActionLabel / onMenuAction 是 uitextview patch 的扩展 prop,不在
// RN Text props 里,组件内部私有附加(经 {...rest} 透传到原生组件)。
{...{
- menuActionLabel: SELECTION_QUOTE_MENU_LABEL,
+ menuActionLabel: selectionQuoteMenuLabel(),
onMenuAction: (event: { nativeEvent: { target: number; start: number; end: number } }) => {
handleSelectionQuoteMenuAction(event, renderedLinesRef.current, quoteCtx);
},
@@ -504,6 +506,7 @@ export function MessageRenderer({
}) => void;
} & MessageActions) {
const { colors } = useTheme();
+ const { t } = useTranslation();
const styles = useThemedStyles(makeStyles);
const firstUserMessageClientId = findFirstUserMessageClientId(items);
const focusedItemKeyRef = useRef(focusedItemKey);
@@ -1170,7 +1173,7 @@ export function MessageRenderer({
/>
{previousUserTarget && previousUserButtonTop !== null ? (
<MessageListActionButton
- accessibilityLabel={`跳到上一条提问:${previousUserTarget.preview || '无预览'}`}
+ accessibilityLabel={t('message.renderer.previousQuestionJump', { preview: previousUserTarget.preview || t('message.renderer.noPreview') })}
onPress={jumpToPreviousUserMessage}
style={[styles.previousUserButton, { top: previousUserButtonTop }]}
testID="message.previousUserButton"
@@ -1182,7 +1185,7 @@ export function MessageRenderer({
// 跳到底部浮标(Telegram 风):右下角半透明圆形 chevron,弱存在感;
// 有未读新消息时不换样式,只在圆标右上角加一颗 CTA 色小圆点提示。
<MessageListActionButton
- accessibilityLabel={hasNewMessages ? '有新消息,跳到底部' : '跳到底部'}
+ accessibilityLabel={hasNewMessages ? t('message.renderer.newMessagesToBottom') : t('message.renderer.jumpToBottom')}
onPress={scrollToBottom}
style={[styles.scrollToBottomFab, { bottom: floatingBottomOffset, right: scrollToBottomFabRight }]}
testID={hasNewMessages ? 'message.newMessageButton' : 'message.jumpToLatestButton'}
@@ -1310,18 +1313,19 @@ const RenderItemView = memo(function RenderItemView({
function ForkOriginMarker({ onOpenForkOrigin }: { onOpenForkOrigin?: () => void }) {
const { colors } = useTheme();
+ const { t } = useTranslation();
const styles = useThemedStyles(makeStyles);
return (
<View style={styles.forkOriginRow} testID="message.forkOrigin">
<View style={styles.forkOriginLine} />
<MessageListActionButton
- accessibilityLabel="打开分叉来源消息"
+ accessibilityLabel={t('message.renderer.openForkOrigin')}
onPress={onOpenForkOrigin}
style={styles.forkOriginButton}
testID="message.forkOriginButton"
>
<Split color={colors.textSecondary} size={iconSize.md} strokeWidth={iconStroke.regular} />
- <Text style={styles.forkOriginText}>查看分叉来源</Text>
+ <Text style={styles.forkOriginText}>{t('message.renderer.viewForkOrigin')}</Text>
</MessageListActionButton>
<View style={styles.forkOriginLine} />
</View>
@@ -1330,9 +1334,10 @@ function ForkOriginMarker({ onOpenForkOrigin }: { onOpenForkOrigin?: () => void
function EmptyMessages({ testID }: { testID?: string }) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
return (
<View style={styles.emptyCard} testID={testID ?? 'message.empty'}>
- <Text style={styles.emptyTitle}>暂无消息</Text>
+ <Text style={styles.emptyTitle}>{t('message.renderer.emptyMessages')}</Text>
</View>
);
}
@@ -1346,6 +1351,7 @@ const SYNCING_PLACEHOLDER_DELAY_MS = 200;
function SyncingMessages() {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const [visible, setVisible] = useState(false);
useEffect(() => {
const timer = setTimeout(() => setVisible(true), SYNCING_PLACEHOLDER_DELAY_MS);
@@ -1355,7 +1361,7 @@ function SyncingMessages() {
return (
<View style={styles.emptyCard} testID="message.syncing">
<ActivityIndicator color={colors.textTertiary} size="small" />
- <Text style={styles.syncingTitle}>正在同步</Text>
+ <Text style={styles.syncingTitle}>{t('message.renderer.syncing')}</Text>
</View>
);
}
@@ -1438,6 +1444,7 @@ function MessageBubble({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const [copyState, setCopyState] = useState<CopyMessageStatus | 'idle' | 'copying'>('idle');
const [actionSheetOpen, setActionSheetOpen] = useState(false);
// chat-text-quote:只解析持久化 quotesEncoded 明确标记的产品引用消息,避免
@@ -1691,7 +1698,7 @@ function MessageBubble({
// 时间只展示发送时间;消息锚点复制移入语义明确的 More 菜单。
const timeText = relativeTime ? (
<Text
- accessibilityLabel={absoluteTime ? `发送时间 ${absoluteTime}` : undefined}
+ accessibilityLabel={absoluteTime ? t('message.renderer.sentTime', { time: absoluteTime }) : undefined}
key="time"
style={styles.messageActionMeta}
testID="message.timeText"
@@ -1701,7 +1708,7 @@ function MessageBubble({
) : null;
const costText = turnCost ? (
<Text
- accessibilityLabel={item.message.turnCostIsEstimate ? `本轮${turnCost}` : `本轮消耗 ${turnCost}`}
+ accessibilityLabel={item.message.turnCostIsEstimate ? t('message.renderer.turnCostEstimate', { cost: turnCost }) : t('message.renderer.turnCost', { cost: turnCost })}
key="cost"
style={styles.messageActionMeta}
testID="message.turnCostText"
@@ -1711,11 +1718,11 @@ function MessageBubble({
) : null;
const streamingStatus = isStreamingAssistant ? (
<StreamingStatusText
- accessibilityLabel="消息正在生成"
+ accessibilityLabel={t('message.renderer.messageGenerating')}
style={styles.streamingStatus}
testID="message.streamingStatus"
>
- 生成中
+ {t('message.renderer.generating')}
</StreamingStatusText>
) : null;
// 附件条对齐桌面版:渲染在气泡外、文字气泡上方(用户消息右对齐);
@@ -1835,14 +1842,14 @@ function MessageBubble({
// Pressable(参与触摸协商,干扰正文横向 ScrollView 手势,见
// messageSelectionDesktopFirst 契约),Text onPress 只在自身文字区响应。
<Text
- accessibilityLabel={longMessageExpanded ? '收起消息' : '展开消息'}
+ accessibilityLabel={longMessageExpanded ? t('message.renderer.collapseMessage') : t('message.renderer.expandMessage')}
accessibilityRole="button"
onPress={() => setLongMessageExpanded((expanded) => !expanded)}
style={styles.collapseToggleText}
suppressHighlighting
testID="message.collapseToggle"
>
- {longMessageExpanded ? '收起' : '展开'}
+ {longMessageExpanded ? t('message.renderer.collapse') : t('message.renderer.expand')}
</Text>
) : null}
{item.message.secondaryBody ? (
@@ -1867,8 +1874,8 @@ function MessageBubble({
<Timer color={colors.textTertiary} size={iconSize.xs} strokeWidth={iconStroke.thin} />
<Text numberOfLines={1} style={styles.automationOriginText}>
{automationOrigin.scheduleName
- ? `由自动化任务「${automationOrigin.scheduleName}」发送`
- : '由自动化任务发送'}
+ ? t('message.renderer.automationOriginNamed', { name: automationOrigin.scheduleName })
+ : t('message.renderer.automationOrigin')}
</Text>
</View>
) : null}
@@ -1880,7 +1887,10 @@ function MessageBubble({
<View style={styles.modelMismatchRow} testID="message.modelMismatch">
<TriangleAlert color={colors.statusAccent} size={iconSize.xs} strokeWidth={iconStroke.thin} />
<Text numberOfLines={2} style={styles.modelMismatchText}>
- {`本轮由 ${formatModelShortLabel(item.message.modelMismatch.actual) || item.message.modelMismatch.actual} 响应,而非所选的 ${formatModelShortLabel(item.message.modelMismatch.selected) || item.message.modelMismatch.selected}(服务端临时降级)`}
+ {t('message.renderer.modelMismatch', {
+ actual: formatModelShortLabel(item.message.modelMismatch.actual) || item.message.modelMismatch.actual,
+ selected: formatModelShortLabel(item.message.modelMismatch.selected) || item.message.modelMismatch.selected,
+ })}
</Text>
</View>
) : null}
@@ -1935,10 +1945,10 @@ function MessageBubble({
}
function copyActionLabel(state: CopyMessageStatus | 'idle' | 'copying'): string {
- if (state === 'copying') return '复制中';
- if (state === 'copied') return '已复制';
- if (state === 'failed') return '复制失败';
- return '复制';
+ if (state === 'copying') return i18n.t('message.renderer.copyStateCopying');
+ if (state === 'copied') return i18n.t('message.renderer.copyStateCopied');
+ if (state === 'failed') return i18n.t('message.renderer.copyStateFailed');
+ return i18n.t('message.renderer.copyStateCopy');
}
/**
@@ -1988,6 +1998,7 @@ function ThinkingCard({
screenWidth?: number;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
const layout = useMemo(() => buildMessageHierarchyLayout({
screenWidth,
summaryCount: 0,
@@ -2000,12 +2011,12 @@ function ThinkingCard({
&& item.message.isStreaming === true;
const elapsedMs = useLiveElapsedMs(running, item.message.createdAt);
const title = item.redacted
- ? '思考内容已隐藏'
+ ? t('message.renderer.thinkingHidden')
: item.durationMs !== undefined
- ? `思考 ${formatDuration(item.durationMs)}`
+ ? t('message.renderer.thinkingDone', { duration: formatDuration(item.durationMs) })
: elapsedMs !== null
- ? `思考中 ${formatDuration(elapsedMs)}`
- : '思考过程';
+ ? t('message.renderer.thinkingActive', { elapsed: formatDuration(elapsedMs) })
+ : t('message.renderer.thinkingProcess');
return (
<FoldablePanel
blockId={item.key}
@@ -2016,8 +2027,8 @@ function ThinkingCard({
<Rail layout={layout}>
<Text style={[styles.detailText, styles.italicText]}>
{item.redacted
- ? '模型没有返回可展示的思考内容。'
- : <ThinkingInlineText content={item.message.body || '暂无思考内容'} />}
+ ? t('message.renderer.thinkingEmpty')
+ : <ThinkingInlineText content={item.message.body || t('message.renderer.thinkingNoContent')} />}
</Text>
</Rail>
</FoldablePanel>
@@ -2102,6 +2113,7 @@ function ToolActionRow({
tool: NormalizedRemoteMessage;
}) {
const { colors } = useTheme();
+ const { t } = useTranslation();
const styles = useThemedStyles(makeStyles);
// 媒体不在行内渲染:tool 产出的图/视频由紧随 tool_group 的独立 ToolMediaBlock
// 承载(对齐桌面 AgentActionRow「媒体跳出折叠卡」的语义),行内不再重复。
@@ -2116,7 +2128,7 @@ function ToolActionRow({
return (
<View style={styles.toolRow} testID="message.toolRow">
<Pressable
- accessibilityLabel={expanded ? `收起${row.label}` : `展开${row.label}`}
+ accessibilityLabel={expanded ? t('message.renderer.collapseRow', { label: row.label }) : t('message.renderer.expandRow', { label: row.label })}
accessibilityRole="button"
accessibilityState={{ expanded }}
disabled={!hasDetails}
@@ -2326,12 +2338,19 @@ function TodoStatusIcon({
return <Circle color={colors.textTertiary} size={iconSize.lg} strokeWidth={iconStroke.thin} />;
}
-const AGENT_TASK_STATUS_LABEL: Record<AgentTaskStatus, string> = {
- running: '运行中',
- completed: '已完成',
- failed: '失败',
- stopped: '已停止',
-};
+// 在调用点求值,避免模块顶层把 i18n.t 结果冻结成常量(冻结语言)。
+function agentTaskStatusLabel(status: AgentTaskStatus): string {
+ switch (status) {
+ case 'running':
+ return i18n.t('message.renderer.statusRunning');
+ case 'completed':
+ return i18n.t('message.renderer.statusCompleted');
+ case 'failed':
+ return i18n.t('message.renderer.statusFailed');
+ case 'stopped':
+ return i18n.t('message.renderer.statusStopped');
+ }
+}
const AGENT_TASK_PROVIDER_LABEL: Record<AgentTaskCardModel['provider'], string> = {
'claude-code': 'Claude Code',
@@ -2349,9 +2368,9 @@ function AgentTaskStatusIcon({ status, size = iconSize.md }: { status: AgentTask
}
function buildAgentTaskMeta(model: AgentTaskCardModel): string[] {
- const parts: string[] = [AGENT_TASK_PROVIDER_LABEL[model.provider], AGENT_TASK_STATUS_LABEL[model.status]];
+ const parts: string[] = [AGENT_TASK_PROVIDER_LABEL[model.provider], agentTaskStatusLabel(model.status)];
if (typeof model.totalTokens === 'number') parts.push(`${model.totalTokens} tokens`);
- if (typeof model.toolUses === 'number') parts.push(`${model.toolUses} 次工具调用`);
+ if (typeof model.toolUses === 'number') parts.push(i18n.t('message.renderer.toolUseCount', { n: model.toolUses }));
if (typeof model.durationMs === 'number') parts.push(formatDuration(model.durationMs));
return parts;
}
@@ -2377,6 +2396,7 @@ function AgentTaskCard({
screenWidth?: number;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
const model = useMemo(
() => buildAgentTaskCardModel({
toolName: item.toolCall?.label,
@@ -2388,7 +2408,7 @@ function AgentTaskCard({
}),
[item.toolCall, item.update],
);
- const title = model.title ?? '子 Agent 任务';
+ const title = model.title ?? t('message.renderer.subagentTaskTitle');
const subtitle = buildAgentTaskMeta(model).join(' · ');
const layout = useMemo(
() => buildMessageHierarchyLayout({ screenWidth, summaryCount: 0 }),
@@ -2411,11 +2431,11 @@ function AgentTaskCard({
<View style={[styles.stackSmall, { gap: layout.stackSmallGap }]}>
{model.description ? <Text style={styles.detailText}>{model.description}</Text> : null}
{model.summary ? <Text style={styles.detailText}>{model.summary}</Text> : null}
- {model.lastToolName ? <Text style={styles.detailText}>{`最近工具:${model.lastToolName}`}</Text> : null}
- {model.outputFile ? <Text style={styles.detailText}>{`输出:${model.outputFile}`}</Text> : null}
+ {model.lastToolName ? <Text style={styles.detailText}>{t('message.renderer.recentTool', { name: model.lastToolName })}</Text> : null}
+ {model.outputFile ? <Text style={styles.detailText}>{t('message.renderer.outputFile', { file: model.outputFile })}</Text> : null}
</View>
) : (
- <Text style={styles.detailText}>暂无更多详情</Text>
+ <Text style={styles.detailText}>{t('message.renderer.noMoreDetail')}</Text>
)}
</FoldablePanel>
);
@@ -2429,6 +2449,7 @@ function WorkGroupCard({
actions: MessageActions & { firstUserMessageClientId?: string };
}) {
const { colors } = useTheme();
+ const { t } = useTranslation();
const styles = useThemedStyles(makeStyles);
const presentation = summarizeWorkGroupPresentation(item);
const header = presentation.header;
@@ -2459,13 +2480,13 @@ function WorkGroupCard({
const explorationSummary = activityProjection?.isPureExploration
? [
activityProjection.explorationCounts.read > 0
- ? `读取 ${activityProjection.explorationCounts.read} 个文件`
+ ? t('message.renderer.filesRead', { n: activityProjection.explorationCounts.read })
: null,
activityProjection.explorationCounts.search > 0
- ? `搜索 ${activityProjection.explorationCounts.search} 次`
+ ? t('message.renderer.searchCount', { n: activityProjection.explorationCounts.search })
: null,
activityProjection.explorationCounts.list > 0
- ? `列出 ${activityProjection.explorationCounts.list} 次`
+ ? t('message.renderer.listCount', { n: activityProjection.explorationCounts.list })
: null,
].filter((value): value is string => value !== null).join(' · ')
: '';
@@ -2593,6 +2614,7 @@ function ExpandedWorkThinkingRow({
item: MobileThinkingItem;
}) {
const { colors } = useTheme();
+ const { t } = useTranslation();
const styles = useThemedStyles(makeStyles);
const [expanded, toggleExpanded] = useFoldableExpandedState(`work-${item.key}`, false);
const [measuredLineCount, setMeasuredLineCount] = useState(1);
@@ -2600,7 +2622,7 @@ function ExpandedWorkThinkingRow({
const canExpand = rawContent.includes('\n') || measuredLineCount > 1;
return (
<Pressable
- accessibilityLabel={expanded ? '收起思考内容' : '展开思考内容'}
+ accessibilityLabel={expanded ? t('message.renderer.collapseThinking') : t('message.renderer.expandThinking')}
accessibilityRole="button"
accessibilityState={{ expanded: canExpand ? expanded : undefined }}
disabled={!canExpand}
@@ -2620,7 +2642,7 @@ function ExpandedWorkThinkingRow({
numberOfLines={expanded ? undefined : 1}
style={[styles.workActivityText, styles.italicText]}
>
- <ThinkingInlineText content={rawContent || '暂无思考内容'} />
+ <ThinkingInlineText content={rawContent || t('message.renderer.thinkingNoContent')} />
</Text>
{!expanded ? (
<View
@@ -2635,7 +2657,7 @@ function ExpandedWorkThinkingRow({
onTextLayout={(event) => setMeasuredLineCount(event.nativeEvent.lines.length)}
style={[styles.workActivityText, styles.italicText]}
>
- <ThinkingInlineText content={rawContent || '暂无思考内容'} />
+ <ThinkingInlineText content={rawContent || t('message.renderer.thinkingNoContent')} />
</Text>
</View>
) : null}
@@ -2660,13 +2682,16 @@ function SubagentCard({
actions: MessageActions & { firstUserMessageClientId?: string };
}) {
const { colors } = useTheme();
+ const { t } = useTranslation();
const styles = useThemedStyles(makeStyles);
- const title = item.header.subagentType ? `子 agent · ${item.header.subagentType}` : '子 agent';
+ const title = item.header.subagentType
+ ? t('message.renderer.subagentTyped', { type: item.header.subagentType })
+ : t('message.renderer.subagent');
const statusText = item.status === 'running'
- ? '运行中'
+ ? t('message.renderer.statusRunning')
: item.durationMs !== undefined
- ? `已工作 ${formatDuration(item.durationMs)}`
- : '已完成';
+ ? t('message.renderer.workedDuration', { duration: formatDuration(item.durationMs) })
+ : t('message.renderer.statusCompleted');
const subtitle = [item.header.description, statusText].filter(Boolean).join(' · ');
return (
<CollabCardShell
@@ -2685,7 +2710,7 @@ function SubagentCard({
))}
{item.summary ? (
<View style={styles.stackSmall}>
- <Text style={styles.foldSubtitle}>子 agent 小结</Text>
+ <Text style={styles.foldSubtitle}>{t('message.renderer.subagentSummary')}</Text>
<Text selectable style={styles.detailText} testID="message.subagentSummary">
{item.summary}
</Text>
@@ -2741,6 +2766,7 @@ function FoldablePanel({
chevronPosition?: 'leading' | 'trailing';
}) {
const { colors } = useTheme();
+ const { t } = useTranslation();
const styles = useThemedStyles(makeStyles);
const [rememberedExpanded, toggleRememberedExpanded] = useFoldableExpandedState(blockId, defaultExpanded);
const expanded = controlledExpanded ?? rememberedExpanded;
@@ -2761,7 +2787,7 @@ function FoldablePanel({
return (
<View style={variant === 'card' ? styles.foldCard : styles.foldPlain}>
<FoldableHeaderButton
- accessibilityLabel={expanded ? `收起${title}` : `展开${title}`}
+ accessibilityLabel={expanded ? t('message.renderer.collapseRow', { label: title }) : t('message.renderer.expandRow', { label: title })}
expanded={expanded}
hitSlop={variant === 'plain' ? FOLDABLE_HEADER_HIT_SLOP : undefined}
onPress={toggleExpanded}
@@ -2912,13 +2938,14 @@ const agentSwitchEngineLabel = (kind: unknown): string => (kind === 'codex' ? 'C
function MobileAgentSwitchCard({ data }: { data?: Record<string, unknown> }) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const [expanded, setExpanded] = useState(false);
const from = agentSwitchEngineLabel(data?.fromAgentKind);
const to = agentSwitchEngineLabel(data?.toAgentKind);
const toModel = typeof data?.toModel === 'string' ? data.toModel : '';
const handoff = typeof data?.handoff === 'string' ? data.handoff : '';
const resumed = data?.resumed === true;
- const label = `已从 ${from} 切换到 ${to}`;
+ const label = t('message.renderer.agentSwitchLabel', { from, to });
return (
<View style={styles.agentSwitchWrap} testID="message.systemCard.agent-switch">
@@ -2928,7 +2955,7 @@ function MobileAgentSwitchCard({ data }: { data?: Record<string, unknown> }) {
onPress={handoff ? () => setExpanded((v) => !v) : undefined}
disabled={!handoff}
accessibilityRole={handoff ? 'button' : undefined}
- accessibilityLabel={handoff ? `${label},查看交接内容` : label}
+ accessibilityLabel={handoff ? t('message.renderer.agentSwitchViewHandoff', { label }) : label}
style={styles.agentSwitchPill}
>
<ArrowLeftRight color={colors.textTertiary} size={iconSize.xs} strokeWidth={iconStroke.regular} />
@@ -2942,7 +2969,7 @@ function MobileAgentSwitchCard({ data }: { data?: Record<string, unknown> }) {
{resumed ? (
<>
<Text style={styles.agentSwitchDot}>·</Text>
- <Text style={styles.agentSwitchPillText} numberOfLines={1}>已续接原会话</Text>
+ <Text style={styles.agentSwitchPillText} numberOfLines={1}>{t('message.renderer.sessionResumedPill')}</Text>
</>
) : null}
{handoff ? (
@@ -2956,7 +2983,7 @@ function MobileAgentSwitchCard({ data }: { data?: Record<string, unknown> }) {
{expanded && handoff ? (
<View style={styles.agentSwitchHandoffPanel}>
<Text style={styles.agentSwitchHandoffTitle}>
- 交接内容——切换时发送给新引擎的上下文摘要(不会出现在你的消息里)
+ {t('message.renderer.handoffContentDesc')}
</Text>
{/* 交接全文内联展开:卡片本身在消息列表(LegendList)内,不再套内层 ScrollView——
Android 上嵌套竖向滚动会被父列表截获手势导致内层滚不动(Fabric 更甚)。
@@ -3138,6 +3165,7 @@ function MarkdownBody({
text: string;
}) {
const { colors } = useTheme();
+ const { t } = useTranslation();
const styles = useThemedStyles(makeStyles);
const chatFilePathContext = useContext(ChatFilePathContext);
const blocks = useMemo(() => parseMobileMarkdown(text), [text]);
@@ -3285,7 +3313,7 @@ function MarkdownBody({
<MermaidDiagramWebView source={block.text} testID="message.mermaidDiagram" />
{onOpenPayload ? (
<Pressable
- accessibilityLabel="打开图表详情"
+ accessibilityLabel={t('message.renderer.openDiagramDetail')}
accessibilityRole="button"
onPress={() => onOpenPayload(buildMermaidPayload(block.text))}
style={StyleSheet.absoluteFill}
@@ -3743,7 +3771,7 @@ function renderInline(
style={[ctx.baseStyle, styles.markdownLink]}
testID="message.markdownInlineImageChip"
>
- {inline.alt || '图片'}
+ {inline.alt || i18n.t('message.renderer.imageFallbackTitle')}
</SpanText>
);
}
@@ -3759,7 +3787,7 @@ function renderInline(
>
<View style={size}>
<Image
- accessibilityLabel={inline.alt || '图片'}
+ accessibilityLabel={inline.alt || i18n.t('message.renderer.imageFallbackTitle')}
resizeMode="cover"
source={{ uri: inline.url }}
style={[styles.markdownInlineImage, size]}
@@ -3803,7 +3831,7 @@ function MarkdownSessionLinkSpan({
? compactSessionMessageLabel(messageLabel ?? shortSessionId(session.messageClientId))
: explicit
?? sessionLinkTitles?.[session.sessionId]
- ?? `会话 ${shortSessionId(session.sessionId)}`;
+ ?? i18n.t('message.renderer.sessionChipFallback', { id: shortSessionId(session.sessionId) });
const detail = sessionReferenceDetails?.[
mobileSessionReferenceMetadataKey(session.sessionId, session.messageClientId)
];
@@ -4211,6 +4239,7 @@ function DiffPreview({
onOpen?: (payload: MessagePayload) => void;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
const first = diff.segments[0];
const payload = buildDiffPayload(diff);
const preview = summarizeMessagePayloadPreview(payload);
@@ -4244,7 +4273,7 @@ function DiffPreview({
</View>
) : null}
{diff.segments.length > 1 ? (
- <Text style={styles.diffMore}>{diff.segments.length} 处编辑</Text>
+ <Text style={styles.diffMore}>{t('message.renderer.diffEditCount', { n: diff.segments.length })}</Text>
) : null}
</MessageContentOpenButton>
);
@@ -4340,6 +4369,7 @@ function MessagePayloadModal({
onShareImage?: ComponentProps<typeof ImageLightbox>['onShareImage'];
}) {
const { colors } = useTheme();
+ const { t } = useTranslation();
const styles = useThemedStyles(makeStyles);
const [payloadCopyState, setPayloadCopyState] = useState<PayloadHeaderCopyState>('idle');
const payloadCopySeqRef = useRef(0);
@@ -4440,11 +4470,11 @@ function MessagePayloadModal({
const sharing = await import('expo-sharing');
await sharing.shareAsync(uri, { mimeType: 'image/png' });
} catch {
- Alert.alert('导出失败', '图表尚未渲染完成或导出出错,请稍后重试。');
+ Alert.alert(t('message.renderer.mermaidExportFailedTitle'), t('message.renderer.mermaidRenderIncompleteBody'));
} finally {
setMermaidExporting(false);
}
- }, [mermaidExporting]);
+ }, [mermaidExporting, t]);
// 标注 / 发送到对话:导出 PNG 后打开嵌套标注 lightbox(见 annotatePayload
// 注释),标注圆钮、直发进 composer 托盘等能力全部复用图片消息的既有链路。
@@ -4457,15 +4487,15 @@ function MessagePayloadModal({
const uri = await writeMermaidExportPngTemp(base64);
if (!uri) throw new Error('write temp failed');
setAnnotatePayload(buildMediaPayload(
- { kind: 'image', url: uri, previewable: true, title: 'Mermaid 图表' },
- 'Mermaid 图表',
+ { kind: 'image', url: uri, previewable: true, title: t('message.renderer.mermaidDiagramTitle') },
+ t('message.renderer.mermaidDiagramTitle'),
));
} catch {
- Alert.alert('标注失败', '图表尚未渲染完成或导出出错,请稍后重试。');
+ Alert.alert(t('message.renderer.mermaidAnnotateFailedTitle'), t('message.renderer.mermaidRenderIncompleteBody'));
} finally {
setMermaidExporting(false);
}
- }, [mermaidExporting, imageAnnotation]);
+ }, [mermaidExporting, imageAnnotation, t]);
// mermaid 走沉浸式全屏查看器:图表铺满整个 Modal(标题与源码区都不渲染,
// 图表最大化优先),仅右上角浮动「复制源码 / 关闭」;源码用复制按钮获取。
@@ -4493,7 +4523,7 @@ function MessagePayloadModal({
<View style={[styles.payloadFloatingActions, { top: modalSafeArea.paddingTop }]}>
{imageAnnotation ? (
<PayloadHeaderActionButton
- accessibilityLabel="标注并发送到对话"
+ accessibilityLabel={t('message.renderer.annotateSendToChat')}
disabled={mermaidExporting}
onPress={() => { void annotateMermaid(); }}
style={[styles.payloadHeaderButton, styles.payloadFloatingButton]}
@@ -4503,7 +4533,7 @@ function MessagePayloadModal({
</PayloadHeaderActionButton>
) : null}
<PayloadHeaderActionButton
- accessibilityLabel="导出图表为图片"
+ accessibilityLabel={t('message.renderer.exportDiagramImage')}
disabled={mermaidExporting}
onPress={() => { void exportMermaidPng(); }}
style={[styles.payloadHeaderButton, styles.payloadFloatingButton]}
@@ -4516,7 +4546,7 @@ function MessagePayloadModal({
)}
</PayloadHeaderActionButton>
<PayloadHeaderActionButton
- accessibilityLabel="关闭详情"
+ accessibilityLabel={t('message.renderer.closeDetail')}
onPress={onClose}
style={[styles.payloadCloseButton, styles.payloadFloatingButton]}
testID="message.payloadCloseButton"
@@ -4590,7 +4620,7 @@ function MessagePayloadModal({
>
{canCopyPayload ? (
<PayloadHeaderActionButton
- accessibilityLabel="复制详情内容"
+ accessibilityLabel={t('message.renderer.copyDetailContent')}
disabled={payloadCopyState === 'copying'}
onPress={copyPayload}
style={[
@@ -4610,7 +4640,7 @@ function MessagePayloadModal({
) : null}
{canOpenPayloadUrl ? (
<PayloadHeaderActionButton
- accessibilityLabel="打开详情链接"
+ accessibilityLabel={t('message.renderer.openDetailLink')}
onPress={openPayloadUrl}
style={[
styles.payloadHeaderButton,
@@ -4624,11 +4654,11 @@ function MessagePayloadModal({
</View>
{payloadCopyState === 'copied' || payloadCopyState === 'failed' ? (
<Text style={styles.payloadHeaderStatus} testID="message.payloadCopyStatus">
- {payloadCopyState === 'copied' ? '已复制' : '复制失败'}
+ {payloadCopyState === 'copied' ? t('message.renderer.copyStateCopied') : t('message.renderer.copyStateFailed')}
</Text>
) : null}
<PayloadHeaderActionButton
- accessibilityLabel="关闭详情"
+ accessibilityLabel={t('message.renderer.closeDetail')}
onPress={onClose}
style={[
styles.payloadCloseButton,
@@ -4721,6 +4751,7 @@ function MessagePayloadBody({
onResolveRemoteMedia?: ResolveRemoteMediaFn;
}) {
const { colors } = useTheme();
+ const { t } = useTranslation();
const styles = useThemedStyles(makeStyles);
const { width: screenWidth } = useWindowDimensions();
const [remoteState, setRemoteState] = useState<RemoteMediaState>({ status: 'idle' });
@@ -4819,12 +4850,12 @@ function MessagePayloadBody({
<Text style={styles.payloadMediaHint}>
{remoteMedia
? remoteMediaStatusText(remoteState, bodyPresentation.media?.remoteIdleText)
- : bodyPresentation.media?.unsupportedText ?? '当前媒体暂不能直接预览。'}
+ : bodyPresentation.media?.unsupportedText ?? t('message.renderer.mediaNotPreviewable')}
</Text>
{remoteState.status === 'error' && remoteMedia && onResolveRemoteMedia ? (
<PayloadActionButton
- accessibilityLabel="重试远程媒体取件"
- label="重试取件"
+ accessibilityLabel={t('message.renderer.retryRemoteMediaFetch')}
+ label={t('message.renderer.retryFetch')}
// 不能直接 onPress={resolve}:Pressable 会把事件对象塞进 forceRefresh 参数
onPress={() => {
resolve(true);
@@ -4835,8 +4866,8 @@ function MessagePayloadBody({
) : null}
{canOpenUrl ? (
<PayloadActionButton
- accessibilityLabel="打开媒体"
- label="打开媒体"
+ accessibilityLabel={t('message.renderer.openMedia')}
+ label={t('message.renderer.openMedia')}
onPress={() => {
void Linking.openURL(displayUrl).catch(() => undefined);
}}
@@ -4900,6 +4931,7 @@ function DiffPayloadBody({
onReadTextFilePreview?: (filePath: string) => Promise<RemoteTextFilePreviewResult>;
}) {
const { colors } = useTheme();
+ const { t } = useTranslation();
const styles = useThemedStyles(makeStyles);
const view = useMemo(() => formatDiffPayloadView(diff), [diff]);
const [filePreviewVisible, setFilePreviewVisible] = useState(false);
@@ -4919,13 +4951,13 @@ function DiffPayloadBody({
<PayloadPathActions layout={layout} path={view.filePath}>
{canPreview ? (
<PayloadActionButton
- accessibilityLabel="读取当前远程文件"
+ accessibilityLabel={t('message.renderer.readCurrentRemoteFile')}
disabled={previewState.status === 'loading'}
label={previewState.status === 'loading'
- ? '读取中'
+ ? t('message.renderer.reading')
: previewState.status === 'unavailable'
- ? '重试文件预览'
- : '读取当前文件'}
+ ? t('message.renderer.retryFilePreview')
+ : t('message.renderer.readCurrentFile')}
layout={layout}
onPress={openFilePreview}
testID="message.diffFilePreviewLoadButton"
@@ -4944,7 +4976,7 @@ function DiffPayloadBody({
]}
testID="message.diffFilePreviewBlock"
>
- <Text style={styles.payloadDiffSectionTitle}>当前文件预览</Text>
+ <Text style={styles.payloadDiffSectionTitle}>{t('message.renderer.currentFilePreview')}</Text>
{previewState.status === 'loading' ? <ActivityIndicator color={colors.textSecondary} /> : null}
<Text
style={styles.payloadMediaHint}
@@ -4991,21 +5023,21 @@ function DiffPayloadBody({
},
]}>
<DiffPayloadPane
- emptyText="没有旧内容"
+ emptyText={t('message.renderer.diffNoOldContent')}
layout={layout}
lines={section.oldLines}
prefix="-"
testID="message.diffCompareOldPane"
- title="旧内容"
+ title={t('message.renderer.diffOldTitle')}
variant="old"
/>
<DiffPayloadPane
- emptyText="没有新增内容"
+ emptyText={t('message.renderer.diffNoNewContent')}
layout={layout}
lines={section.newLines}
prefix="+"
testID="message.diffCompareNewPane"
- title="新内容"
+ title={t('message.renderer.diffNewTitle')}
variant="new"
/>
</View>
@@ -5084,6 +5116,7 @@ function FilePayloadBody({
onReadTextFilePreview?: (filePath: string) => Promise<RemoteTextFilePreviewResult>;
}) {
const { colors } = useTheme();
+ const { t } = useTranslation();
const styles = useThemedStyles(makeStyles);
const sourcePath = payload.sourcePath ?? '';
const bodyPresentation = useMemo(() => summarizeMessagePayloadBody(payload), [payload]);
@@ -5098,7 +5131,7 @@ function FilePayloadBody({
padding: layout.bodyPadding,
},
]}>
- <Text style={styles.payloadMediaKind}>文件</Text>
+ <Text style={styles.payloadMediaKind}>{t('message.renderer.fileKind')}</Text>
<Text selectable style={styles.payloadText}>
{bodyPresentation.file?.displayPath ?? bodyPresentation.emptyText}
</Text>
@@ -5109,9 +5142,9 @@ function FilePayloadBody({
<PayloadPathActions layout={layout} path={sourcePath}>
{canPreview && previewState.status !== 'ready' ? (
<PayloadActionButton
- accessibilityLabel="加载远程文本预览"
+ accessibilityLabel={t('message.renderer.loadRemoteTextPreview')}
disabled={previewState.status === 'loading'}
- label={previewState.status === 'loading' ? '加载中' : previewState.status === 'unavailable' ? '重试预览' : '加载预览'}
+ label={previewState.status === 'loading' ? t('message.renderer.loading') : previewState.status === 'unavailable' ? t('message.renderer.retryPreview') : t('message.renderer.loadPreview')}
layout={layout}
onPress={loadPreview}
testID="message.filePreviewLoadButton"
@@ -5193,6 +5226,7 @@ function PayloadPathActions({
path: string;
}) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
const [copyState, setCopyState] = useState<PayloadPathCopyState>('idle');
const copySeqRef = useRef(0);
const canCopy = path.trim().length > 0;
@@ -5228,9 +5262,9 @@ function PayloadPathActions({
<View style={[styles.payloadActionRow, { gap: layout.actionGap }]} testID="message.payloadPathActions">
{canCopy ? (
<PayloadActionButton
- accessibilityLabel="复制远程文件路径"
+ accessibilityLabel={t('message.renderer.copyRemoteFilePath')}
disabled={copyState === 'copying'}
- label={copyState === 'copying' ? '复制中' : '复制路径'}
+ label={copyState === 'copying' ? t('message.renderer.copyStateCopying') : t('message.renderer.copyPath')}
layout={layout}
onPress={copyPath}
testID="message.copyFilePathButton"
@@ -5240,7 +5274,7 @@ function PayloadPathActions({
</View>
{copyState === 'copied' || copyState === 'failed' ? (
<Text style={styles.payloadPathCopyStatus} testID="message.copyFilePathStatus">
- {copyState === 'copied' ? '已复制路径' : '复制路径失败'}
+ {copyState === 'copied' ? t('message.renderer.copiedPath') : t('message.renderer.copyPathFailed')}
</Text>
) : null}
</View>
@@ -5286,13 +5320,13 @@ function PayloadActionButton({
);
}
-function remoteMediaStatusText(state: RemoteMediaState, idleText = '正在准备远程媒体取件'): string {
- if (state.status === 'loading') return '正在从远程电脑取件';
+function remoteMediaStatusText(state: RemoteMediaState, idleText = i18n.t('message.renderer.remoteMediaIdle')): string {
+ if (state.status === 'loading') return i18n.t('message.renderer.remoteMediaLoading');
if (state.status === 'ready') {
const size = formatRemoteMediaSize(state.media.size);
- return ['已取回远程媒体', state.media.mimeType, size].filter(Boolean).join(' · ');
+ return [i18n.t('message.renderer.remoteMediaReady'), state.media.mimeType, size].filter(Boolean).join(' · ');
}
- if (state.status === 'error') return `取件失败:${state.message}`;
+ if (state.status === 'error') return i18n.t('message.renderer.remoteMediaFetchFailed', { message: state.message });
return idleText;
}
@@ -5301,21 +5335,21 @@ function formatMediaPlayerStatus(
kind: MobileMediaPlayerKind,
): string {
const label = payloadMediaKindLabel(kind);
- if (!status) return `${label} 待播放`;
+ if (!status) return i18n.t('message.renderer.mediaPending', { label });
const progress = formatMediaPlayerProgress(status);
switch (status.state) {
case 'ready':
- return `${label} 已加载${progress}`;
+ return i18n.t('message.renderer.mediaLoaded', { label, progress });
case 'playing':
- return `${label} 播放中${progress}`;
+ return i18n.t('message.renderer.mediaPlaying', { label, progress });
case 'paused':
- return `${label} 已暂停${progress}`;
+ return i18n.t('message.renderer.mediaPaused', { label, progress });
case 'waiting':
- return `${label} 缓冲中${progress}`;
+ return i18n.t('message.renderer.mediaBuffering', { label, progress });
case 'ended':
- return `${label} 已结束${progress}`;
+ return i18n.t('message.renderer.mediaEnded', { label, progress });
case 'error':
- return `${label} 播放出错${status.error ? `: ${status.error}` : ''}`;
+ return i18n.t('message.renderer.mediaError', { label, error: status.error ? `: ${status.error}` : '' });
}
}
@@ -5343,20 +5377,20 @@ function formatMediaPayloadBody(
bodyText: string,
): string {
const lines = [
- bodyText.trim() || `原始地址: ${payload.media.url}`,
+ bodyText.trim() || i18n.t('message.renderer.mediaSourceUrl', { url: payload.media.url }),
];
if (resolved) {
const size = formatRemoteMediaSize(resolved.size);
lines.push(
- `下载地址: ${resolved.url}`,
+ i18n.t('message.renderer.mediaDownloadUrl', { url: resolved.url }),
`MIME: ${resolved.mimeType}`,
- size ? `大小: ${size}` : '',
- `过期时间: ${resolved.expiresAt}`,
+ size ? i18n.t('message.renderer.mediaSize', { size }) : '',
+ i18n.t('message.renderer.mediaExpiresAt', { time: resolved.expiresAt }),
);
} else if (state.status === 'error') {
- lines.push(`错误: ${state.message}`);
+ lines.push(i18n.t('message.renderer.mediaErrorLine', { message: state.message }));
} else if (!payload.media.previewable && !bodyText.trim()) {
- lines.push('移动端会通过 device-link 请求远程电脑上传媒体后再打开。');
+ lines.push(i18n.t('message.renderer.mediaDeviceLinkHint'));
}
return lines.filter(Boolean).join('\n');
}
@@ -5442,9 +5476,9 @@ function messageControlActionLabel(
copyState: CopyMessageStatus | 'idle' | 'copying',
): string {
if (id === 'copy') return copyActionLabel(copyState);
- if (id === 'delete') return '删除消息';
- if (id === 'rewind') return '回退到这里';
- return '分叉对话';
+ if (id === 'delete') return i18n.t('message.renderer.controlDelete');
+ if (id === 'rewind') return i18n.t('message.renderer.controlRewind');
+ return i18n.t('message.renderer.controlFork');
}
function messageControlActionTestID(id: MobileMessageControlActionId): string {
diff --git a/apps/mobile/src/session/MobileAgentSwitcher.tsx b/apps/mobile/src/session/MobileAgentSwitcher.tsx
index f7d37b5255..aa829c8519 100644
--- a/apps/mobile/src/session/MobileAgentSwitcher.tsx
+++ b/apps/mobile/src/session/MobileAgentSwitcher.tsx
@@ -3,6 +3,7 @@
* 切段只改变正在浏览的模型目录;选中目标模型后才登记切换意图。
*/
import { useState } from 'react';
+import { useTranslation } from 'react-i18next';
import { Pressable, StyleSheet, View } from 'react-native';
import { Text } from '@/components/AppText';
@@ -69,6 +70,7 @@ export interface MobileAgentSwitcherProps {
export function MobileAgentSwitcher({ disabled = false, onChange, value }: MobileAgentSwitcherProps) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const [busy, setBusy] = useState(false);
const interactionDisabled = disabled || busy;
@@ -89,7 +91,7 @@ export function MobileAgentSwitcher({ disabled = false, onChange, value }: Mobil
const color = active ? colors.ctaText : colors.textTertiary;
return (
<Pressable
- accessibilityLabel={`浏览 ${agent.label} 模型`}
+ accessibilityLabel={t('models.agentSwitch.browseAccessibility', { agent: agent.label })}
accessibilityRole="tab"
accessibilityState={{ disabled: interactionDisabled, selected: active }}
disabled={interactionDisabled}
diff --git a/apps/mobile/src/session/MobileChoicePickerList.tsx b/apps/mobile/src/session/MobileChoicePickerList.tsx
index a72566bcce..a9223ad859 100644
--- a/apps/mobile/src/session/MobileChoicePickerList.tsx
+++ b/apps/mobile/src/session/MobileChoicePickerList.tsx
@@ -4,6 +4,7 @@
* (MobileModelPickerList / MobilePermissionPickerList),本组件只覆盖纯文字选项。
*/
import { Pressable, StyleSheet, type StyleProp, type ViewStyle } from 'react-native';
+import { useTranslation } from 'react-i18next';
import { Text } from '@/components/AppText';
import { Check } from 'lucide-react-native';
@@ -53,13 +54,14 @@ export function MobileChoicePickerList({
}: MobileChoicePickerListProps) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
return (
<>
{options.map((option) => {
const selected = option.id === activeId;
return (
<Pressable
- accessibilityLabel={`选择 ${option.label}`}
+ accessibilityLabel={t('shared.selectOption', { label: option.label })}
accessibilityRole="button"
accessibilityState={{ selected, disabled }}
disabled={disabled}
diff --git a/apps/mobile/src/session/MobileComposerInputRow.tsx b/apps/mobile/src/session/MobileComposerInputRow.tsx
index fab3b3d09a..826ad7d6ad 100644
--- a/apps/mobile/src/session/MobileComposerInputRow.tsx
+++ b/apps/mobile/src/session/MobileComposerInputRow.tsx
@@ -15,6 +15,7 @@ import Constants, { ExecutionEnvironment } from 'expo-constants';
import { TextInputWrapper, type PasteEventPayload } from 'expo-paste-input';
import { Mic } from 'lucide-react-native';
import { useCallback, useEffect, useRef, type ReactNode } from 'react';
+import { useTranslation } from 'react-i18next';
import { iconSize, iconStroke, useThemedStyles, type ThemeColors } from '@/theme';
import { radius, spacing, typeScale } from '@/theme/tokens';
@@ -324,6 +325,7 @@ export interface ComposerResizeGrabberProps {
* 行两端保持穿透,不与左右按钮抢触摸。
*/
export function ComposerResizeGrabber({ onAdjust, panHandlers, visible, testID }: ComposerResizeGrabberProps) {
+ const { t } = useTranslation();
const styles = useThemedStyles(makeMobileComposerInputRowStyles);
const opacity = useRef(new Animated.Value(visible ? 1 : 0)).current;
@@ -345,11 +347,11 @@ export function ComposerResizeGrabber({ onAdjust, panHandlers, visible, testID }
>
<View
accessibilityActions={[
- { label: '增大输入框高度', name: 'increment' },
- { label: '减小输入框高度', name: 'decrement' },
+ { label: t('composer.input.resize.increaseHeight'), name: 'increment' },
+ { label: t('composer.input.resize.decreaseHeight'), name: 'decrement' },
]}
- accessibilityHint="上下拖动调整输入框高度"
- accessibilityLabel="输入框高度调节"
+ accessibilityHint={t('composer.input.resize.hint')}
+ accessibilityLabel={t('composer.input.resize.label')}
accessibilityRole="adjustable"
onAccessibilityAction={(event) => {
onAdjust?.(event.nativeEvent.actionName === 'increment' ? 1 : -1);
diff --git a/apps/mobile/src/session/MobileModelPickerList.tsx b/apps/mobile/src/session/MobileModelPickerList.tsx
index e4fbb14d26..a05dbaa369 100644
--- a/apps/mobile/src/session/MobileModelPickerList.tsx
+++ b/apps/mobile/src/session/MobileModelPickerList.tsx
@@ -16,6 +16,7 @@
* (纯逻辑可单测),本组件只做渲染。
*/
import { Pressable, StyleSheet, View, type StyleProp, type ViewStyle } from 'react-native';
+import { useTranslation } from 'react-i18next';
import { Text } from '@/components/AppText';
import { Check, SlidersHorizontal, Zap } from 'lucide-react-native';
@@ -27,7 +28,7 @@ import type { MobileModelMemoryAccessors } from '@/session/draftModelMemory';
import { useDraftModelMemoryVersion } from '@/session/draftModelMemory';
import { useSessionModelMirrorVersion } from '@/session/sessionModelMirror';
import {
- BUDGET_DISABLED_HINT,
+ budgetDisabledHint,
budgetRowDisabled,
effortLabelFor,
rowEffortOf,
@@ -159,8 +160,8 @@ export function MobileModelPickerList({
activeSourceId,
loading = false,
disabled = false,
- emptyHint = '暂无可用模型',
- loadingHint = '正在加载模型…',
+ emptyHint,
+ loadingHint,
onSelectProviderRow,
onSelectFlatModel,
rowStyle,
@@ -176,6 +177,9 @@ export function MobileModelPickerList({
}: MobileModelPickerListProps) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
+ const resolvedEmptyHint = emptyHint ?? t('models.picker.emptyDefault');
+ const resolvedLoadingHint = loadingHint ?? t('models.picker.loadingDefault');
// 非选中行的记忆写入(二级浮窗里改)不经 props 回流 —— 订阅两个记忆 store 的版本号,
// 任一变化即重渲染行 effort/Fast 标签(对齐桌面 ModelSelector 的 storeVersion)。
const storeVersion = useDraftModelMemoryVersion() + useSessionModelMirrorVersion();
@@ -232,7 +236,10 @@ export function MobileModelPickerList({
(selected || !!modelMemory);
return (
<Pressable
- accessibilityLabel={`选择来源 ${row.provider.name} 的模型 ${row.model.displayName}`}
+ accessibilityLabel={t('models.picker.selectProviderModelAccessibility', {
+ provider: row.provider.name,
+ model: row.model.displayName,
+ })}
accessibilityRole="button"
accessibilityState={{ selected, disabled: disabled || rowDisabled }}
disabled={disabled || rowDisabled}
@@ -264,7 +271,7 @@ export function MobileModelPickerList({
<Text numberOfLines={1} style={styles.optionText}>{row.model.displayName}</Text>
{isSubscription ? (
<View style={styles.budgetBadge}>
- <Text style={styles.budgetBadgeText}>订阅</Text>
+ <Text style={styles.budgetBadgeText}>{t('models.picker.subscriptionBadge')}</Text>
</View>
) : null}
{isBudget ? (
@@ -282,13 +289,13 @@ export function MobileModelPickerList({
) : null}
</View>
{rowDisabled ? (
- <Text numberOfLines={1} style={styles.disabledHint}>{BUDGET_DISABLED_HINT}</Text>
+ <Text numberOfLines={1} style={styles.disabledHint}>{budgetDisabledHint()}</Text>
) : null}
</View>
{selected ? <Check color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.medium} /> : null}
{hasOptions ? (
<Pressable
- accessibilityLabel={`配置 ${row.model.displayName}`}
+ accessibilityLabel={t('models.picker.configureAccessibility', { model: row.model.displayName })}
accessibilityRole="button"
disabled={disabled}
hitSlop={6}
@@ -331,7 +338,7 @@ export function MobileModelPickerList({
: null;
return (
<Pressable
- accessibilityLabel={`选择模型 ${option.label}`}
+ accessibilityLabel={t('models.picker.selectModelAccessibility', { model: option.label })}
accessibilityRole="button"
accessibilityState={{ selected, disabled }}
disabled={disabled}
@@ -366,7 +373,7 @@ export function MobileModelPickerList({
{selected ? <Check color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.medium} /> : null}
{hasOptions ? (
<Pressable
- accessibilityLabel={`配置 ${option.label}`}
+ accessibilityLabel={t('models.picker.configureAccessibility', { model: option.label })}
accessibilityRole="button"
disabled={disabled}
hitSlop={6}
@@ -384,5 +391,5 @@ export function MobileModelPickerList({
);
}
- return <Text style={styles.empty}>{loading ? loadingHint : emptyHint}</Text>;
+ return <Text style={styles.empty}>{loading ? resolvedLoadingHint : resolvedEmptyHint}</Text>;
}
diff --git a/apps/mobile/src/session/MobilePermissionPickerList.tsx b/apps/mobile/src/session/MobilePermissionPickerList.tsx
index dd9bab2f55..f44a88265e 100644
--- a/apps/mobile/src/session/MobilePermissionPickerList.tsx
+++ b/apps/mobile/src/session/MobilePermissionPickerList.tsx
@@ -6,6 +6,7 @@
* (新建页 in-flow panel,会话内 composer 浮层)。
*/
import { Pressable, StyleSheet, type StyleProp, type ViewStyle } from 'react-native';
+import { useTranslation } from 'react-i18next';
import { Text } from '@/components/AppText';
import { Check } from 'lucide-react-native';
@@ -56,6 +57,7 @@ export function MobilePermissionPickerList({
}: MobilePermissionPickerListProps) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
// 计划模式已迁移到 + 号 Context 面板的专属入口(点击即进入),权限下拉不再展示 plan;
// 当前模式为 plan 时列表无高亮行,从这里选任意模式即退出计划模式。
const visibleOptions = options.filter((option) => option.id !== 'plan');
@@ -68,7 +70,7 @@ export function MobilePermissionPickerList({
const tinted = selected && presentation.accent !== 'neutral';
return (
<Pressable
- accessibilityLabel={`选择权限模式 ${presentation.label}`}
+ accessibilityLabel={t('interaction.permission.pickerSelect', { mode: presentation.label })}
accessibilityRole="button"
accessibilityState={{ selected, disabled }}
disabled={disabled}
diff --git a/apps/mobile/src/session/ModelOptionsSheetView.tsx b/apps/mobile/src/session/ModelOptionsSheetView.tsx
index e1b7568987..e0894e75fb 100644
--- a/apps/mobile/src/session/ModelOptionsSheetView.tsx
+++ b/apps/mobile/src/session/ModelOptionsSheetView.tsx
@@ -8,6 +8,7 @@
* effort 点击后停留(可连续调 Fast),返回/把手下拉由浮窗层负责。
*/
import { Pressable, StyleSheet, Switch, View } from 'react-native';
+import { useTranslation } from 'react-i18next';
import { Text } from '@/components/AppText';
import { Check } from 'lucide-react-native';
@@ -127,6 +128,7 @@ export function ModelOptionsSheetView({
}: ModelOptionsSheetViewProps) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
// 非选中行的写入落在记忆 store(不回流 props)—— 订阅版本号即时刷新当前值显示。
const storeVersion = useDraftModelMemoryVersion() + useSessionModelMirrorVersion();
void storeVersion;
@@ -176,9 +178,9 @@ export function ModelOptionsSheetView({
{metaLine ? <Text style={styles.metaLine} testID={`${testID}.meta`}>{metaLine}</Text> : null}
{fastEditable ? (
<View style={styles.fastRow}>
- <Text style={styles.fastRowLabel}>快速模式</Text>
+ <Text style={styles.fastRowLabel}>{t('models.options.fastMode')}</Text>
<Switch
- accessibilityLabel={`快速模式 ${displayName}`}
+ accessibilityLabel={t('models.options.fastModeAccessibility', { model: displayName })}
disabled={disabled}
onValueChange={setFast}
testID={`${testID}.fastToggle`}
@@ -190,13 +192,13 @@ export function ModelOptionsSheetView({
{fastEditable && hasEfforts ? <View style={styles.divider} /> : null}
{hasEfforts ? (
<>
- <Text style={styles.sectionLabel}>推理强度</Text>
+ <Text style={styles.sectionLabel}>{t('models.options.reasoningEffort')}</Text>
{model.efforts.map((effortId) => {
const effortSelected = effortId === currentEffort;
const label = effortLabelFor(model, effortId, capabilities);
return (
<Pressable
- accessibilityLabel={`推理强度 ${label}`}
+ accessibilityLabel={t('models.options.reasoningEffortAccessibility', { label })}
accessibilityRole="button"
accessibilityState={{ selected: effortSelected, disabled }}
disabled={disabled}
diff --git a/apps/mobile/src/session/ModelPickerSheet.tsx b/apps/mobile/src/session/ModelPickerSheet.tsx
index 68f8edf92c..c27bac4cfb 100644
--- a/apps/mobile/src/session/ModelPickerSheet.tsx
+++ b/apps/mobile/src/session/ModelPickerSheet.tsx
@@ -14,6 +14,7 @@
* 关浮窗);选中行 effort/Fast 改 live,非选中行写注入记忆(见 ModelOptionsSheetView)。
*/
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
+import { useTranslation } from 'react-i18next';
import { ChevronDown, Search } from 'lucide-react-native';
import {
Animated,
@@ -144,6 +145,7 @@ export function ModelPickerSheet({
}: ModelPickerSheetProps) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const { height: windowHeight } = useWindowDimensions();
const insets = useSafeAreaInsets();
@@ -297,11 +299,11 @@ export function ModelPickerSheet({
<View style={styles.searchRow}>
<Search color={colors.textTertiary} size={iconSize.sm} strokeWidth={iconStroke.regular} />
<TextInput
- accessibilityLabel="搜索模型"
+ accessibilityLabel={t('models.picker.searchAccessibility')}
autoCapitalize="none"
autoCorrect={false}
onChangeText={setQuery}
- placeholder="搜索模型..."
+ placeholder={t('models.picker.searchPlaceholder')}
placeholderTextColor={colors.textTertiary}
style={styles.searchInput}
testID={`${testID}.search`}
@@ -327,7 +329,7 @@ export function ModelPickerSheet({
/>
{browsingOtherAgent ? (
<Text style={styles.agentSwitchHint} testID={`${testID}.agentSwitchHint`}>
- 选择模型后,下一条消息将切换到 {mobileAgentLabel(agentSwitch.browsingAgentKind)}
+ {t('models.picker.agentSwitchHint', { agent: mobileAgentLabel(agentSwitch.browsingAgentKind) })}
</Text>
) : null}
</>
@@ -342,7 +344,7 @@ export function ModelPickerSheet({
const permissionColor = permissionAccentColor(permission.accent, colors);
const permissionTrigger = (
<Pressable
- accessibilityLabel={`权限模式:${permissionLabel}`}
+ accessibilityLabel={t('models.picker.permissionModeAccessibility', { mode: permissionLabel })}
accessibilityRole="button"
accessibilityState={{ disabled: permissionDisabled || browsingOtherAgent }}
disabled={permissionDisabled || browsingOtherAgent}
@@ -385,10 +387,10 @@ export function ModelPickerSheet({
scrollRef={scrollRef}
snap={primarySnap}
testID={testID}
- title="模型"
+ title={t('models.picker.title')}
>
{noResults ? (
- <Text style={styles.noResults} testID={`${testID}.noResults`}>没有匹配的模型</Text>
+ <Text style={styles.noResults} testID={`${testID}.noResults`}>{t('models.picker.noResults')}</Text>
) : (
<MobileModelPickerList
activeModelId={activeModelId}
@@ -398,7 +400,7 @@ export function ModelPickerSheet({
capabilities={capabilities}
disabled={disabled}
emptyHint={browsingOtherAgent
- ? `请先在被控电脑连接 ${mobileAgentLabel(agentSwitch!.browsingAgentKind)} 的模型来源`
+ ? t('models.picker.crossAgentEmptyHint', { agent: mobileAgentLabel(agentSwitch!.browsingAgentKind) })
: emptyHint}
flatOptions={effectiveFlatOptions}
loading={loading}
@@ -421,14 +423,14 @@ export function ModelPickerSheet({
testID={`${testID}.secondaryLayer`}
>
<Pressable
- accessibilityLabel="返回模型列表"
+ accessibilityLabel={t('models.picker.backToModels')}
accessibilityRole="button"
onPress={backToModels}
style={styles.secondaryBackdrop}
testID={`${testID}.secondaryBackdrop`}
/>
<SheetSurface
- backAccessibilityLabel="返回模型列表"
+ backAccessibilityLabel={t('models.picker.backToModels')}
bottomInset={insets.bottom}
heights={heights}
onBack={backToModels}
diff --git a/apps/mobile/src/session/PlanModeChip.tsx b/apps/mobile/src/session/PlanModeChip.tsx
index b43f3b733c..bae259c602 100644
--- a/apps/mobile/src/session/PlanModeChip.tsx
+++ b/apps/mobile/src/session/PlanModeChip.tsx
@@ -4,6 +4,7 @@
* 本 chip 表达;点 × 退出并恢复进入前的权限档。中性 chip token(与 GoalIndicator 同精神)。
*/
import { ListTodo, X } from 'lucide-react-native';
+import { useTranslation } from 'react-i18next';
import { Pressable, View } from 'react-native';
import { Text } from '@/components/AppText';
import { fontWeight, iconSize, iconStroke, radius, spacing, typeScale, useTheme, useThemedStyles, type ThemeColors } from '@/theme';
@@ -17,12 +18,13 @@ export interface PlanModeChipProps {
export function PlanModeChip({ onExit, disabled, testID }: PlanModeChipProps) {
const styles = useThemedStyles(makeChipStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
return (
<View style={styles.chip} testID={testID}>
<ListTodo color={colors.textPrimary} size={iconSize.sm} strokeWidth={iconStroke.regular} />
- <Text style={styles.label}>计划模式</Text>
+ <Text style={styles.label}>{t('interaction.planMode.label')}</Text>
<Pressable
- accessibilityLabel="退出计划模式"
+ accessibilityLabel={t('interaction.planMode.exit')}
accessibilityRole="button"
accessibilityState={{ disabled }}
disabled={disabled}
diff --git a/apps/mobile/src/session/QuoteCapsule.tsx b/apps/mobile/src/session/QuoteCapsule.tsx
index 34bfb85523..9e02bada66 100644
--- a/apps/mobile/src/session/QuoteCapsule.tsx
+++ b/apps/mobile/src/session/QuoteCapsule.tsx
@@ -12,6 +12,7 @@
* 截 3 行;文件来源条目附 FileText 图标 + basename/行号。
*/
import { useCallback, useRef, useState } from 'react';
+import { useTranslation } from 'react-i18next';
import { FileText, MessageSquareQuote, X } from 'lucide-react-native';
import { Modal, Pressable, ScrollView, View, useWindowDimensions } from 'react-native';
import { Text } from '@/components/AppText';
@@ -41,6 +42,7 @@ export interface QuoteCapsuleProps {
export function QuoteCapsule({ quotes, variant, onClear, testIDPrefix = 'quoteCapsule' }: QuoteCapsuleProps) {
const styles = useThemedStyles(makeQuoteCapsuleStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const { width: screenWidth, height: screenHeight } = useWindowDimensions();
const capsuleRef = useRef<View>(null);
// 非空 = 预览浮窗开启(记录胶囊的 window 坐标供浮窗锚定)。
@@ -83,7 +85,7 @@ export function QuoteCapsule({ quotes, variant, onClear, testIDPrefix = 'quoteCa
return (
<View style={variant === 'bubble' ? styles.containerBubble : styles.containerComposer} testID={testIDPrefix}>
<Pressable
- accessibilityLabel={`${quotes.length} 处引用,点击预览`}
+ accessibilityLabel={t('message.quote.countPreviewHint', { n: quotes.length })}
accessibilityRole="button"
onPress={openPreview}
ref={capsuleRef}
@@ -91,10 +93,10 @@ export function QuoteCapsule({ quotes, variant, onClear, testIDPrefix = 'quoteCa
testID={`${testIDPrefix}.pill`}
>
<MessageSquareQuote color={colors.textSecondary} size={iconSize.sm} strokeWidth={iconStroke.regular} />
- <Text style={styles.capsuleText}>{`${quotes.length} 处引用`}</Text>
+ <Text style={styles.capsuleText}>{t('message.quote.count', { n: quotes.length })}</Text>
{variant === 'composer' && onClear ? (
<Pressable
- accessibilityLabel="移除引用"
+ accessibilityLabel={t('message.quote.remove')}
accessibilityRole="button"
hitSlop={8}
onPress={onClear}
@@ -115,7 +117,7 @@ export function QuoteCapsule({ quotes, variant, onClear, testIDPrefix = 'quoteCa
>
{/* 全屏透明背板:点任意处关闭;浮窗卡片自身拦截点击不透传。 */}
<Pressable
- accessibilityLabel="关闭引用预览"
+ accessibilityLabel={t('message.quote.closePreview')}
onPress={closePreview}
style={styles.previewBackdrop}
testID={`${testIDPrefix}.previewBackdrop`}
diff --git a/apps/mobile/src/session/RewindPreviewPanel.tsx b/apps/mobile/src/session/RewindPreviewPanel.tsx
index 2adeaa7b3d..5a0c4a73c0 100644
--- a/apps/mobile/src/session/RewindPreviewPanel.tsx
+++ b/apps/mobile/src/session/RewindPreviewPanel.tsx
@@ -4,6 +4,8 @@ import {
View,
useWindowDimensions,
} from 'react-native';
+import { useTranslation } from 'react-i18next';
+import type { TFunction } from 'i18next';
import { Text } from '@/components/AppText';
import { MainWindowActionGroup } from '@/components/MobilePrimitives';
import type { RewindPreviewState } from '@/session/rewindPreview';
@@ -26,12 +28,13 @@ export function RewindPreviewPanel({
}: RewindPreviewPanelProps) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const { width: screenWidth } = useWindowDimensions();
if (state.kind === 'idle') return null;
const canConfirm = state.kind === 'default' || state.kind === 'empty';
- const title = titleForState(state);
- const detail = detailForState(state);
+ const title = titleForState(state, t);
+ const detail = detailForState(state, t);
const fileCount = state.kind === 'default' ? state.filesChanged.length : 0;
const layout = buildRewindPreviewLayout({
fileCount,
@@ -70,10 +73,10 @@ export function RewindPreviewPanel({
</Text>
))}
{state.filesChanged.length > layout.visibleFileCount ? (
- <Text style={styles.moreFiles}>另有 {state.filesChanged.length - layout.visibleFileCount} 个文件</Text>
+ <Text style={styles.moreFiles}>{t('interaction.rewind.moreFiles', { count: state.filesChanged.length - layout.visibleFileCount })}</Text>
) : null}
<Text style={styles.stats}>
- {state.filesChanged.length} 个文件 · +{state.insertions} / -{state.deletions} 行
+ {t('interaction.rewind.stats', { count: state.filesChanged.length, insertions: state.insertions, deletions: state.deletions })}
</Text>
</View>
) : null}
@@ -89,15 +92,15 @@ export function RewindPreviewPanel({
{state.kind !== 'loading' ? (
<MainWindowActionGroup
cancelAction={{
- accessibilityLabel: state.kind === 'error' ? '知道了' : '取消回退',
- label: state.kind === 'error' ? '知道了' : '取消',
+ accessibilityLabel: state.kind === 'error' ? t('interaction.rewind.gotIt') : t('interaction.rewind.cancelAccessibility'),
+ label: state.kind === 'error' ? t('interaction.rewind.gotIt') : t('interaction.rewind.cancel'),
onPress: onCancel,
testID: state.kind === 'error' ? 'rewind.dismissButton' : 'rewind.cancelButton',
}}
primaryActions={canConfirm ? [{
- accessibilityLabel: '确认回退',
+ accessibilityLabel: t('interaction.rewind.confirm'),
disabled: committing,
- label: committing ? '回退中' : '确认回退',
+ label: committing ? t('interaction.rewind.confirming') : t('interaction.rewind.confirm'),
onPress: onConfirm,
testID: 'rewind.confirmButton',
tone: 'primary',
@@ -109,18 +112,18 @@ export function RewindPreviewPanel({
);
}
-function titleForState(state: RewindPreviewState): string {
- if (state.kind === 'loading') return '正在检查回退影响';
- if (state.kind === 'default') return '确认回退到这条消息?';
- if (state.kind === 'empty') return '只回退对话历史';
- return '无法回退';
+function titleForState(state: RewindPreviewState, t: TFunction): string {
+ if (state.kind === 'loading') return t('interaction.rewind.titleLoading');
+ if (state.kind === 'default') return t('interaction.rewind.titleDefault');
+ if (state.kind === 'empty') return t('interaction.rewind.titleEmpty');
+ return t('interaction.rewind.titleError');
}
-function detailForState(state: RewindPreviewState): string | null {
- if (state.kind === 'loading') return '手机端正在向电脑端读取文件回退预览。';
- if (state.kind === 'default') return '会回滚下面这些文件,并截断这条消息之后的对话历史。';
- if (state.kind === 'empty') return '没有文件需要回滚,确认后只会截断这条消息之后的对话历史。';
- return '电脑端拒绝了这次回退操作。';
+function detailForState(state: RewindPreviewState, t: TFunction): string | null {
+ if (state.kind === 'loading') return t('interaction.rewind.detailLoading');
+ if (state.kind === 'default') return t('interaction.rewind.detailDefault');
+ if (state.kind === 'empty') return t('interaction.rewind.detailEmpty');
+ return t('interaction.rewind.detailError');
}
const makeStyles = (colors: ThemeColors) => StyleSheet.create({
diff --git a/apps/mobile/src/session/SessionActionSheet.tsx b/apps/mobile/src/session/SessionActionSheet.tsx
index 05e42fe73f..e939d079f3 100644
--- a/apps/mobile/src/session/SessionActionSheet.tsx
+++ b/apps/mobile/src/session/SessionActionSheet.tsx
@@ -27,6 +27,7 @@ import {
type LucideIcon,
} from 'lucide-react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
+import { useTranslation } from 'react-i18next';
import { Text } from '@/components/AppText';
import { BlurBackdrop } from '@/session/BlurBackdrop';
import {
@@ -64,6 +65,7 @@ export function SessionActionSheet({
}) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const insets = useSafeAreaInsets();
const [mounted, setMounted] = useState(visible);
const progress = useRef(new Animated.Value(visible ? 1 : 0)).current;
@@ -112,7 +114,7 @@ export function SessionActionSheet({
<Animated.View style={[StyleSheet.absoluteFill, { opacity: progress }]}>
<BlurBackdrop />
<Pressable
- accessibilityLabel="关闭会话操作菜单"
+ accessibilityLabel={t('session.row.closeActionMenu')}
onPress={onClose}
style={styles.backdrop}
testID="home.sessionActions.backdrop"
@@ -148,14 +150,14 @@ export function SessionActionSheet({
})}
</View>
<Pressable
- accessibilityLabel="取消"
+ accessibilityLabel={t('session.common.cancel')}
accessibilityRole="button"
onPress={onClose}
style={({ pressed }) => [styles.cancelCard, pressed && styles.pressed]}
testID="home.sessionActions.cancel"
>
<BlurBackdrop intensity={32} overlayColor={colors.sheetActionSurface} />
- <Text style={styles.cancelText}>取消</Text>
+ <Text style={styles.cancelText}>{t('session.common.cancel')}</Text>
</Pressable>
</Animated.View>
</View>
diff --git a/apps/mobile/src/session/SessionMenuSheet.tsx b/apps/mobile/src/session/SessionMenuSheet.tsx
index 7ebb89615b..c0ffd15f2e 100644
--- a/apps/mobile/src/session/SessionMenuSheet.tsx
+++ b/apps/mobile/src/session/SessionMenuSheet.tsx
@@ -39,6 +39,7 @@ import {
useWindowDimensions,
} from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
+import { useTranslation } from 'react-i18next';
import { Text, TextInput } from '@/components/AppText';
import { MainWindowActionGroup } from '@/components/MobilePrimitives';
import type { RemoteDirectoryEntry } from '@/device-link/mobileMakerTransport';
@@ -153,6 +154,7 @@ export function SessionMenuSheet({
}: SessionMenuSheetProps) {
const styles = useThemedStyles(makeStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const { height: windowHeight } = useWindowDimensions();
const insets = useSafeAreaInsets();
@@ -286,11 +288,11 @@ export function SessionMenuSheet({
}, [markCopied]);
/** 复制按钮 / 行的反馈文案:成功「已复制」、失败「复制失败」,1.5s 后还原。 */
- const copyLabel = useCallback((base: string, key: string, copiedText = '已复制') => {
+ const copyLabel = useCallback((base: string, key: string, copiedText = t('session.menu.copied')) => {
if (copiedKey === key) return copiedText;
- if (copiedKey === `${key}:error`) return '复制失败';
+ if (copiedKey === `${key}:error`) return t('session.menu.copyFailed');
return base;
- }, [copiedKey]);
+ }, [copiedKey, t]);
const writeDisabled = busy || !!readOnlyReason;
const header = buildSessionMenuHeader(session, { readOnlyReason });
@@ -337,29 +339,29 @@ export function SessionMenuSheet({
if (trimmed) {
setTitleDraft(trimmed);
} else {
- setRenameError('自动起名失败,请重试。');
+ setRenameError(t('session.menu.aiRenameFailed'));
}
} catch (err) {
if (renameSeqRef.current !== seq) return;
setRenameError(aiRenameFailureText(err));
}
setRenameGenerating(false);
- }, [onRegenerateTitle, renameGenerating]);
+ }, [onRegenerateTitle, renameGenerating, t]);
// 删除确认后先关 sheet 再发删除(会话删除后本页会整体退出,不留悬空 overlay)。
const confirmDelete = useCallback(() => {
- Alert.alert('删除会话?', '删除后不可恢复。', [
- { style: 'cancel', text: '取消' },
+ Alert.alert(t('session.menu.deleteConfirmTitle'), t('session.menu.deleteConfirmBody'), [
+ { style: 'cancel', text: t('session.common.cancel') },
{
onPress: () => {
onClose();
onDelete();
},
style: 'destructive',
- text: '删除',
+ text: t('session.common.delete'),
},
]);
- }, [onClose, onDelete]);
+ }, [onClose, onDelete, t]);
// 置顶 / 归档执行即收起菜单(手机菜单惯例);复制链接留在菜单展示「已复制」反馈,
// 重命名进入原地编辑态。
@@ -395,12 +397,12 @@ export function SessionMenuSheet({
const addExtraDir = useCallback((path: string) => {
const next = addSessionExtraDir(session.extraDirs, path);
if (!next.changed) {
- setExtraDirsNotice('这个目录已经在列表里。');
+ setExtraDirsNotice(t('session.menu.dirAlreadyAdded'));
return;
}
setExtraDirsNotice(null);
onSetExtraDirs(next.dirs);
- }, [onSetExtraDirs, session.extraDirs]);
+ }, [onSetExtraDirs, session.extraDirs, t]);
const removeExtraDir = useCallback((path: string) => {
setExtraDirsNotice(null);
onSetExtraDirs(removeSessionExtraDir(session.extraDirs, path));
@@ -431,14 +433,14 @@ export function SessionMenuSheet({
codexRateLimits?.account.planType,
].filter(Boolean).join(' · ');
Alert.alert(
- '重置 Codex 用量?',
- `将为 ${account || '当前 Codex 账号'} 消耗 1 次重置。额度窗口会立即重开,此操作不能撤销。`,
+ t('session.menu.resetCodexTitle'),
+ t('session.menu.resetCodexBody', { account: account || t('session.menu.currentCodexAccount') }),
[
- { text: '取消', style: 'cancel' },
- { text: '消耗 1 次重置', onPress: onResetCodexRateLimits },
+ { text: t('session.common.cancel'), style: 'cancel' },
+ { text: t('session.menu.resetConsumeOnce'), onPress: onResetCodexRateLimits },
],
);
- }, [codexRateLimits, codexResetBusy, onResetCodexRateLimits, resetSummary]);
+ }, [codexRateLimits, codexResetBusy, onResetCodexRateLimits, resetSummary, t]);
const menuContent = (
<View style={styles.menuBody} testID="session.menuSheetBody">
@@ -458,7 +460,7 @@ export function SessionMenuSheet({
setRenameError(null);
}}
onSubmitEditing={submitRename}
- placeholder="会话标题"
+ placeholder={t('session.menu.titlePlaceholder')}
placeholderTextColor={colors.textTertiary}
returnKeyType="done"
selectTextOnFocus
@@ -467,7 +469,7 @@ export function SessionMenuSheet({
value={titleDraft}
/>
<Pressable
- accessibilityLabel="AI 自动起名"
+ accessibilityLabel={t('session.menu.aiRenameLabel')}
accessibilityRole="button"
accessibilityState={{ busy: renameGenerating }}
hitSlop={6}
@@ -508,7 +510,7 @@ export function SessionMenuSheet({
) : null}
{header.usageSummary ? (
<Pressable
- accessibilityLabel="查看会话用量详情"
+ accessibilityLabel={t('session.menu.viewUsageDetail')}
accessibilityRole="button"
onPress={openInfo}
style={({ pressed }) => [styles.usageRow, pressed && styles.pressed]}
@@ -527,7 +529,7 @@ export function SessionMenuSheet({
disabled={action.disabled}
icon={menuActionIcon(action, session)}
label={action.id === 'copyLink'
- ? copyLabel(action.label, 'copyLink', '链接已复制')
+ ? copyLabel(action.label, 'copyLink', t('session.menu.linkCopied'))
: action.label}
onPress={() => handleAction(action)}
testID={action.testID}
@@ -538,7 +540,7 @@ export function SessionMenuSheet({
<View style={styles.actionGroup}>
<MenuActionRow
icon={Info}
- label="会话信息"
+ label={t('session.menu.sessionInfo')}
onPress={openInfo}
testID="session.infoButton"
trailing={<ChevronRight color={colors.textTertiary} size={iconSize.md} strokeWidth={iconStroke.regular} />}
@@ -566,9 +568,9 @@ export function SessionMenuSheet({
<View style={styles.infoBody} testID="session.infoSheetBody">
<View style={styles.infoSection}>
<View style={styles.infoSectionHeader}>
- <Text style={styles.infoSectionTitle}>用量</Text>
+ <Text style={styles.infoSectionTitle}>{t('session.menu.usageSection')}</Text>
<Pressable
- accessibilityLabel="刷新上下文用量"
+ accessibilityLabel={t('session.menu.refreshContextUsage')}
accessibilityRole="button"
disabled={contextLoading}
onPress={onRefreshContextUsage}
@@ -582,8 +584,8 @@ export function SessionMenuSheet({
)}
</Pressable>
</View>
- <InfoRow label="本次会话" value={spend.available ? spend.detail : '暂无会话用量'} />
- <InfoRow label="上下文" value={usage.detail} />
+ <InfoRow label={t('session.menu.currentSessionSpend')} value={spend.available ? spend.detail : t('session.menu.noSessionSpend')} />
+ <InfoRow label={t('session.menu.contextLabel')} value={usage.detail} />
{usage.rows.length > 0 ? (
<View style={styles.usageRows} testID="session.contextRows">
{usage.rows.map((row) => (
@@ -595,7 +597,7 @@ export function SessionMenuSheet({
{accountLimits || resetSummary ? (
<View style={styles.infoSection} testID="session.accountLimitsSection">
- <Text style={styles.infoSectionTitle}>账号限额</Text>
+ <Text style={styles.infoSectionTitle}>{t('session.menu.accountLimits')}</Text>
{accountLimits?.rows.map((row, index) => (
// 两个窗口都缺时长数据时 label 会同为「限额」,key 需带 index 去重。
<InfoRow key={`${row.label}:${index}`} label={row.label} value={row.value} />
@@ -606,12 +608,12 @@ export function SessionMenuSheet({
{resetSummary?.canReset ? (
<>
<Text style={styles.infoCaption}>
- 当前额度已耗尽。重置会立即消耗 1 次,且不能撤销。
+ {t('session.menu.quotaExhaustedResettable')}
</Text>
<View style={styles.infoActionRow}>
<MenuPillButton
disabled={codexResetBusy}
- label={codexResetBusy ? '正在重置…' : '重置 Codex 用量'}
+ label={codexResetBusy ? t('session.menu.resetting') : t('session.menu.resetCodexUsage')}
onPress={confirmCodexReset}
testID="session.codexRateLimitResetButton"
tone="primary"
@@ -619,7 +621,7 @@ export function SessionMenuSheet({
</View>
</>
) : resetSummary?.shouldPrompt && resetSummary.availableCount === 0 ? (
- <Text style={styles.infoCaption}>当前额度已耗尽,但没有可用重置次数。</Text>
+ <Text style={styles.infoCaption}>{t('session.menu.quotaExhaustedNoCredit')}</Text>
) : null}
</View>
) : null}
@@ -630,12 +632,12 @@ export function SessionMenuSheet({
<InfoRow label={workspace.name} mono value={workspace.path} />
<View style={styles.infoActionRow}>
<MenuPillButton
- label="打开目录"
+ label={t('session.menu.openDir')}
onPress={onOpenWorkspace}
testID="session.openWorkspaceButton"
/>
<MenuPillButton
- label={copyLabel('复制路径', 'workspacePath')}
+ label={copyLabel(t('session.menu.copyPath'), 'workspacePath')}
onPress={() => copyValue('workspacePath', workspace.path)}
testID="session.copyWorkspacePath"
/>
@@ -645,10 +647,10 @@ export function SessionMenuSheet({
{showExtraDirs ? (
<View style={styles.infoSection} testID="session.extraDirsSection">
- <Text style={styles.infoSectionTitle}>附加引用目录</Text>
+ <Text style={styles.infoSectionTitle}>{t('session.menu.extraDirsSection')}</Text>
{currentExtraDirs.length === 0 ? (
<Text style={styles.infoCaption} testID="session.extraDirsStatus">
- 当前没有附加目录。附加目录会作为额外上下文提供给被控电脑上的 agent。
+ {t('session.menu.noExtraDirs')}
</Text>
) : (
<View style={styles.extraDirList}>
@@ -657,7 +659,7 @@ export function SessionMenuSheet({
<Text numberOfLines={1} style={styles.extraDirPath}>{dir}</Text>
<MenuPillButton
disabled={writeDisabled}
- label="移除"
+ label={t('session.menu.remove')}
onPress={() => removeExtraDir(dir)}
testID="session.extraDirRemoveButton"
/>
@@ -671,7 +673,7 @@ export function SessionMenuSheet({
<View style={styles.infoActionRow}>
<MenuPillButton
disabled={writeDisabled || !!extraDirBrowser?.loading}
- label={extraDirBrowser?.open ? '收起远程目录' : '浏览远程目录'}
+ label={extraDirBrowser?.open ? t('session.menu.collapseRemoteDir') : t('session.menu.browseRemoteDir')}
onPress={onToggleExtraDirBrowser}
testID="session.extraDirsBrowseToggle"
/>
@@ -684,18 +686,18 @@ export function SessionMenuSheet({
style={styles.browsePath}
testID="session.extraDirsBrowseCurrentPath"
>
- {extraDirBrowser.path || '正在读取…'}
+ {extraDirBrowser.path || t('session.menu.reading')}
</Text>
<View style={styles.infoActionRow}>
<MenuPillButton
disabled={writeDisabled || extraDirBrowser.loading || !extraDirBrowser.parent}
- label="上级"
+ label={t('session.menu.parentDir')}
onPress={() => extraDirBrowser.parent && onLoadExtraDirPath(extraDirBrowser.parent)}
testID="session.extraDirsBrowseParentButton"
/>
<MenuPillButton
disabled={writeDisabled || extraDirBrowser.loading || !extraDirBrowser.path}
- label="添加当前目录"
+ label={t('session.menu.addCurrentDir')}
onPress={() => addExtraDir(extraDirBrowser.path)}
testID="session.extraDirsBrowseAddCurrent"
/>
@@ -707,7 +709,7 @@ export function SessionMenuSheet({
{extraDirBrowser.entries.slice(0, 30).map((entry) => (
<View key={entry.path} style={styles.browseRow} testID="session.extraDirsBrowseEntry">
<Pressable
- accessibilityLabel={`进入远程目录 ${entry.name}`}
+ accessibilityLabel={t('session.menu.enterRemoteDir', { name: entry.name })}
accessibilityRole="button"
disabled={writeDisabled || extraDirBrowser.loading}
onPress={() => onLoadExtraDirPath(entry.path)}
@@ -720,17 +722,17 @@ export function SessionMenuSheet({
</Pressable>
<MenuPillButton
disabled={writeDisabled || extraDirBrowser.loading}
- label="添加"
+ label={t('session.menu.add')}
onPress={() => addExtraDir(entry.path)}
testID="session.extraDirsBrowseAddEntry"
/>
</View>
))}
{!extraDirBrowser.loading && extraDirBrowser.entries.length === 0 && !extraDirBrowser.error ? (
- <Text style={styles.infoCaption}>这个目录下没有可进入的子目录。</Text>
+ <Text style={styles.infoCaption}>{t('session.menu.noSubDirs')}</Text>
) : null}
{extraDirBrowser.entries.length > 30 ? (
- <Text style={styles.infoCaption}>仅显示前 30 个目录,可进入更具体的目录继续选择。</Text>
+ <Text style={styles.infoCaption}>{t('session.menu.dirLimitNotice')}</Text>
) : null}
</View>
</View>
@@ -756,15 +758,15 @@ export function SessionMenuSheet({
footer={renaming ? (
<MainWindowActionGroup
primaryActions={[{
- accessibilityLabel: '确认重命名',
- label: '确定',
+ accessibilityLabel: t('session.menu.confirmRename'),
+ label: t('session.menu.confirm'),
onPress: submitRename,
testID: 'session.renameButton',
tone: 'primary',
}]}
cancelAction={{
- accessibilityLabel: '取消重命名',
- label: '取消',
+ accessibilityLabel: t('session.menu.cancelRename'),
+ label: t('session.common.cancel'),
onPress: cancelRename,
testID: 'session.renameCancelButton',
}}
@@ -787,14 +789,14 @@ export function SessionMenuSheet({
testID="session.infoLayer"
>
<Pressable
- accessibilityLabel="返回会话菜单"
+ accessibilityLabel={t('session.menu.backToMenu')}
accessibilityRole="button"
onPress={backToMenu}
style={styles.secondaryBackdrop}
testID="session.infoBackdrop"
/>
<SheetSurface
- backAccessibilityLabel="返回会话菜单"
+ backAccessibilityLabel={t('session.menu.backToMenu')}
bottomInset={insets.bottom}
heights={heights}
onBack={backToMenu}
@@ -802,7 +804,7 @@ export function SessionMenuSheet({
onSnapChange={setSecondarySnap}
snap={secondarySnap}
testID="session.infoSheet"
- title="会话信息"
+ title={t('session.menu.sessionInfo')}
>
{infoContent}
</SheetSurface>
diff --git a/apps/mobile/src/session/SessionTailBanner.tsx b/apps/mobile/src/session/SessionTailBanner.tsx
index bc505c055d..a10437a3d9 100644
--- a/apps/mobile/src/session/SessionTailBanner.tsx
+++ b/apps/mobile/src/session/SessionTailBanner.tsx
@@ -10,6 +10,7 @@
* - 「忽略」→ error-tail 持久化 dismiss / interrupted 写 ack,不再提示。
*/
import { Pressable, StyleSheet } from 'react-native';
+import { useTranslation } from 'react-i18next';
import { Text } from '@/components/AppText';
import { View } from 'react-native';
import type { SessionTailBannerState } from '@/session/sessionTailBannerModel';
@@ -29,14 +30,13 @@ export interface SessionTailBannerProps {
onDismiss(): void;
}
-const INTERRUPTED_TEXT = '任务执行到一半时应用退出,已被中断。';
-
export function SessionTailBanner({ state, busy, readOnly, onContinue, onDismiss }: SessionTailBannerProps) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
const isInterrupted = state.kind === 'interrupted' || state.continueKind === 'interrupted';
const text = state.kind === 'error-tail' && state.continueKind === 'error'
? state.text
- : INTERRUPTED_TEXT;
+ : t('session.tail.interrupted');
const showContinue = state.kind === 'interrupted' || state.retryable;
return (
<View style={styles.box} testID="session.tailBanner">
@@ -52,14 +52,14 @@ export function SessionTailBanner({ state, busy, readOnly, onContinue, onDismiss
<TailPill
busy={busy}
cta
- label={isInterrupted ? '继续任务' : '重试'}
+ label={isInterrupted ? t('session.tail.continueTask') : t('session.tail.retry')}
onPress={onContinue}
testID="session.tailBanner.continue"
/>
) : null}
<TailPill
busy={busy}
- label="忽略"
+ label={t('session.tail.ignore')}
onPress={onDismiss}
testID="session.tailBanner.dismiss"
/>
diff --git a/apps/mobile/src/session/SheetModal.tsx b/apps/mobile/src/session/SheetModal.tsx
index b682a5336c..befd0bce06 100644
--- a/apps/mobile/src/session/SheetModal.tsx
+++ b/apps/mobile/src/session/SheetModal.tsx
@@ -22,6 +22,7 @@ import {
StyleSheet,
useWindowDimensions,
} from 'react-native';
+import { useTranslation } from 'react-i18next';
import { BlurBackdrop } from '@/session/BlurBackdrop';
import { useModalFadeLifecycle } from '@/session/useModalFadeLifecycle';
import { useThemedStyles, type ThemeColors } from '@/theme';
@@ -53,6 +54,7 @@ export function SheetModal({
children,
}: SheetModalProps) {
const styles = useThemedStyles(makeStyles);
+ const { t } = useTranslation();
const { height: windowHeight } = useWindowDimensions();
// 背板淡入 + 面板滑入共用一条 progress;关闭淡出/滑出播完后再卸载 Modal。
const { mounted, progress, onShowStartIn } = useModalFadeLifecycle(visible, {
@@ -118,7 +120,7 @@ export function SheetModal({
<Animated.View style={backdropStyle}>
<BlurBackdrop />
<Pressable
- accessibilityLabel="关闭面板"
+ accessibilityLabel={t('shared.closePanel')}
accessibilityRole="button"
onPress={onBackdropPress}
style={styles.backdropPressable}
diff --git a/apps/mobile/src/session/SheetSurface.tsx b/apps/mobile/src/session/SheetSurface.tsx
index bbeeef48f7..9f1847a704 100644
--- a/apps/mobile/src/session/SheetSurface.tsx
+++ b/apps/mobile/src/session/SheetSurface.tsx
@@ -13,6 +13,7 @@
* 不依赖「Modal 不可见时 children 是否卸载」的平台差异来重置。
*/
import type { ReactNode, RefObject } from 'react';
+import { useTranslation } from 'react-i18next';
import { ChevronLeft } from 'lucide-react-native';
import { Animated, Pressable, ScrollView, View, type StyleProp, type ViewStyle } from 'react-native';
import { Text } from '@/components/AppText';
@@ -71,6 +72,7 @@ export function SheetSurface({
}: SheetSurfaceProps) {
const styles = useThemedStyles(makeSheetSurfaceStyles);
const { colors } = useTheme();
+ const { t } = useTranslation();
const drag = useContextSheetDrag({
heights,
onDismiss: onClose,
@@ -96,7 +98,7 @@ export function SheetSurface({
<View style={styles.header}>
{onBack ? (
<Pressable
- accessibilityLabel={backAccessibilityLabel ?? '返回'}
+ accessibilityLabel={backAccessibilityLabel ?? t('shared.back')}
accessibilityRole="button"
hitSlop={8}
onPress={onBack}
diff --git a/apps/mobile/src/session/SwipeableSessionRow.tsx b/apps/mobile/src/session/SwipeableSessionRow.tsx
index 4df8699f09..a382d31949 100644
--- a/apps/mobile/src/session/SwipeableSessionRow.tsx
+++ b/apps/mobile/src/session/SwipeableSessionRow.tsx
@@ -37,6 +37,7 @@ import Animated, {
type SharedValue,
} from 'react-native-reanimated';
import { Archive, Ellipsis, Pin, PinOff } from 'lucide-react-native';
+import { useTranslation } from 'react-i18next';
import { pinToggleAction, type SwipeRowRegistry } from '@/session/swipeRowRegistry';
import type { RemoteSession } from '@/session/types';
import { iconSize, iconStroke, useTheme, useThemedStyles, type ThemeColors } from '@/theme';
@@ -283,6 +284,7 @@ function RightActionsPanel({
translation: SharedValue<number>;
}) {
const { colors } = useTheme();
+ const { t } = useTranslation();
// armed = 位移越过全滑阈值。独立 SharedValue 只在跨越阈值时写入,避免
// useDerivedValue 里对逐帧变化的 translation 直接 withTiming(目标每帧重设,动画走不完)。
const armed = useSharedValue(false);
@@ -323,7 +325,7 @@ function RightActionsPanel({
<View style={styles.rightShell}>
<Animated.View style={[styles.optionsButton, optionsStyle]}>
<Pressable
- accessibilityLabel="更多选项"
+ accessibilityLabel={t('session.row.moreOptions')}
accessibilityRole="button"
onPress={onOptions}
style={styles.actionPressable}
@@ -336,7 +338,7 @@ function RightActionsPanel({
</Animated.View>
<Animated.View style={[styles.archiveButton, archiveStyle]}>
<Pressable
- accessibilityLabel="归档对话"
+ accessibilityLabel={t('session.row.archiveConversation')}
accessibilityRole="button"
onPress={onArchive}
style={styles.actionPressable}
diff --git a/apps/mobile/src/session/agentAuthGate.ts b/apps/mobile/src/session/agentAuthGate.ts
index 49770ca8f5..58248c46ed 100644
--- a/apps/mobile/src/session/agentAuthGate.ts
+++ b/apps/mobile/src/session/agentAuthGate.ts
@@ -13,6 +13,8 @@
import { connectedProvidersForAgent } from '@cindy/model-providers/registry';
import type { ProviderView } from '@cindy/model-providers/registry';
+import { i18n } from '@/i18n';
+
export type AgentAuthGateVerdict = 'ready' | 'unauthenticated' | 'unknown';
export interface AgentAuthGateInput {
@@ -36,5 +38,5 @@ export function agentAuthGateVerdict(input: AgentAuthGateInput): AgentAuthGateVe
/** 未鉴权时的提示文案(与 describeAgentAuthError 的引导口径一致)。 */
export function agentAuthGateHint(agentKind: 'claude-code' | 'codex'): string {
const label = agentKind === 'claude-code' ? 'Claude' : 'Codex';
- return `${label} 在这台电脑上还没有已连接的模型供应商,发送会失败。请在电脑端 Cindy 的「设置 → 模型供应商」完成配置。`;
+ return i18n.t('session.row.authGateHint', { agent: label });
}
diff --git a/apps/mobile/src/session/attachments.ts b/apps/mobile/src/session/attachments.ts
index b7fe01e6a8..9f0ef32789 100644
--- a/apps/mobile/src/session/attachments.ts
+++ b/apps/mobile/src/session/attachments.ts
@@ -1,4 +1,5 @@
import { stripTrailingPathSeparators } from '@cindy/maker-shared/path-text';
+import { i18n } from '@/i18n';
import type { RemoteFileRef, RemoteImageRef, RemoteSerializedAttachment } from '@/session/types';
import { buildLegacyAttachmentOssRef } from '@/session/attachmentOssRef';
@@ -57,10 +58,10 @@ const KNOWN_TEXT_FILENAMES = new Set([
/** 本机文件附件的体积校验(乐观上传后台任务里执行,超限 throw 由失败回调呈现)。 */
export function assertMobileDocumentSize(size: number): void {
if (!Number.isFinite(size) || size <= 0) {
- throw new Error('这个文件为空,不能作为附件发送。');
+ throw new Error(i18n.t('composer.upload.emptyFile'));
}
if (size > MOBILE_MAX_ATTACHMENT_BYTES) {
- throw new Error(`文件超过 ${Math.round(MOBILE_MAX_ATTACHMENT_BYTES / 1024 / 1024)} MB,暂不能作为附件发送。`);
+ throw new Error(i18n.t('composer.upload.fileTooLarge', { size: Math.round(MOBILE_MAX_ATTACHMENT_BYTES / 1024 / 1024) }));
}
}
diff --git a/apps/mobile/src/session/chatFileChipMenuModel.ts b/apps/mobile/src/session/chatFileChipMenuModel.ts
index 4b28711296..fea29c1f1e 100644
--- a/apps/mobile/src/session/chatFileChipMenuModel.ts
+++ b/apps/mobile/src/session/chatFileChipMenuModel.ts
@@ -4,6 +4,7 @@
* 「打开」直接就是文件浏览器定位),渲染层只按 key 映射图标与回调。
*/
+import { i18n } from '@/i18n';
import type { ChatFilePathTarget } from '@/session/chatFilePathContext';
import { pathDisplayName } from '@/session/chatPathCandidate';
@@ -36,18 +37,18 @@ export function chatFileChipMenuTitle(target: ChatFilePathTarget): string {
export function chatFileChipMenuRows(target: ChatFilePathTarget): ChatFileChipMenuRow[] {
if (target.kind === 'directory') {
return [
- { key: 'open', label: '打开文件浏览器' },
- { key: 'sendToSession', label: '发送到会话' },
- { key: 'copyPath', label: '复制路径' },
+ { key: 'open', label: i18n.t('composer.attachments.fileMenu.openBrowser') },
+ { key: 'sendToSession', label: i18n.t('composer.attachments.fileMenu.sendToSession') },
+ { key: 'copyPath', label: i18n.t('composer.attachments.fileMenu.copyPath') },
];
}
return [
- { key: 'open', label: '快速预览' },
+ { key: 'open', label: i18n.t('composer.attachments.fileMenu.quickPreview') },
...(target.relPath !== null
- ? [{ key: 'revealInBrowser', label: '在文件浏览器中查看' } as const]
+ ? [{ key: 'revealInBrowser', label: i18n.t('composer.attachments.fileMenu.revealInBrowser') } as const]
: []),
- { key: 'sendToSession', label: '发送到会话' },
- { key: 'copyPath', label: '复制路径' },
- { key: 'share', label: '导出 / 分享' },
+ { key: 'sendToSession', label: i18n.t('composer.attachments.fileMenu.sendToSession') },
+ { key: 'copyPath', label: i18n.t('composer.attachments.fileMenu.copyPath') },
+ { key: 'share', label: i18n.t('composer.attachments.fileMenu.share') },
];
}
diff --git a/apps/mobile/src/session/fileBrowserExport.ts b/apps/mobile/src/session/fileBrowserExport.ts
index 66d1500306..74304b7ac1 100644
--- a/apps/mobile/src/session/fileBrowserExport.ts
+++ b/apps/mobile/src/session/fileBrowserExport.ts
@@ -3,6 +3,7 @@
* 分享/下载共用)。结果按 path+mtime 缓存到 presign 过期,同一文件重看零导出;
* 起始与每次状态轮询都走瞬断重试;isCancelled(页面卸载)时中止轮询。
*/
+import { i18n } from '@/i18n';
import { withTransientRemoteRetry } from '@/device-link/remoteRetry';
import type { MobileMakerTransport } from '@/device-link/mobileMakerTransport';
import { getCachedExportUrl, storeCachedExportUrl } from '@/session/fileBrowserCache';
@@ -32,24 +33,24 @@ export async function exportRemoteFileToUrl(
await deps.openLink(deps.deviceId);
return deps.maker.fileBrowser.exportFileStart(workdir, relPath);
});
- if (!start.ok) throw new Error(start.message ?? '导出失败');
+ if (!start.ok) throw new Error(start.message ?? i18n.t('files.export.exportFailed'));
const deadline = Date.now() + EXPORT_TIMEOUT_MS;
for (;;) {
- if (deps.isCancelled?.()) throw new Error('已离开页面,导出中止');
+ if (deps.isCancelled?.()) throw new Error(i18n.t('files.export.leftPage'));
// 单次状态查询同样走瞬断重试:被控端导出任务仍在跑,轮询窗口内一次
// 掉线/超时不应让整个导出失败。
const status = await withTransientRemoteRetry(async () => {
await deps.openLink(deps.deviceId);
return deps.maker.fileBrowser.exportFileStatus(workdir, start.transferId);
});
- if (!status.ok) throw new Error(status.message ?? '导出失败');
+ if (!status.ok) throw new Error(status.message ?? i18n.t('files.export.exportFailed'));
if (status.state === 'done' && status.key) {
const presign = await deps.presignGet(status.key);
storeCachedExportUrl(deps.deviceId, workdir, relPath, mtimeMs, presign.getUrl, presign.expiresAt);
return presign.getUrl;
}
- if (status.state === 'error') throw new Error(status.message ?? '导出失败');
- if (Date.now() > deadline) throw new Error('导出超时,请重试');
+ if (status.state === 'error') throw new Error(status.message ?? i18n.t('files.export.exportFailed'));
+ if (Date.now() > deadline) throw new Error(i18n.t('files.export.exportTimeout'));
await new Promise<void>((resolve) => setTimeout(resolve, EXPORT_POLL_INTERVAL_MS));
}
}
diff --git a/apps/mobile/src/session/fileBrowserGallery.ts b/apps/mobile/src/session/fileBrowserGallery.ts
index 7abaa45be4..2bb899e3ec 100644
--- a/apps/mobile/src/session/fileBrowserGallery.ts
+++ b/apps/mobile/src/session/fileBrowserGallery.ts
@@ -8,6 +8,7 @@
* lightbox 经 onResolveRemoteMedia 走「取件上传 OSS → presign」既有管线拿到
* 可显示 URL,对老版本被控端同样生效,零新协议。
*/
+import { i18n } from '@/i18n';
import { buildMediaPayload } from '@/session/messagePayload';
import type { MobileMessageGalleryImage } from '@/session/messageGallery';
import {
@@ -61,7 +62,7 @@ export function createFileBrowserMediaResolver(deps: MobileRemoteMediaResolverDe
if (cached && !opts?.forceRefresh && isResolvedRemoteMediaFresh(cached)) return cached;
// cachedOnly(lightbox 垫底预取):只吃缓存,未命中不触发取件——本 resolver 不区分
// 缩略图变体,放行会变成一次装饰性的整图导出+下载,与主取件叠成双下载。
- if (opts?.cachedOnly) throw new Error('远程媒体缓存未命中(cachedOnly)');
+ if (opts?.cachedOnly) throw new Error(i18n.t('files.gallery.cacheMiss'));
// forceRefresh(Image 加载失败自愈)映射为被控端 skipCache,穿透上传去重缓存。
const resolved = await resolveMobileRemoteMedia(media, deps, opts?.forceRefresh ? { skipCache: true } : undefined);
cache.set(media.url, resolved);
diff --git a/apps/mobile/src/session/fullAccessConfirmation.ts b/apps/mobile/src/session/fullAccessConfirmation.ts
index f0b05f19a8..8575a089b4 100644
--- a/apps/mobile/src/session/fullAccessConfirmation.ts
+++ b/apps/mobile/src/session/fullAccessConfirmation.ts
@@ -2,6 +2,8 @@ import { Alert, type AlertButton, type AlertOptions } from 'react-native';
import { getLocales } from 'expo-localization';
import { requiresFullAccessConfirmation } from '@cindy/maker-shared/permission-mode';
+import { getManualLocaleOverride } from '@/i18n/appLanguage';
+
export type FullAccessConfirmationCopy = Readonly<{
title: string;
description: string;
@@ -36,8 +38,10 @@ const FULL_ACCESS_CONFIRMATION_COPY: Record<'en' | 'ja' | 'ko' | 'zh', FullAcces
},
};
-/** 根据系统语言选择手机端 Full access 确认文案;未覆盖的语言使用英文。 */
-export function getFullAccessConfirmationCopy(languageCode = getLocales()[0]?.languageCode): FullAccessConfirmationCopy {
+/** 生效语言(手动选择优先,否则系统语言)选择手机端 Full access 确认文案;未覆盖的语言使用英文。 */
+export function getFullAccessConfirmationCopy(
+ languageCode = getManualLocaleOverride() ?? getLocales()[0]?.languageCode,
+): FullAccessConfirmationCopy {
const normalized = languageCode?.toLowerCase() ?? '';
const language = normalized.startsWith('zh')
? 'zh'
diff --git a/apps/mobile/src/session/homeSections.ts b/apps/mobile/src/session/homeSections.ts
index 396b6fe37c..46929eb283 100644
--- a/apps/mobile/src/session/homeSections.ts
+++ b/apps/mobile/src/session/homeSections.ts
@@ -1,3 +1,4 @@
+import { i18n } from '@/i18n';
import type { MobileHomePresentation, MobileHomeProjectGroup } from './mobileHome';
import type { RemoteSessionListItem } from './sessionList';
@@ -28,7 +29,7 @@ export function buildHomeSections(
? []
: home.pinned.map((item) => ({ item, key: `pinned:${item.session.id}`, kind: 'session', source: 'pinned' })),
key: 'pinned',
- title: '置顶',
+ title: i18n.t('session.row.pinnedSection'),
});
}
diff --git a/apps/mobile/src/session/interactionModel.ts b/apps/mobile/src/session/interactionModel.ts
index 26784885df..b14721487d 100644
--- a/apps/mobile/src/session/interactionModel.ts
+++ b/apps/mobile/src/session/interactionModel.ts
@@ -4,6 +4,7 @@ import {
type PendingInteractionLike,
type PermissionReviewPresentation,
} from '@cindy/maker-shared/interaction';
+import { i18n } from '@/i18n';
export {
answerKey,
@@ -56,9 +57,9 @@ export function buildMobilePermissionCardState(input: {
canShowAlwaysAllow: input.presentation.canAlwaysAllow && !isHighRisk,
isHighRisk,
riskWarningText: input.presentation.riskSummary
- ? (armed ? '确认允许后才会把决定回传到电脑端。' : input.presentation.riskSummary)
+ ? (armed ? i18n.t('interaction.permission.armedRiskWarning') : input.presentation.riskSummary)
: null,
- title: isHighRisk && armed ? '确认高风险操作' : input.presentation.title,
+ title: isHighRisk && armed ? i18n.t('interaction.permission.armedHighRiskTitle') : input.presentation.title,
};
}
diff --git a/apps/mobile/src/session/mermaidWebViewHtml.ts b/apps/mobile/src/session/mermaidWebViewHtml.ts
index fa29e73886..d5e7359ae7 100644
--- a/apps/mobile/src/session/mermaidWebViewHtml.ts
+++ b/apps/mobile/src/session/mermaidWebViewHtml.ts
@@ -8,6 +8,7 @@
import { repairMermaidSource } from '@cindy/maker-shared/mermaid-autofix';
import { lightColors } from '@/theme/tokens';
+import { i18n } from '@/i18n';
export const MOBILE_MERMAID_VERSION = '11.14.0';
@@ -50,8 +51,11 @@ export function buildMermaidWebViewHtml(source: string, theme: MermaidWebViewCol
: 'width=device-width, initial-scale=1, maximum-scale=1';
const trimmed = source.trim();
const deferSource = !!theme.deferSource;
+ // 空图占位文案在调用点求值(HTML 生成时),注入首屏与脚本降级两处;不硬编码。
+ const emptyDiagramLabel = i18n.t('message.renderer.mermaidEmpty');
+ const serializedEmptyDiagramLabel = serializeForScript(emptyDiagramLabel);
// deferSource:首屏留空(干净背景),源码只作降级;否则源码即首屏(弱网零白条)。
- const firstFrameHtml = deferSource ? '' : `<pre>${escapeHtmlText(trimmed) || '空 Mermaid 图表。'}</pre>`;
+ const firstFrameHtml = deferSource ? '' : `<pre>${escapeHtmlText(trimmed) || escapeHtmlText(emptyDiagramLabel)}</pre>`;
// deferSource 模式下,CDN 全部耗尽 / 空源码这两条「静默停留首屏」的路径必须
// 显式降级到源码,否则页面永远空白。
const exhaustFallback = deferSource ? 'showSource();' : '';
@@ -123,7 +127,7 @@ export function buildMermaidWebViewHtml(source: string, theme: MermaidWebViewCol
function showSource(label) {
root.className = 'source';
const pre = document.createElement('pre');
- pre.textContent = source || '空 Mermaid 图表。';
+ pre.textContent = source || ${serializedEmptyDiagramLabel};
root.innerHTML = '';
if (label) {
const notice = document.createElement('div');
diff --git a/apps/mobile/src/session/messageActions.ts b/apps/mobile/src/session/messageActions.ts
index c65d8bbeda..88e8d07b2e 100644
--- a/apps/mobile/src/session/messageActions.ts
+++ b/apps/mobile/src/session/messageActions.ts
@@ -1,5 +1,6 @@
import type { NormalizedRemoteMessage } from '@/session/messageNormalize';
import { stripChatQuoteMarkerLines } from '@cindy/maker-shared/chat-quotes';
+import { i18n } from '@/i18n';
export type CopyMessageStatus = 'copied' | 'empty' | 'failed';
@@ -26,7 +27,7 @@ export function buildMobileMessageCopyText(message: NormalizedRemoteMessage): st
if (message.secondaryBody) parts.push(message.secondaryBody);
const attachments = message.attachments?.map((item) => item.name).filter(Boolean) ?? [];
if (attachments.length > 0) {
- parts.push(`附件:${attachments.join(', ')}`);
+ parts.push(i18n.t('message.actions.attachmentsPrefix', { names: attachments.join(', ') }));
}
return parts.filter((part) => part.trim().length > 0).join('\n\n');
}
@@ -84,9 +85,9 @@ export function formatMessageRelativeTime(createdAt: string, now = Date.now()):
const hour = 60 * minute;
const day = 24 * hour;
- if (diffMs < minute) return '刚刚';
- if (diffMs < hour) return `${Math.floor(diffMs / minute)} 分钟前`;
- if (diffMs < day) return `${Math.floor(diffMs / hour)} 小时前`;
+ if (diffMs < minute) return i18n.t('message.actions.justNow');
+ if (diffMs < hour) return i18n.t('message.actions.minutesAgo', { n: Math.floor(diffMs / minute) });
+ if (diffMs < day) return i18n.t('message.actions.hoursAgo', { n: Math.floor(diffMs / hour) });
const date = new Date(timestamp);
const current = new Date(now);
@@ -109,7 +110,7 @@ export function formatMessageAbsoluteTime(createdAt: string): string {
export function formatMessageTurnCostUsd(costUsd: number, isEstimate = false): string {
if (!Number.isFinite(costUsd) || costUsd <= 0) return '';
const value = formatTurnCostUsd(costUsd);
- return isEstimate ? `价值 ${value}` : value;
+ return isEstimate ? i18n.t('message.actions.turnCostValue', { value }) : value;
}
/**
diff --git a/apps/mobile/src/session/messageGallery.ts b/apps/mobile/src/session/messageGallery.ts
index 74f89c36e2..c48363e374 100644
--- a/apps/mobile/src/session/messageGallery.ts
+++ b/apps/mobile/src/session/messageGallery.ts
@@ -10,6 +10,7 @@ import { buildAttachmentPayload, buildMediaPayload } from '@/session/messagePayl
import type { MobileMessageRenderItem, MobileWorkChildItem } from '@/session/messageRenderModel';
import { logUnhandledRenderItem } from '@/session/assertNever';
import { applySentAttachmentThumbOverlay } from '@/session/sentAttachmentThumbStore';
+import { i18n } from '@/i18n';
export interface MobileMessageGalleryImage {
key: string;
@@ -91,7 +92,7 @@ export function collectMobileMessageGalleryImages(
const pushMedia = (media: NormalizedToolMedia, key: string) => {
if (media.kind !== 'image') return;
- const title = media.title || media.url.split('/').pop() || '图片';
+ const title = media.title || media.url.split('/').pop() || i18n.t('message.renderer.imageFallbackTitle');
const payload = buildMediaPayload(media, title);
if (payload.kind === 'media') push(key, title, payload);
};
diff --git a/apps/mobile/src/session/messageMarkdown.ts b/apps/mobile/src/session/messageMarkdown.ts
index 9577975ba9..4e6813b960 100644
--- a/apps/mobile/src/session/messageMarkdown.ts
+++ b/apps/mobile/src/session/messageMarkdown.ts
@@ -1,6 +1,7 @@
import { normalizeMathDelimiters } from '@cindy/maker-shared/math-markdown';
import { classifyChatPathLinkTarget, resolveChatAbsPath } from '@/session/chatPathCandidate';
import { DEEP_LINK_SCHEME_GROUP } from '@/session/sessionLinks';
+import { i18n } from '@/i18n';
export type MobileMarkdownInline =
| { type: 'text'; text: string }
@@ -461,9 +462,9 @@ export function mobileMarkdownImageTitle(url: string, alt?: string): string {
if (trimmedAlt) return trimmedAlt;
const fileName = url.split('?')[0].split('#')[0].split('/').pop() ?? '';
try {
- return decodeURIComponent(fileName) || '图片';
+ return decodeURIComponent(fileName) || i18n.t('message.renderer.imageFallbackTitle');
} catch {
- return fileName || '图片';
+ return fileName || i18n.t('message.renderer.imageFallbackTitle');
}
}
diff --git a/apps/mobile/src/session/messagePayload.ts b/apps/mobile/src/session/messagePayload.ts
index 92128a80bf..4e61cfbfcc 100644
--- a/apps/mobile/src/session/messagePayload.ts
+++ b/apps/mobile/src/session/messagePayload.ts
@@ -38,6 +38,7 @@ import {
type PayloadAttachmentLike,
type SharedMessagePayload,
} from '@cindy/maker-shared/payload-summary';
+import { i18n } from '@/i18n';
export type MessagePayload = SharedMessagePayload<NormalizedToolDiff, NormalizedToolMedia>;
@@ -74,7 +75,7 @@ export {
export function buildToolResultPayload(tool: NormalizedRemoteMessage): MessagePayload | null {
if (!tool.secondaryBody) return null;
- return buildTextPayload(`${tool.label || 'tool'} 输出`, tool.secondaryBody);
+ return buildTextPayload(i18n.t('message.renderer.toolOutputTitle', { label: tool.label || 'tool' }), tool.secondaryBody);
}
export function buildDiffPayload(diff: NormalizedToolDiff): MessagePayload {
diff --git a/apps/mobile/src/session/mobileAttachmentSha256.ts b/apps/mobile/src/session/mobileAttachmentSha256.ts
index 9cc82ebade..9f17104eda 100644
--- a/apps/mobile/src/session/mobileAttachmentSha256.ts
+++ b/apps/mobile/src/session/mobileAttachmentSha256.ts
@@ -1,5 +1,6 @@
import { sha256 } from '@noble/hashes/sha256';
+import { i18n } from '@/i18n';
const HASH_CHUNK_BYTES = 1024 * 1024;
const BASE64_ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
@@ -26,12 +27,12 @@ export async function sha256MobileAttachmentFile(
const readChunk = options.readChunk ?? readFileChunkBase64;
const hash = sha256.create();
for (let position = 0; position < expectedSize; position += HASH_CHUNK_BYTES) {
- if (options.signal?.aborted) throw new Error('附件上传已取消。');
+ if (options.signal?.aborted) throw new Error(i18n.t('composer.upload.cancelled'));
const length = Math.min(HASH_CHUNK_BYTES, expectedSize - position);
const encoded = await readChunk(uri, position, length);
const bytes = decodeBase64(encoded);
if (bytes.byteLength !== length) {
- throw new Error(`文件读取不完整:预期 ${length} 字节,实际 ${bytes.byteLength} 字节。`);
+ throw new Error(i18n.t('composer.upload.incompleteRead', { expected: length, actual: bytes.byteLength }));
}
hash.update(bytes);
}
@@ -49,7 +50,7 @@ export async function sha256MobileAttachmentBody(
if (body instanceof Blob) {
for (let position = 0; position < body.size; position += HASH_CHUNK_BYTES) {
- if (signal?.aborted) throw new Error('附件上传已取消。');
+ if (signal?.aborted) throw new Error(i18n.t('composer.upload.cancelled'));
const bytes = new Uint8Array(
await body.slice(position, position + HASH_CHUNK_BYTES).arrayBuffer(),
);
@@ -69,11 +70,11 @@ export async function sha256MobileAttachmentBody(
seen = bytes.byteLength;
hash.update(bytes);
} else {
- throw new Error('当前附件上传体无法进行完整性校验。');
+ throw new Error(i18n.t('composer.upload.integrityUnavailable'));
}
if (seen !== expectedSize) {
- throw new Error(`附件大小已变化:预期 ${expectedSize} 字节,实际 ${seen} 字节。`);
+ throw new Error(i18n.t('composer.upload.sizeChanged', { expected: expectedSize, actual: seen }));
}
return toHex(hash.digest());
}
@@ -91,7 +92,7 @@ async function readFileChunkBase64(uri: string, position: number, length: number
function assertExpectedSize(size: number): void {
if (!Number.isSafeInteger(size) || size <= 0) {
- throw new Error('附件大小无效,无法计算完整性摘要。');
+ throw new Error(i18n.t('composer.upload.invalidSize'));
}
}
@@ -133,8 +134,8 @@ function decodeBase64(input: string): Uint8Array {
}
function decodeBase64Char(char: string | undefined): number {
- if (!char) throw new Error('附件分块不是有效的 base64。');
+ if (!char) throw new Error(i18n.t('composer.upload.invalidBase64'));
const index = BASE64_ALPHABET.indexOf(char);
- if (index < 0) throw new Error('附件分块不是有效的 base64。');
+ if (index < 0) throw new Error(i18n.t('composer.upload.invalidBase64'));
return index;
}
diff --git a/apps/mobile/src/session/mobileAttachmentUpload.ts b/apps/mobile/src/session/mobileAttachmentUpload.ts
index 5392ef370b..8c9612f26f 100644
--- a/apps/mobile/src/session/mobileAttachmentUpload.ts
+++ b/apps/mobile/src/session/mobileAttachmentUpload.ts
@@ -1,5 +1,6 @@
import { apiFetchRaw } from '@/api/client';
import { DEVICE_LINK_API_BASE_URL } from '@/config/env';
+import { i18n } from '@/i18n';
import { withTransientRemoteRetry } from '@/device-link/remoteRetry';
import { isAttachmentOssRef, parseAttachmentOssRef } from '@/session/attachmentOssRef';
import {
@@ -120,11 +121,11 @@ export async function putMobileAttachmentUpload(
}
if (!response.ok) {
const code = extractOssErrorCode(await readResponseTextSafe(response));
- throw new Error(`附件上传失败: HTTP ${response.status}${code ? ` (${code})` : ''}`);
+ throw new Error(i18n.t('composer.upload.failedHttp', { status: response.status, code: code ? ` (${code})` : '' }));
}
return;
}
- throw new Error(`附件上传失败:网络传输异常,请检查网络后重试。(${summarizeTransportError(transportError)})`);
+ throw new Error(i18n.t('composer.upload.failedNetwork', { detail: summarizeTransportError(transportError) }));
}
function buildMobileAttachmentUploadHeaders(mimeType: string | undefined): Record<string, string> {
@@ -171,7 +172,7 @@ async function uploadFileNative(
opts: { signal?: AbortSignal } = {},
): Promise<{ status: number; body?: string }> {
const FileSystem = await import('expo-file-system/legacy');
- if (opts.signal?.aborted) throw new Error(UPLOAD_ABORTED_MESSAGE);
+ if (opts.signal?.aborted) throw new Error(uploadAbortedMessage());
const task = FileSystem.createUploadTask(putUrl, fileUri, {
headers,
httpMethod: 'PUT',
@@ -185,7 +186,7 @@ async function uploadFileNative(
try {
const result = await task.uploadAsync();
// 取消后 uploadAsync resolve undefined/null(而非 reject),归一化成异常让上层分诊。
- if (!result) throw new Error(UPLOAD_ABORTED_MESSAGE);
+ if (!result) throw new Error(uploadAbortedMessage());
return { status: result.status, body: result.body };
} finally {
opts.signal?.removeEventListener('abort', onAbort);
@@ -203,8 +204,10 @@ const UPLOAD_TRANSPORT_ATTEMPTS = 2;
*/
const PUT_FILE_TIMEOUT_MS = 120_000;
-const UPLOAD_ABORTED_MESSAGE = '附件上传已取消。';
-const UPLOAD_TIMEOUT_MESSAGE = '附件上传超时,请检查网络后重试。';
+// i18n 文案取值放函数里(而非模块顶层常量):模块顶层求值会把语言冻结在加载时刻,
+// LocaleProvider 挂载后的语言切换就读不到,故在抛错点当场求值。
+const uploadAbortedMessage = () => i18n.t('composer.upload.cancelled');
+const uploadTimeoutMessage = () => i18n.t('composer.upload.timeout');
export async function putMobileAttachmentUploadFromFile(
putUrl: string,
@@ -219,7 +222,7 @@ export async function putMobileAttachmentUploadFromFile(
// 拿到 HTTP 状态码的失败(403 签名/权限类)重试无意义,直接抛。
let transportError: unknown;
for (let attempt = 0; attempt < UPLOAD_TRANSPORT_ATTEMPTS; attempt += 1) {
- if (opts.signal?.aborted) throw new Error(UPLOAD_ABORTED_MESSAGE);
+ if (opts.signal?.aborted) throw new Error(uploadAbortedMessage());
// 每次尝试独立的超时窗;外部取消(用户 X 掉 / 页面退出)与超时共用一个
// 传给传输层的 signal,层内只管断传输,这里负责把两种中止分诊成不同结局。
const timeout = new AbortController();
@@ -234,9 +237,9 @@ export async function putMobileAttachmentUploadFromFile(
}));
} catch (err) {
// 外部取消:立刻收手,不重试(调用方自己发起的中止,静默语义由上层决定)。
- if (opts.signal?.aborted) throw new Error(UPLOAD_ABORTED_MESSAGE);
+ if (opts.signal?.aborted) throw new Error(uploadAbortedMessage());
// 超时:不进第二轮(再等 120s 只会让用户在失败卡出现前多干等一轮),直接报错。
- if (timeout.signal.aborted) throw new Error(UPLOAD_TIMEOUT_MESSAGE);
+ if (timeout.signal.aborted) throw new Error(uploadTimeoutMessage());
transportError = err;
continue;
} finally {
@@ -247,11 +250,11 @@ export async function putMobileAttachmentUploadFromFile(
// 拿到 HTTP 状态码的失败重试无意义,直接抛;带上 OSS 错误 Code
// (SignatureDoesNotMatch / AccessDenied / …),否则裸 403 无法定位。
const code = extractOssErrorCode(body);
- throw new Error(`附件上传失败: HTTP ${status}${code ? ` (${code})` : ''}`);
+ throw new Error(i18n.t('composer.upload.failedHttp', { status, code: code ? ` (${code})` : '' }));
}
return;
}
- throw new Error(`附件上传失败:网络传输异常,请检查网络后重试。(${summarizeTransportError(transportError)})`);
+ throw new Error(i18n.t('composer.upload.failedNetwork', { detail: summarizeTransportError(transportError) }));
}
/** 原生 NSError 描述冗长(整条预签名 URL 都在里面),截前段给用户当排查线索即可。 */
@@ -278,7 +281,7 @@ export async function uploadMobileAttachment(
// 也没有 delete 回收的孤儿对象(泄漏用户数据 + 占用存储)。类型判定复用
// categorizeMobileAttachment 这一唯一真源,保证与下面最终校验同口径。
if (!categorizeMobileAttachment(candidate.name)) {
- throw new Error('这个本机文件类型暂不支持作为附件发送。');
+ throw new Error(i18n.t('composer.upload.fileTypeUnsupported'));
}
assertMobileDocumentSize(candidate.size);
const sha256 = await sha256MobileAttachmentBody(body, candidate.size);
@@ -293,7 +296,7 @@ export async function uploadMobileAttachment(
mimeType: candidate.mimeType,
});
if (!attachment) {
- throw new Error('这个本机文件类型暂不支持作为附件发送。');
+ throw new Error(i18n.t('composer.upload.fileTypeUnsupported'));
}
return attachment;
}
@@ -311,7 +314,7 @@ export async function uploadMobileAttachmentFromFile(
): Promise<RemoteSerializedAttachment> {
// 同 uploadMobileAttachment:presign 前先拦不支持的类型,避免 OSS 孤儿对象。
if (!categorizeMobileAttachment(candidate.name)) {
- throw new Error('这个本机文件类型暂不支持作为附件发送。');
+ throw new Error(i18n.t('composer.upload.fileTypeUnsupported'));
}
assertMobileDocumentSize(candidate.size);
const snapshot = options.deps?.snapshotFile
@@ -349,7 +352,7 @@ export async function uploadMobileAttachmentFromFile(
mimeType: candidate.mimeType,
});
if (!attachment) {
- throw new Error('这个本机文件类型暂不支持作为附件发送。');
+ throw new Error(i18n.t('composer.upload.fileTypeUnsupported'));
}
return attachment;
} finally {
@@ -364,13 +367,13 @@ async function snapshotMobileAttachmentFile(uri: string): Promise<{
}> {
const FileSystem = await import('expo-file-system/legacy');
const dir = FileSystem.cacheDirectory;
- if (!dir) throw new Error('无法创建附件快照:缓存目录不可用');
+ if (!dir) throw new Error(i18n.t('composer.upload.snapshotFailedNoCacheDir'));
const snapshotUri = `${dir}device-link-upload-${Date.now()}-${Math.random().toString(36).slice(2)}`;
await FileSystem.copyAsync({ from: uri, to: snapshotUri });
const info = await FileSystem.getInfoAsync(snapshotUri);
if (!info.exists || typeof info.size !== 'number') {
await FileSystem.deleteAsync(snapshotUri, { idempotent: true }).catch(() => undefined);
- throw new Error('无法创建附件快照');
+ throw new Error(i18n.t('composer.upload.snapshotFailed'));
}
return {
uri: snapshotUri,
@@ -427,7 +430,7 @@ function uploadExtForName(name: string): string {
function normalizePresignResult(value: MobileAttachmentPresignResult): MobileAttachmentPresignResult {
if (!value || typeof value.putUrl !== 'string' || typeof value.key !== 'string') {
- throw new Error('服务端没有返回有效的附件上传地址。');
+ throw new Error(i18n.t('composer.upload.invalidUploadUrl'));
}
return {
putUrl: value.putUrl,
diff --git a/apps/mobile/src/session/mobileCindyVoiceSession.ts b/apps/mobile/src/session/mobileCindyVoiceSession.ts
index 93ab934380..98913700e9 100644
--- a/apps/mobile/src/session/mobileCindyVoiceSession.ts
+++ b/apps/mobile/src/session/mobileCindyVoiceSession.ts
@@ -2,6 +2,7 @@ import Constants from 'expo-constants';
import { ApiError, type ApiFetchOptions } from '@/api/client';
import { VOICE_API_BASE_URL } from '@/config/env';
+import { i18n } from '@/i18n';
import type {
MobileVoiceCredentialSyncAsr,
MobileVoiceCredentialSyncRefiner,
@@ -111,7 +112,7 @@ export class MobileCindyVoiceRunContext {
|| session.asr?.provider !== asrProvider
|| !/^wss?:\/\//.test(session.asr.websocketUrl)
) {
- throw new Error('语音服务返回了无效会话。');
+ throw new Error(i18n.t('composer.voice.invalidSession'));
}
return session;
}
@@ -121,9 +122,9 @@ export class MobileCindyVoiceRunContext {
authorization: string;
}> {
if (this.refinerUnavailableOnServer) {
- throw new Error('当前 Cindy 语音服务暂不支持托管润色。');
+ throw new Error(i18n.t('composer.voice.managedRefineUnsupported'));
}
- if (!this.latestSessionId) throw new Error('语音识别会话尚未连接。');
+ if (!this.latestSessionId) throw new Error(i18n.t('composer.voice.sessionNotConnected'));
const token = await this.requireAccessToken(options?.refreshAccessToken);
return {
url: `${requireVoiceBaseUrl()}/api/voice/sessions/${encodeURIComponent(this.latestSessionId)}/refine?provider=${encodeURIComponent(refinerProvider)}`,
@@ -142,10 +143,10 @@ export class MobileCindyVoiceRunContext {
promptCacheKey: string;
}): Promise<void> {
if (this.refinerUnavailableOnServer) {
- throw new Error('当前 Cindy 语音服务暂不支持托管润色。');
+ throw new Error(i18n.t('composer.voice.managedRefineUnsupported'));
}
const sessionId = this.latestSessionId;
- if (!sessionId) throw new Error('语音识别会话尚未连接。');
+ if (!sessionId) throw new Error(i18n.t('composer.voice.sessionNotConnected'));
// 非 2xx 由 apiFetch 抛 ApiError;超时同样抛错,由调用方仅记录。
await this.apiFetch(
`/api/voice/sessions/${encodeURIComponent(sessionId)}/refine-warmup`,
@@ -166,7 +167,7 @@ export class MobileCindyVoiceRunContext {
private async requireAccessToken(refreshAccessToken = false): Promise<string> {
const token = await (refreshAccessToken ? this.refreshAccessToken : this.getAccessToken)();
- if (!token) throw new Error('请先登录 Cindy 后再使用语音输入。');
+ if (!token) throw new Error(i18n.t('composer.voice.loginRequired'));
return token;
}
}
@@ -255,6 +256,6 @@ export function createMobileCindyVoiceCredential(hostDeviceId: string): StoredMo
}
function requireVoiceBaseUrl(): string {
- if (!VOICE_API_BASE_URL) throw new Error('当前区域未配置 Cindy 语音服务。');
+ if (!VOICE_API_BASE_URL) throw new Error(i18n.t('composer.voice.serviceUnavailable'));
return VOICE_API_BASE_URL.replace(/\/+$/, '');
}
diff --git a/apps/mobile/src/session/mobileImageAttachment.ts b/apps/mobile/src/session/mobileImageAttachment.ts
index 71bb1d5a56..102a1dfe76 100644
--- a/apps/mobile/src/session/mobileImageAttachment.ts
+++ b/apps/mobile/src/session/mobileImageAttachment.ts
@@ -1,3 +1,4 @@
+import { i18n } from '@/i18n';
import { MOBILE_MAX_ATTACHMENT_BYTES, extractRemoteFileExt } from '@/session/attachments';
import type { MobileAttachmentUploadCandidate } from '@/session/mobileAttachmentUpload';
@@ -21,7 +22,7 @@ export function buildMobileImageAttachmentCandidate(
index: number,
): MobileImageAttachmentCandidate {
const uri = asset.uri?.trim();
- if (!uri) throw new Error('没有读取到可上传的图片。');
+ if (!uri) throw new Error(i18n.t('composer.upload.noImageRead'));
const mimeType = normalizeImageMimeType(asset.mimeType, uri);
const name = normalizeImageFileName(asset.fileName, uri, mimeType, index);
const size = Number(asset.fileSize ?? 0);
@@ -37,10 +38,10 @@ export function buildMobileImageAttachmentCandidate(
export function assertMobileImageSize(size: number): void {
if (!Number.isFinite(size) || size <= 0) {
- throw new Error('这个图片为空,不能作为附件发送。');
+ throw new Error(i18n.t('composer.upload.emptyImage'));
}
if (size > MOBILE_MAX_ATTACHMENT_BYTES) {
- throw new Error(`图片超过 ${Math.round(MOBILE_MAX_ATTACHMENT_BYTES / 1024 / 1024)} MB,暂不能作为附件发送。`);
+ throw new Error(i18n.t('composer.upload.imageTooLarge', { size: Math.round(MOBILE_MAX_ATTACHMENT_BYTES / 1024 / 1024) }));
}
}
diff --git a/apps/mobile/src/session/mobileLocalAttachmentUpload.ts b/apps/mobile/src/session/mobileLocalAttachmentUpload.ts
index c48be2ee22..514a2019e3 100644
--- a/apps/mobile/src/session/mobileLocalAttachmentUpload.ts
+++ b/apps/mobile/src/session/mobileLocalAttachmentUpload.ts
@@ -17,6 +17,7 @@
*
* 纯逻辑模块,依赖注入(preprocess / upload / discard / 校验),node 可单测。
*/
+import { i18n } from '@/i18n';
import type { RemoteSerializedAttachment } from '@/session/types';
import type { MobileImagePreprocessInput, MobileImagePreprocessOutput } from '@/session/mobileImagePreprocess';
import type { AnnotationStroke } from '@/session/imageAnnotationModel';
@@ -275,8 +276,8 @@ export function createMobileLocalAttachmentUploadController(
const token = await task.token;
if (!token) {
throw new Error(task.candidate.kind === 'image'
- ? '登录已过期,请重新登录后再上传图片。'
- : '登录已过期,请重新登录后再上传附件。');
+ ? i18n.t('composer.upload.sessionExpiredImage')
+ : i18n.t('composer.upload.sessionExpiredFile'));
}
// 取消检查点 1:token 等待期间被 X 掉的任务在这里短路,跳过后面的换址/转码/降采样。
if (task.discarded) {
diff --git a/apps/mobile/src/session/mobileRealtimeAsrProvider.ts b/apps/mobile/src/session/mobileRealtimeAsrProvider.ts
index c2071bd71a..0058e8f48b 100644
--- a/apps/mobile/src/session/mobileRealtimeAsrProvider.ts
+++ b/apps/mobile/src/session/mobileRealtimeAsrProvider.ts
@@ -2,6 +2,7 @@ import type { AsrEvent, AsrProvider, AudioTrace } from '@cindy/voice-input-core'
import type { StoredMobileVoiceCredential } from '@/session/mobileVoiceCredentialStore';
import { redactMobileVoiceCredentialText } from '@/session/mobileVoiceCredentialRedaction';
import { gzip, ungzip } from 'pako';
+import { i18n } from '@/i18n';
type MobileRealtimeProtocolProfile =
| 'openai-transcription-manual'
@@ -119,7 +120,7 @@ function createSingleMobileAsrProvider(
if (credential.asr.mode === 'provider-native-websocket' && credential.asr.protocolProfile === 'volcengine-sauc-duration') {
return new MobileVolcengineSaucAsrProvider({ ...options, credential });
}
- throw new Error(`手机版实时语音暂不支持 ${credential.asr.mode} / ${credential.asr.protocolProfile ?? 'unknown'} ASR。`);
+ throw new Error(i18n.t('composer.voice.realtimeUnsupported', { detail: `${credential.asr.mode} / ${credential.asr.protocolProfile ?? 'unknown'}` }));
}
type MobileAsrCandidate = {
@@ -266,10 +267,10 @@ export class MobileRealtimeAsrProvider implements AsrProvider {
async start(): Promise<void> {
if (this.credential.asr.mode !== 'realtime-websocket') {
- throw new Error(`手机版实时语音暂不支持 ${this.credential.asr.mode} ASR。`);
+ throw new Error(i18n.t('composer.voice.realtimeUnsupported', { detail: this.credential.asr.mode }));
}
if (this.credential.asr.auth !== 'api-key') {
- throw new Error(`手机版实时语音暂不支持 ${this.credential.asr.auth} ASR 鉴权。`);
+ throw new Error(i18n.t('composer.voice.realtimeAuthUnsupported', { auth: this.credential.asr.auth }));
}
this.resetTranscriptState();
this.stopped = false;
@@ -280,7 +281,7 @@ export class MobileRealtimeAsrProvider implements AsrProvider {
private async connect(): Promise<void> {
// 托管 ticket 是唯一建连方式:BYOK/穿透 key 直拨上游的路径已删除。
if (!this.connectionProvider) {
- throw new Error('手机语音输入需要 Cindy 语音会话票据(缺少 connectionProvider)。');
+ throw new Error(i18n.t('composer.voice.missingConnectionProvider'));
}
const dynamicConnection = await this.connectionProvider(this.credential.asr.provider);
if (this.stopped) throw new Error('Realtime ASR connection stopped.');
@@ -488,11 +489,11 @@ export class MobileRealtimeAsrProvider implements AsrProvider {
this.handleCompleted(event);
break;
case 'conversation.item.input_audio_transcription.failed':
- this.callback({ type: 'error', message: this.redactError(realtimeErrorMessage(event, '实时语音识别失败。')), at: Date.now() });
+ this.callback({ type: 'error', message: this.redactError(realtimeErrorMessage(event, i18n.t('composer.voice.realtimeAsrFailed'))), at: Date.now() });
this.resolveFlushWaiters();
break;
case 'error': {
- const message = this.redactError(realtimeErrorMessage(event, '实时语音识别失败。'));
+ const message = this.redactError(realtimeErrorMessage(event, i18n.t('composer.voice.realtimeAsrFailed')));
if (this.isNonFatalServerVadFinishError(message)) {
this.resolveFlushWaiters();
break;
@@ -819,9 +820,9 @@ export class MobileVolcengineSaucAsrProvider implements AsrProvider {
async start(): Promise<void> {
if (this.credential.asr.auth !== 'api-key') {
- throw new Error(`手机版 Volcengine 语音暂不支持 ${this.credential.asr.auth} 鉴权。`);
+ throw new Error(i18n.t('composer.voice.volcengineAuthUnsupported', { auth: this.credential.asr.auth }));
}
- if (!this.credential.asr.resourceId) throw new Error('Volcengine ASR 配置缺少 resourceId。');
+ if (!this.credential.asr.resourceId) throw new Error(i18n.t('composer.voice.volcengineMissingResourceId'));
const resourceId = this.credential.asr.resourceId;
this.resetState();
@@ -831,7 +832,7 @@ export class MobileVolcengineSaucAsrProvider implements AsrProvider {
private async openSocket(resourceId: string): Promise<void> {
// 托管 ticket 是唯一建连方式:BYOK/穿透 key 直拨上游的路径已删除。
if (!this.connectionProvider) {
- throw new Error('手机语音输入需要 Cindy 语音会话票据(缺少 connectionProvider)。');
+ throw new Error(i18n.t('composer.voice.missingConnectionProvider'));
}
const dynamicConnection = await this.connectionProvider(this.credential.asr.provider);
if (this.stopped) throw new Error('Volcengine SAUC ASR connection stopped.');
@@ -1117,7 +1118,7 @@ export class MobileVolcengineSaucAsrProvider implements AsrProvider {
private async performRecover(): Promise<void> {
const resourceId = this.credential.asr.resourceId;
- if (!resourceId) throw new Error('Volcengine ASR 配置缺少 resourceId。');
+ if (!resourceId) throw new Error(i18n.t('composer.voice.volcengineMissingResourceId'));
const prefix = this.finalizedTranscript;
this.sessionTranscriptPrefix = prefix;
@@ -1255,7 +1256,7 @@ function readRealtimeProtocolProfile(credential: StoredMobileVoiceCredential): M
) {
return credential.asr.protocolProfile;
}
- throw new Error(`手机版实时语音暂不支持 ${credential.asr.protocolProfile ?? credential.asr.mode} ASR 协议。`);
+ throw new Error(i18n.t('composer.voice.realtimeProtocolUnsupported', { detail: credential.asr.protocolProfile ?? credential.asr.mode }));
}
function openAiLanguageCode(sourceLanguage: string): string | undefined {
@@ -1606,7 +1607,7 @@ function webSocketCloseBeforeReadyMessage(
): string {
const closeStatus = webSocketAuthStatus(event);
if (closeStatus) {
- return `Cindy 语音会话已失效或没有权限(WebSocket ${closeStatus})。请确认登录状态后重试。`;
+ return i18n.t('composer.voice.sessionExpiredOrForbidden', { status: closeStatus });
}
if (event.reason?.trim()) return `${fallbackMessage} (${event.reason.trim()})`;
return pendingMessage ?? fallbackMessage;
diff --git a/apps/mobile/src/session/mobileVoiceController.ts b/apps/mobile/src/session/mobileVoiceController.ts
index f73dcc0d5e..05cfd3eaa2 100644
--- a/apps/mobile/src/session/mobileVoiceController.ts
+++ b/apps/mobile/src/session/mobileVoiceController.ts
@@ -13,6 +13,7 @@ import {
type VoiceInputState,
type VoiceTimelineEvent,
} from '@cindy/voice-input-core';
+import { i18n } from '@/i18n';
import type { StoredMobileVoiceCredential } from '@/session/mobileVoiceCredentialStore';
import { redactMobileVoiceCredentialText } from '@/session/mobileVoiceCredentialRedaction';
import { createMobileAsrProvider } from '@/session/mobileRealtimeAsrProvider';
@@ -22,7 +23,7 @@ import {
buildMobileVoiceRefinementContext,
makeMobileRefinerPromptCacheKey,
MobileLiteLlmTextModelClient,
- MOBILE_VOICE_EMPTY_TRANSCRIPT_ERROR,
+ mobileVoiceEmptyTranscriptError,
type MobileVoiceDraftInsertion,
} from '@/session/mobileVoiceInput';
import { startMobileRealtimeAudio } from '@/session/mobileRealtimeAudio';
@@ -386,7 +387,7 @@ export function createMobileVoiceControllerSession(
},
onError(message, code: VoiceInputErrorCode | undefined) {
const localizedMessage = code === 'empty_transcript'
- ? MOBILE_VOICE_EMPTY_TRANSCRIPT_ERROR
+ ? mobileVoiceEmptyTranscriptError()
: redactMobileVoiceCredentialText(message, options.credential);
controllerError = new Error(localizedMessage);
options.onError?.(localizedMessage);
@@ -520,7 +521,7 @@ export function createMobileVoiceControllerSession(
await controller.stop();
if (state === 'error' || controllerError) {
runPhase = 'failed';
- throw controllerError ?? new Error('语音输入未完成,请重试。');
+ throw controllerError ?? new Error(i18n.t('composer.voice.incomplete'));
}
if (state === 'submitting' || state === 'refining') await waitForDone(doneWaiters);
if (runPhase === 'stopping') runPhase = 'idle';
@@ -655,7 +656,7 @@ function createMobileRefiner(
if (credential.settings?.refinementEnabled === false) return undefined;
const refinerTargetProvider = options.refinerTargetProvider;
if (!refinerTargetProvider) {
- throw new Error('手机版语音润色需要 Cindy 语音会话(缺少 refinerTargetProvider)。');
+ throw new Error(i18n.t('composer.voice.missingRefinerTargetProvider'));
}
// 托管单请求:模型选择与 failover 在 voice-server(provider/model 都传 'auto',
// 服务端按自己配置的模型链覆盖),客户端不再做多 provider fallback。
diff --git a/apps/mobile/src/session/mobileVoiceInput.ts b/apps/mobile/src/session/mobileVoiceInput.ts
index 30091eb2f1..bf058afbb2 100644
--- a/apps/mobile/src/session/mobileVoiceInput.ts
+++ b/apps/mobile/src/session/mobileVoiceInput.ts
@@ -1,5 +1,6 @@
import { apiFetchRaw } from '@/api/client';
import { DEVICE_LINK_API_BASE_URL } from '@/config/env';
+import { i18n } from '@/i18n';
import {
DictationRefiner,
extractJsonStringFieldSnapshot,
@@ -14,9 +15,17 @@ import {
} from '@cindy/maker-shared/session-operation';
export const MOBILE_MAX_VOICE_AUDIO_BYTES = 64 * 1024 * 1024;
-export const MOBILE_VOICE_EMPTY_TRANSCRIPT_ERROR = '检测到语音但未识别出文本,请重试。';
-export const MOBILE_VOICE_MIC_PERMISSION_ERROR = '麦克风权限未开启,请在系统设置里允许 Cindy 使用麦克风。';
-export const MOBILE_VOICE_REALTIME_AUDIO_UNAVAILABLE_ERROR = '当前安装包不支持实时语音输入,请安装包含原生录音模块的测试版。';
+
+// 语音错误文案:函数而非模块常量,调用时按当前语言取值(常量会把语言冻结在加载时)。
+export function mobileVoiceEmptyTranscriptError(): string {
+ return i18n.t('composer.voice.emptyTranscript');
+}
+export function mobileVoiceMicPermissionError(): string {
+ return i18n.t('composer.voice.micPermission');
+}
+export function mobileVoiceRealtimeAudioUnavailableError(): string {
+ return i18n.t('composer.voice.realtimeAudioUnavailable');
+}
export type MobileVoiceState = ComposerVoiceState;
@@ -116,7 +125,7 @@ export function canCancelMobileVoiceRecording(state: MobileVoiceState): boolean
}
export function isMobileVoiceMicPermissionError(message: string | null | undefined): boolean {
- return message === MOBILE_VOICE_MIC_PERMISSION_ERROR;
+ return message === mobileVoiceMicPermissionError();
}
export function normalizeMobileVoiceTranscriptResult(value: unknown): { text: string; provider?: string; model?: string } {
@@ -151,10 +160,10 @@ export async function presignMobileVoiceUpload(
options: { token: string | null; deps?: UploadDeps },
): Promise<VoicePresignResult> {
if (!Number.isFinite(recording.size) || recording.size <= 0) {
- throw new Error('录音为空,不能转写。');
+ throw new Error(i18n.t('composer.voice.recordingEmpty'));
}
if (recording.size > MOBILE_MAX_VOICE_AUDIO_BYTES) {
- throw new Error(`录音超过上限 ${Math.round(MOBILE_MAX_VOICE_AUDIO_BYTES / 1024 / 1024)}MB。`);
+ throw new Error(i18n.t('composer.voice.recordingTooLarge', { size: Math.round(MOBILE_MAX_VOICE_AUDIO_BYTES / 1024 / 1024) }));
}
const apiFetch = options.deps?.apiFetch ?? apiFetchRaw;
const meta = resolveVoiceRecordingMeta(recording);
@@ -169,7 +178,7 @@ export async function presignMobileVoiceUpload(
},
});
if (!result || typeof result.putUrl !== 'string' || typeof result.key !== 'string') {
- throw new Error('服务端没有返回有效的语音上传地址。');
+ throw new Error(i18n.t('composer.voice.invalidUploadUrl'));
}
return result;
}
@@ -190,7 +199,7 @@ export async function putMobileVoiceUpload(
body,
});
if (!response.ok) {
- throw new Error(`语音上传失败: HTTP ${response.status} ${response.statusText}`);
+ throw new Error(i18n.t('composer.voice.uploadFailed', { status: response.status, statusText: response.statusText }));
}
}
@@ -309,7 +318,7 @@ export class MobileLiteLlmTextModelClient implements TextModelClient {
response = await request(true);
}
if (!response.ok) {
- throw new Error(await cloudVoiceHttpErrorMessage('语音润色失败', response, ''));
+ throw new Error(await cloudVoiceHttpErrorMessage(i18n.t('composer.voice.refineFailed'), response, ''));
}
if (hasReadableStreamBody(response.body)) {
const content = await readStreamingChatCompletion(response.body, input.onTextSnapshot);
@@ -318,7 +327,7 @@ export class MobileLiteLlmTextModelClient implements TextModelClient {
const buffered = await readBufferedResponseText(response);
if (buffered.trim()) {
if (buffered.length > MAX_REFINER_RESPONSE_CHARS) {
- throw new Error(`语音润色返回内容超过上限 ${MAX_REFINER_RESPONSE_CHARS} 字符。`);
+ throw new Error(i18n.t('composer.voice.refineResponseTooLarge', { max: MAX_REFINER_RESPONSE_CHARS }));
}
const streamedContent = readBufferedChatCompletion(buffered, input.onTextSnapshot);
if (streamedContent) return parseJsonObject(streamedContent) as T;
@@ -391,7 +400,7 @@ async function readStreamingChatCompletion(
const chunk = decoder.decode(value, { stream: true });
rawChars += chunk.length;
if (rawChars > MAX_REFINER_RESPONSE_CHARS) {
- throw new Error(`语音润色返回内容超过上限 ${MAX_REFINER_RESPONSE_CHARS} 字符。`);
+ throw new Error(i18n.t('composer.voice.refineResponseTooLarge', { max: MAX_REFINER_RESPONSE_CHARS }));
}
buffer += normalizeSseLineEndings(chunk);
let splitAt = buffer.indexOf('\n\n');
@@ -403,7 +412,7 @@ async function readStreamingChatCompletion(
if (isRecord(event.data) && isRecord(event.data.error)) {
streamError = typeof event.data.error.message === 'string'
? event.data.error.message
- : '语音润色流式返回失败。';
+ : i18n.t('composer.voice.refineStreamFailed');
}
const delta = extractDeltaContent(event.data);
if (delta) {
@@ -528,7 +537,7 @@ function applyChatCompletionEvent(
if (isRecord(event.data) && isRecord(event.data.error)) {
state.streamError = typeof event.data.error.message === 'string'
? event.data.error.message
- : '语音润色流式返回失败。';
+ : i18n.t('composer.voice.refineStreamFailed');
}
const delta = extractDeltaContent(event.data);
if (!delta) return;
@@ -587,22 +596,22 @@ function extractDeltaContent(chunk: unknown): string {
}
function extractChatCompletionContent(value: unknown): string {
- if (!value || typeof value !== 'object') throw new Error('语音润色没有返回有效内容。');
+ if (!value || typeof value !== 'object') throw new Error(i18n.t('composer.voice.refineNoContent'));
const choice = (value as { choices?: Array<{ message?: { content?: unknown } }> }).choices?.[0];
const content = choice?.message?.content;
if (typeof content === 'string' && content.trim()) return content;
if (content && typeof content === 'object') return JSON.stringify(content);
- throw new Error('语音润色没有返回有效内容。');
+ throw new Error(i18n.t('composer.voice.refineNoContent'));
}
function parseJsonObject(text: string): unknown {
const trimmed = text.trim();
- if (!trimmed) throw new Error('语音润色没有返回有效内容。');
+ if (!trimmed) throw new Error(i18n.t('composer.voice.refineNoContent'));
try {
return JSON.parse(trimmed);
} catch {
const match = trimmed.match(/\{[\s\S]*\}/);
- if (!match) throw new Error(`语音润色返回了无效 JSON: ${trimmed.slice(0, 80)}`);
+ if (!match) throw new Error(i18n.t('composer.voice.refineInvalidJson', { snippet: trimmed.slice(0, 80) }));
return JSON.parse(match[0]);
}
}
diff --git a/apps/mobile/src/session/modelPickerRows.ts b/apps/mobile/src/session/modelPickerRows.ts
index 076fadaa9a..e8bdae1a41 100644
--- a/apps/mobile/src/session/modelPickerRows.ts
+++ b/apps/mobile/src/session/modelPickerRows.ts
@@ -3,7 +3,8 @@
*
* 全部口径对齐桌面 ModelSelector.tsx 的同名函数(rowEffortOf / fastOnOf / fastEditable /
* budgetDisabledOf / tooltipFor / formatContextWindow),文案对齐桌面 zh-CN common.json
- * (手机无 i18n 体系,硬编码简体中文,与桌面中文逐字一致)。组件只做渲染,这里可 node 单测。
+ * (mobile i18n 化后由 models.json catalog 供文案,在使用点求值 i18n.t)。组件只做渲染,
+ * 这里可 node 单测。
*/
import { modelSupportsFastMode, type ProviderView } from '@cindy/model-providers/registry';
import type { SectionModel } from '@cindy/model-providers/sections';
@@ -11,13 +12,20 @@ import type { AgentKind } from '@cindy/model-providers/types';
import { MOBILE_EFFORT_LABELS } from '@cindy/maker-shared/agent-capabilities';
+import { i18n } from '@/i18n';
+
import type { MobileAgentCapabilities } from './agentCapabilities';
import type { MobileModelMemoryAccessors } from './draftModelMemory';
import type { DeviceApiKeyStatus } from '@/device-link/deviceModelMetaCache';
import type { MobileModelPricingMap } from '@/device-link/mobileMakerTransport';
-/** budget 档置灰时的行内提示(对位桌面 budgetNeedsApiKey,按远程语境改「被控电脑」)。 */
-export const BUDGET_DISABLED_HINT = '该模型需先在被控电脑配置 API key 才能使用';
+/**
+ * budget 档置灰时的行内提示(对位桌面 budgetNeedsApiKey,按远程语境改「被控电脑」)。
+ * 函数而非常量:在使用点求值 i18n.t,避免模块顶层冻结语言。
+ */
+export function budgetDisabledHint(): string {
+ return i18n.t('models.picker.budgetDisabledHint');
+}
/** 行/展开区消费的最小模型形状(SectionModel 与 capabilities MobileModelOption 都满足)。 */
export interface PickerRowModel {
@@ -59,7 +67,10 @@ export function formatPriceLine(
): string | null {
if (!price) return null;
const fmt = (v: number) => `$${Number(v.toFixed(2))}`;
- return `输入 ${fmt(price.inputUsdPerMtok)} · 输出 ${fmt(price.outputUsdPerMtok)} / 百万 token`;
+ return i18n.t('models.picker.priceLine', {
+ input: fmt(price.inputUsdPerMtok),
+ output: fmt(price.outputUsdPerMtok),
+ });
}
/**
@@ -73,10 +84,12 @@ export function buildRowMetaLine(args: {
}): string | null {
const parts: string[] = [];
if (args.provider) parts.push(providerDisplayTitle(args.provider));
- if (args.model.contextWindow > 0) parts.push(`${formatContextWindow(args.model.contextWindow)} 上下文`);
+ if (args.model.contextWindow > 0) {
+ parts.push(i18n.t('models.picker.contextSuffix', { size: formatContextWindow(args.model.contextWindow) }));
+ }
const price = formatPriceLine(args.pricing?.[args.model.id]);
if (price) parts.push(price);
- if (args.model.supportsFastMode) parts.push('快速');
+ if (args.model.supportsFastMode) parts.push(i18n.t('models.picker.fastTag'));
return parts.length > 0 ? parts.join(' · ') : null;
}
diff --git a/apps/mobile/src/session/modelPickerSheetModel.ts b/apps/mobile/src/session/modelPickerSheetModel.ts
index 703cd1d5f5..0b45e4d5a3 100644
--- a/apps/mobile/src/session/modelPickerSheetModel.ts
+++ b/apps/mobile/src/session/modelPickerSheetModel.ts
@@ -7,6 +7,8 @@
*/
import type { ProviderView } from '@cindy/model-providers/registry';
+import { i18n } from '@/i18n';
+
import type { MobileModelOption } from './agentCapabilities';
import type { PickerRowModel } from './modelPickerRows';
import type { ProviderModelRow } from './providerModelSections';
@@ -78,11 +80,11 @@ export function modelPickerSheetTitle(
rows: readonly ProviderModelRow[],
flatOptions: readonly MobileModelOption[],
): string {
- if (view.kind === 'permission') return '权限';
+ if (view.kind === 'permission') return i18n.t('models.picker.permissionTitle');
if (view.kind === 'options') {
return findOptionsTarget(view, rows, flatOptions)?.displayName ?? view.modelId;
}
- return '模型';
+ return i18n.t('models.picker.title');
}
/** flat 回退列表的 query 过滤(label / id 大小写不敏感包含,与供应商分段的共享 builder 同口径)。 */
diff --git a/apps/mobile/src/session/newSession.ts b/apps/mobile/src/session/newSession.ts
index 488628f267..6ee8c44fe6 100644
--- a/apps/mobile/src/session/newSession.ts
+++ b/apps/mobile/src/session/newSession.ts
@@ -1,4 +1,5 @@
import { stripTrailingPathSeparators } from '@cindy/maker-shared/path-text';
+import { i18n } from '@/i18n';
import type { CreateSessionOptions, RemoteDirectoryEntry } from '@/device-link/mobileMakerTransport';
import { reconcileEffortForModel, type ProviderModelRow } from './providerModelSections';
import type { RemoteSession } from './types';
@@ -151,10 +152,10 @@ export function validateNewSessionDraft(
content: NewSessionDraftContentState = {},
): string | null {
if (draft.workspaceKind === 'project' && !draft.workingDir.trim()) {
- return '请输入电脑端项目路径。';
+ return i18n.t('session.new.enterProjectPath');
}
- if (!draft.model.trim()) return '请输入模型。';
- if (!hasFirstMessagePayload(draft, content)) return '请输入首条消息或添加附件。';
+ if (!draft.model.trim()) return i18n.t('session.new.enterModel');
+ if (!hasFirstMessagePayload(draft, content)) return i18n.t('session.new.enterFirstMessageOrAttachment');
return null;
}
@@ -164,9 +165,11 @@ export function summarizeNewSessionDraft(
): NewSessionDraftSummary {
const validationMessage = validateNewSessionDraft(draft, content);
const agentLabel = draft.agentKind === 'codex' ? 'Codex' : 'Claude';
- const model = draft.model.trim() || '未选择模型';
+ const model = draft.model.trim() || i18n.t('session.new.noModelSelected');
const effort = draft.effort.trim();
- const workspaceLabel = draft.workspaceKind === 'dialogue' ? '对话' : '项目';
+ const workspaceLabel = draft.workspaceKind === 'dialogue'
+ ? i18n.t('session.new.workspaceDialogue')
+ : i18n.t('session.new.workspaceProject');
const trimmedWorkingDir = draft.workingDir.trim();
const extraDirs = normalizeExtraDirs(draft.extraDirs);
return {
@@ -174,10 +177,10 @@ export function summarizeNewSessionDraft(
canCreate: validationMessage === null,
runtimeLabel: [agentLabel, model, effort || null, draft.fastMode ? 'Fast' : null].filter(Boolean).join(' · '),
scopeLabel: draft.workspaceKind === 'dialogue'
- ? '电脑端分配对话目录'
+ ? i18n.t('session.new.assignedDialogueDir')
: trimmedWorkingDir
- ? [projectTitle(trimmedWorkingDir), extraDirs.length > 0 ? `+${extraDirs.length} 附加目录` : null].filter(Boolean).join(' · ')
- : '未选择项目路径',
+ ? [projectTitle(trimmedWorkingDir), extraDirs.length > 0 ? i18n.t('session.new.extraDirsSuffix', { num: extraDirs.length }) : null].filter(Boolean).join(' · ')
+ : i18n.t('session.new.noProjectPath'),
validationMessage,
workspaceLabel,
};
@@ -192,18 +195,22 @@ export function buildNewSessionCreatePreview(
const message = draft.firstMessage.trim();
const attachmentCount = normalizeAttachmentCount(content.attachmentCount);
const target = draft.workspaceKind === 'dialogue'
- ? '对话工作区'
- : draft.workingDir.trim() || '未选择项目路径';
+ ? i18n.t('session.new.dialogueWorkspace')
+ : draft.workingDir.trim() || i18n.t('session.new.noProjectPath');
const details = [
- `电脑: ${deviceName || '未知设备'}`,
- `位置: ${target}`,
- `运行: ${summary.runtimeLabel}`,
- message ? `首条: ${clipPreview(message, 64)}` : attachmentCount > 0 ? '首条: 仅发送附件' : '首条: 未填写',
- ...(attachmentCount > 0 ? [`附件: ${attachmentCount} 个`] : []),
+ i18n.t('session.new.previewDevice', { name: deviceName || i18n.t('session.new.unknownDevice') }),
+ i18n.t('session.new.previewLocation', { target }),
+ i18n.t('session.new.previewRuntime', { runtime: summary.runtimeLabel }),
+ message
+ ? i18n.t('session.new.previewFirstMessage', { preview: clipPreview(message, 64) })
+ : attachmentCount > 0
+ ? i18n.t('session.new.previewFirstAttachmentOnly')
+ : i18n.t('session.new.previewFirstEmpty'),
+ ...(attachmentCount > 0 ? [i18n.t('session.new.previewAttachments', { num: attachmentCount })] : []),
];
return {
- title: summary.canCreate ? '准备创建并发送' : '还不能创建',
- subtitle: summary.validationMessage ?? '确认后会在被控电脑创建会话,并把首条消息加入队列。',
+ title: summary.canCreate ? i18n.t('session.new.previewReadyTitle') : i18n.t('session.new.previewNotReadyTitle'),
+ subtitle: summary.validationMessage ?? i18n.t('session.new.previewReadySubtitle'),
details,
};
}
diff --git a/apps/mobile/src/session/newSessionCreation.ts b/apps/mobile/src/session/newSessionCreation.ts
index 1678de706e..0be946837a 100644
--- a/apps/mobile/src/session/newSessionCreation.ts
+++ b/apps/mobile/src/session/newSessionCreation.ts
@@ -27,6 +27,7 @@
*/
import { useSyncExternalStore } from 'react';
import * as ExpoCrypto from 'expo-crypto';
+import { i18n } from '@/i18n';
import { isTransientRemoteError, withTransientRemoteRetry } from '@/device-link/remoteRetry';
import { formatRemoteError } from '@/device-link/remoteStatus';
import type { MobileMakerTransport } from '@/device-link/mobileMakerTransport';
@@ -377,12 +378,12 @@ async function createSessionIdempotent(task: InternalTask): Promise<{ workDir: s
try {
const created = await maker.createSession(createOpts);
const result = normalizeCreateSessionResult(created);
- if (!result) throw new Error('被控端没有返回新会话 id。');
+ if (!result) throw new Error(i18n.t('session.new.noSessionIdReturned'));
if (result.sessionId !== task.sessionId) {
// 被控端没有采用预生成 id(真实桌面全版本都会透传,这是防御 mock / 异常
// 宿主):乐观行、路由、订阅全 keyed by 预生成 id,继续走会把首条消息发进
// 错误会话。按确定性失败收敛到重试面(不自动重试,避免再建一个空会话)。
- throw new Error('被控端未采用预生成会话 id(电脑端版本异常),请更新电脑端后重试。');
+ throw new Error(i18n.t('session.new.sessionIdNotAdopted'));
}
return { workDir: result.workDir ?? null };
} catch (err) {
@@ -546,8 +547,8 @@ async function runPipeline(task: InternalTask): Promise<void> {
task,
'enqueue-failed',
confirmedMissing >= 2
- ? '首条消息没有发出,内容已还原到输入框;发送前请确认会话里没有这条消息。'
- : '首条消息发送状态未确认,内容已还原到输入框,请先确认会话里是否已有这条消息再发送。',
+ ? i18n.t('session.new.firstMessageMissingConfirm')
+ : i18n.t('session.new.firstMessageUnconfirmed'),
);
return;
}
diff --git a/apps/mobile/src/session/newSessionMessages.ts b/apps/mobile/src/session/newSessionMessages.ts
index 8726e1b2d0..c567756f12 100644
--- a/apps/mobile/src/session/newSessionMessages.ts
+++ b/apps/mobile/src/session/newSessionMessages.ts
@@ -1,5 +1,7 @@
import { getLocales } from 'expo-localization';
+import { getManualLocaleOverride } from '@/i18n/appLanguage';
+
export type NewSessionLocale = 'zh-CN' | 'en' | 'ja' | 'ko';
const messages = {
@@ -40,6 +42,8 @@ export function resolveNewSessionLocale(
}
export function newSessionText(key: NewSessionMessageKey): string {
- const locale = resolveNewSessionLocale(getLocales()[0]?.languageTag);
+ // 设置里的手动语言选择优先,未选择时跟随系统语言。
+ const locale =
+ getManualLocaleOverride() ?? resolveNewSessionLocale(getLocales()[0]?.languageTag);
return newSessionMessages[locale][key];
}
diff --git a/apps/mobile/src/session/orcaCollab.ts b/apps/mobile/src/session/orcaCollab.ts
index e8f77471a6..a343feff8a 100644
--- a/apps/mobile/src/session/orcaCollab.ts
+++ b/apps/mobile/src/session/orcaCollab.ts
@@ -11,6 +11,8 @@
* 共享层 `isOrcaCommunicationTool` 的归一化约定(`mcp__X__Y` → `mcp:X:Y`),兼容裸名与 MCP 前缀名。
*/
+import { i18n } from '@/i18n';
+
export interface OrcaCollabCard {
/** dispatch = Lead 派活;report = worker 回报。用于卡片视觉/标题区分。 */
variant: 'dispatch' | 'report';
@@ -45,12 +47,14 @@ export function buildOrcaDispatchCard(toolName: string, input: unknown): OrcaCol
const worker = readRecord(value);
const label = readString(worker?.label) ?? readString(worker?.role) ?? `worker ${index + 1}`;
const task = readString(worker?.initial_task);
- return task ? `${label}:${task}` : label;
+ return task ? i18n.t('interaction.collab.dispatchSummaryItem', { label, task }) : label;
});
return {
variant: 'dispatch',
- title: workers.length > 0 ? `批量派活给 ${workers.length} 个 worker` : '批量派活给多个 worker',
- body: summaries.length > 0 ? summaries.join('\n') : '批量创建 worker',
+ title: workers.length > 0
+ ? i18n.t('interaction.collab.batchTitle', { count: workers.length })
+ : i18n.t('interaction.collab.batchTitleGeneric'),
+ body: summaries.length > 0 ? summaries.join('\n') : i18n.t('interaction.collab.batchBodyFallback'),
};
}
@@ -63,8 +67,8 @@ export function buildOrcaDispatchCard(toolName: string, input: unknown): OrcaCol
const meta = [role, agent].filter(Boolean).join(' · ');
return {
variant: 'dispatch',
- title: `派活给 worker ${who}`,
- body: task ?? (meta ? `角色 ${meta}` : '创建 worker'),
+ title: i18n.t('interaction.collab.dispatchTitle', { who }),
+ body: task ?? (meta ? i18n.t('interaction.collab.dispatchRole', { meta }) : i18n.t('interaction.collab.dispatchBodyFallback')),
};
}
@@ -73,8 +77,8 @@ export function buildOrcaDispatchCard(toolName: string, input: unknown): OrcaCol
const target = readString(record?.target_session_id);
return {
variant: 'dispatch',
- title: '发消息给 worker',
- body: message ?? (target ? `→ ${target}` : '发送消息'),
+ title: i18n.t('interaction.collab.sendTitle'),
+ body: message ?? (target ? `→ ${target}` : i18n.t('interaction.collab.sendBodyFallback')),
};
}
@@ -89,8 +93,8 @@ export function parseOrcaWorkerReport(content: unknown): OrcaCollabCard | null {
const body = readString(record.content);
return {
variant: 'report',
- title: 'worker 回报',
- body: body ?? '(空回报)',
+ title: i18n.t('interaction.collab.reportTitle'),
+ body: body ?? i18n.t('interaction.collab.reportBodyFallback'),
};
}
diff --git a/apps/mobile/src/session/permissionPresentation.ts b/apps/mobile/src/session/permissionPresentation.ts
index 52e312712b..d06db46208 100644
--- a/apps/mobile/src/session/permissionPresentation.ts
+++ b/apps/mobile/src/session/permissionPresentation.ts
@@ -7,6 +7,7 @@ import {
TriangleAlert,
type LucideIcon,
} from 'lucide-react-native';
+import { i18n } from '@/i18n';
import type { ThemeColors } from '@/theme';
/**
@@ -25,18 +26,28 @@ export interface PermissionPresentation {
accent: PermissionAccent;
}
-const PRESENTATION: Record<string, PermissionPresentation> = {
- default: { Icon: Hand, label: '默认权限', accent: 'neutral' },
- ask: { Icon: Hand, label: '默认权限', accent: 'neutral' },
- acceptEdits: { Icon: CodeXml, label: '允许编辑', accent: 'neutral' },
- plan: { Icon: ClipboardList, label: '计划模式', accent: 'neutral' },
- auto: { Icon: Sparkles, label: '自动审批', accent: 'auto' },
- bypassPermissions: { Icon: TriangleAlert, label: '完全访问', accent: 'bypass' },
+// 图标 / 着色语义与语言无关,留在模块顶层;label 只存 catalog key,
+// 由 permissionPresentation() 在调用点用 i18n.t 求值(不冻结语言)。
+interface PermissionPresentationMeta {
+ Icon: LucideIcon;
+ labelKey: string;
+ accent: PermissionAccent;
+}
+
+const PRESENTATION_META: Record<string, PermissionPresentationMeta> = {
+ default: { Icon: Hand, labelKey: 'interaction.permission.mode.default', accent: 'neutral' },
+ ask: { Icon: Hand, labelKey: 'interaction.permission.mode.default', accent: 'neutral' },
+ acceptEdits: { Icon: CodeXml, labelKey: 'interaction.permission.mode.acceptEdits', accent: 'neutral' },
+ plan: { Icon: ClipboardList, labelKey: 'interaction.permission.mode.plan', accent: 'neutral' },
+ auto: { Icon: Sparkles, labelKey: 'interaction.permission.mode.auto', accent: 'auto' },
+ bypassPermissions: { Icon: TriangleAlert, labelKey: 'interaction.permission.mode.bypass', accent: 'bypass' },
};
/** 取某权限模式的图标 / 标签 / 着色语义;未知 id 回退到中性盾牌 + 传入标签。 */
export function permissionPresentation(id: string, fallbackLabel?: string): PermissionPresentation {
- return PRESENTATION[id] ?? { Icon: Shield, label: fallbackLabel || id, accent: 'neutral' };
+ const meta = PRESENTATION_META[id];
+ if (!meta) return { Icon: Shield, label: fallbackLabel || id, accent: 'neutral' };
+ return { Icon: meta.Icon, label: i18n.t(meta.labelKey), accent: meta.accent };
}
/** 把 accent 语义解析成当前主题的具体色值。 */
diff --git a/apps/mobile/src/session/remoteAbsFileFetch.ts b/apps/mobile/src/session/remoteAbsFileFetch.ts
index f5657c78e3..d59b26a0d4 100644
--- a/apps/mobile/src/session/remoteAbsFileFetch.ts
+++ b/apps/mobile/src/session/remoteAbsFileFetch.ts
@@ -18,6 +18,7 @@
* rememberUpload 的写法),长会话不累积。
*/
import { withTransientRemoteRetry } from '@/device-link/remoteRetry';
+import { i18n } from '@/i18n';
import type {
FileBrowserReadFileResult,
MobileMakerTransport,
@@ -117,9 +118,9 @@ export function adaptTextFilePreviewResult(
};
}
const message = res.reason === 'not_found'
- ? '文件不存在'
+ ? i18n.t('composer.attachments.fileNotFound')
: res.reason === 'forbidden'
- ? '该路径不允许读取'
- : res.error ?? '读取失败';
+ ? i18n.t('composer.attachments.pathNotReadable')
+ : res.error ?? i18n.t('composer.attachments.readFailed');
return { ok: false, code: 'READ_FAILED', message };
}
diff --git a/apps/mobile/src/session/remoteMedia.ts b/apps/mobile/src/session/remoteMedia.ts
index 4966f32918..c34aba3f2c 100644
--- a/apps/mobile/src/session/remoteMedia.ts
+++ b/apps/mobile/src/session/remoteMedia.ts
@@ -3,6 +3,7 @@ import {
isPayloadDesktopLocalMediaUrl,
isPayloadDirectPreviewableUrl,
} from '@cindy/maker-shared/payload-summary';
+import { i18n } from '@/i18n';
const EXPIRY_SAFETY_WINDOW_MS = 60 * 1000;
@@ -90,7 +91,7 @@ export async function resolveMobileRemoteMedia(
opts?: MobileRemoteMediaResolveOptions,
): Promise<MobileResolvedRemoteMedia> {
if (!isDesktopLocalMediaUrl(media.url)) {
- throw new Error('不是可取件的桌面端媒体');
+ throw new Error(i18n.t('composer.attachments.notFetchableMedia'));
}
const fetchOpts = {
...(opts?.skipCache ? { skipCache: true } : {}),
@@ -114,11 +115,11 @@ export async function resolveMobileRemoteMedia(
};
}
if (!isValidFetchResult(fetched)) {
- throw new Error('远程媒体取件结果无效');
+ throw new Error(i18n.t('composer.attachments.mediaResultInvalid'));
}
const signed = await deps.presignGet(fetched.ossKey);
if (!isValidPresignResult(signed)) {
- throw new Error('远程媒体下载地址无效');
+ throw new Error(i18n.t('composer.attachments.mediaUrlInvalid'));
}
return {
url: signed.getUrl,
diff --git a/apps/mobile/src/session/remoteMediaResolveQueue.ts b/apps/mobile/src/session/remoteMediaResolveQueue.ts
index e7e3188869..bbae760b69 100644
--- a/apps/mobile/src/session/remoteMediaResolveQueue.ts
+++ b/apps/mobile/src/session/remoteMediaResolveQueue.ts
@@ -17,6 +17,7 @@
*
* 纯逻辑模块,依赖注入(resolve/isFresh/now),node 环境可单测。
*/
+import { i18n } from '@/i18n';
import {
isResolvedRemoteMediaFresh,
type MobileResolvedRemoteMedia,
@@ -226,7 +227,7 @@ export function createRemoteMediaResolveQueue(
if (cached && !opts.forceRefresh && isFresh(cached, now())) return Promise.resolve(cached);
if (opts.cachedOnly) {
// 只读缓存模式:未命中直接拒绝,不入队、不碰负缓存(不污染同键的真实取件)。
- return Promise.reject(new Error('远程媒体缓存未命中(cachedOnly)'));
+ return Promise.reject(new Error(i18n.t('composer.attachments.mediaCacheMiss')));
}
const negative = errorCache.get(key);
@@ -330,5 +331,5 @@ export function createRemoteMediaResolveQueue(
}
function abortError(): Error {
- return new Error('远程媒体取件已取消');
+ return new Error(i18n.t('composer.attachments.mediaFetchCancelled'));
}
diff --git a/apps/mobile/src/session/rewindPreview.ts b/apps/mobile/src/session/rewindPreview.ts
index 9419177dc8..89021775a0 100644
--- a/apps/mobile/src/session/rewindPreview.ts
+++ b/apps/mobile/src/session/rewindPreview.ts
@@ -1,4 +1,5 @@
import type { ChatQuote } from '@cindy/maker-shared/chat-quotes';
+import { i18n } from '@/i18n';
import type { ComposerDocument } from '@/session/composerDocument';
export interface RewindPreviewPayload {
@@ -70,7 +71,7 @@ export function buildRewindPreviewState(
draftQuotes,
...orderedDraft,
...documentDraft,
- errorText: '无法读取回退预览结果,请重新同步后再试。',
+ errorText: i18n.t('interaction.rewind.readError'),
};
}
@@ -100,7 +101,7 @@ export function buildRewindPreviewState(
draftQuotes,
...orderedDraft,
...documentDraft,
- note: payload.error || '没有可回滚的文件,将只截断这条消息之后的对话历史。',
+ note: payload.error || i18n.t('interaction.rewind.noFilesNote'),
};
}
diff --git a/apps/mobile/src/session/selectableMarkdownHtml.ts b/apps/mobile/src/session/selectableMarkdownHtml.ts
index 14cb1baf69..89a56f8900 100644
--- a/apps/mobile/src/session/selectableMarkdownHtml.ts
+++ b/apps/mobile/src/session/selectableMarkdownHtml.ts
@@ -7,6 +7,7 @@ import {
import { parseSessionDeepLinkUrl, shortSessionId } from '@/session/sessionLinks';
import { buildKatexLoaderJs } from '@/session/mathWebViewHtml';
import { lightColors, typeScale } from '@/theme/tokens';
+import { i18n } from '@/i18n';
/**
* 全屏 markdown 文档 HTML 构建器 —— 当前唯一消费方是文件预览的 MarkdownFileReader
@@ -66,7 +67,7 @@ export function buildSelectableMarkdownHtml(
`<style>${css}</style>`,
'</head>',
'<body>',
- '<main id="xdt-content" role="article" aria-label="消息正文">',
+ `<main id="xdt-content" role="article" aria-label="${escapeAttribute(i18n.t('message.renderer.markdownDocAriaLabel'))}">`,
renderBlocks(blocks, { sessionLinkTitles: options.sessionLinkTitles }),
'</main>',
hasMath ? buildMathRuntimeScript() : '',
@@ -386,7 +387,7 @@ function renderInline(inline: MobileMarkdownInline, ctx: RenderContext = {}): st
const title =
explicit ??
ctx.sessionLinkTitles?.[session.sessionId] ??
- `会话 ${shortSessionId(session.sessionId)}`;
+ i18n.t('message.renderer.sessionChipFallback', { id: shortSessionId(session.sessionId) });
return `<a class="xdt-session-chip" href="${escapeAttribute(inline.url)}">›&nbsp;${escapeHtml(title)}</a>`;
}
return `<a href="${escapeAttribute(inline.url)}">${escapeHtml(inline.text)}</a>`;
@@ -407,7 +408,7 @@ function renderInline(inline: MobileMarkdownInline, ctx: RenderContext = {}): st
// xdt 系非直连图:WebView 无法解析 xdt-image:// 等内部 scheme,渲染占位 chip,
// 点击经 data-xdt-src 上报后由 ImageLightbox 走 remote-media resolver 取图。
if (!isMobileMarkdownImageDirectUrl(inline.url)) {
- return `<span class="xdt-image-chip" data-xdt-src="${escapeAttribute(inline.url)}" data-xdt-alt="${escapeAttribute(inline.alt)}">${escapeHtml(inline.alt || '图片')}</span>`;
+ return `<span class="xdt-image-chip" data-xdt-src="${escapeAttribute(inline.url)}" data-xdt-alt="${escapeAttribute(inline.alt)}">${escapeHtml(inline.alt || i18n.t('message.renderer.imageFallbackTitle'))}</span>`;
}
// width/height 是解析层过滤过的纯数字提示;CSS 的 max-width:100% + height:auto 保证不撑破气泡。
// 双属性齐全时浏览器会按声明 aspect-ratio 在加载前预留高度,height=9999 这类极端比例
diff --git a/apps/mobile/src/session/selectionQuote.ts b/apps/mobile/src/session/selectionQuote.ts
index 6cb82fb5ff..7242b46d2a 100644
--- a/apps/mobile/src/session/selectionQuote.ts
+++ b/apps/mobile/src/session/selectionQuote.ts
@@ -15,8 +15,15 @@
*/
import { createContext } from 'react';
-/** 系统选择菜单里自定义项的文案(与桌面 chat.quote.addToChat 对齐)。 */
-export const SELECTION_QUOTE_MENU_LABEL = '添加到对话';
+import { i18n } from '@/i18n';
+
+/**
+ * 系统选择菜单里自定义项的文案(与桌面 chat.quote.addToChat 对齐)。
+ * 用函数在调用点求值,避免模块顶层把 i18n.t 结果冻结成常量(冻结语言)。
+ */
+export function selectionQuoteMenuLabel(): string {
+ return i18n.t('message.quote.menuLabel');
+}
/** 采集提交接口:MarkdownSelectableText 经 context 调用。null = 宿主未启用采集。 */
export interface SelectionQuoteContextValue {
diff --git a/apps/mobile/src/session/sessionAgentSwitchConfirmation.ts b/apps/mobile/src/session/sessionAgentSwitchConfirmation.ts
index dcdc3bd57c..7ecf51b08e 100644
--- a/apps/mobile/src/session/sessionAgentSwitchConfirmation.ts
+++ b/apps/mobile/src/session/sessionAgentSwitchConfirmation.ts
@@ -1,6 +1,8 @@
/** 手机端首次进入另一 Agent 浏览态时的原生确认门。 */
import { Alert, type AlertButton, type AlertOptions } from 'react-native';
+import { i18n } from '@/i18n';
+
import { mobileAgentLabel, type MobileSessionAgentKind } from './sessionAgentSwitch';
type ShowAlert = (
@@ -29,11 +31,11 @@ export function confirmMobileSessionAgentSwitch(
resolve(confirmed);
};
showAlert(
- `切换到 ${target}?`,
- `下一条消息发送时,Cindy 会把当前会话交接给 ${target}。两个 Agent 对上下文和工具的理解可能不同,请确认后再选择目标模型。`,
+ i18n.t('models.agentSwitch.confirmTitle', { agent: target }),
+ i18n.t('models.agentSwitch.confirmMessage', { agent: target }),
[
- { text: '取消', style: 'cancel', onPress: () => finish(false) },
- { text: '继续选择', onPress: () => finish(true) },
+ { text: i18n.t('models.agentSwitch.cancel'), style: 'cancel', onPress: () => finish(false) },
+ { text: i18n.t('models.agentSwitch.confirm'), onPress: () => finish(true) },
],
{ cancelable: true, onDismiss: () => finish(false) },
);
diff --git a/apps/mobile/src/session/sessionExtraDirs.ts b/apps/mobile/src/session/sessionExtraDirs.ts
index 45ac9c3f2c..3f93dcc7f3 100644
--- a/apps/mobile/src/session/sessionExtraDirs.ts
+++ b/apps/mobile/src/session/sessionExtraDirs.ts
@@ -1,3 +1,4 @@
+import { i18n } from '@/i18n';
import { normalizeExtraDirs, parseExtraDirsInput } from '@/session/newSession';
export function formatExtraDirsText(extraDirs: readonly string[] | null | undefined): string {
@@ -22,7 +23,9 @@ export function hasExtraDirsDraftChanged(
export function summarizeExtraDirs(extraDirs: readonly string[] | null | undefined): string {
const count = normalizeExtraDirs(extraDirs ?? undefined).length;
- return count > 0 ? `当前 ${count} 个附加目录` : '当前没有附加目录';
+ return count > 0
+ ? i18n.t('session.row.extraDirsSummary', { num: count })
+ : i18n.t('session.row.noExtraDirsSummary');
}
function sameStringList(a: readonly string[], b: readonly string[]): boolean {
diff --git a/apps/mobile/src/session/sessionMenu.ts b/apps/mobile/src/session/sessionMenu.ts
index 8358613e79..f33e459bc4 100644
--- a/apps/mobile/src/session/sessionMenu.ts
+++ b/apps/mobile/src/session/sessionMenu.ts
@@ -5,6 +5,7 @@
* 置顶 / 归档 / 删除)+「会话信息」二级入口;二级 = 用量 / 工作目录 / 附加引用目录 / 标识。
* 全部为纯函数,不碰 IO;交互副作用(clipboard / Alert / 远端写)由组件层承担。
*/
+import { i18n } from '@/i18n';
import { sessionCollaborationLabel } from '@/session/collaboration';
import { normalizeExtraDirs } from '@/session/newSession';
import { buildMobileSessionDeepLink } from '@/session/sessionLinks';
@@ -43,14 +44,14 @@ export function buildSessionMenuHeader(
input: { readOnlyReason?: string | null },
): SessionMenuHeaderModel {
const chips: SessionMenuChip[] = [];
- if (session.pinnedAt) chips.push({ id: 'pinned', label: '已置顶' });
- if (session.status === 'archived') chips.push({ id: 'archived', label: '已归档' });
- if (input.readOnlyReason) chips.push({ id: 'readonly', label: '只读' });
+ if (session.pinnedAt) chips.push({ id: 'pinned', label: i18n.t('session.menu.chipPinned') });
+ if (session.status === 'archived') chips.push({ id: 'archived', label: i18n.t('session.menu.chipArchived') });
+ if (input.readOnlyReason) chips.push({ id: 'readonly', label: i18n.t('session.menu.chipReadOnly') });
const collabLabel = sessionCollaborationLabel(session);
if (collabLabel) chips.push({ id: 'collab', label: collabLabel });
return {
- title: session.title || workspaceName(session) || '远程会话',
+ title: session.title || workspaceName(session) || i18n.t('session.menu.titleFallback'),
chips,
metaLine: buildSessionMenuMetaLine(session),
usageSummary: buildSessionMenuUsageSummary(session),
@@ -66,35 +67,35 @@ export function buildSessionMenuActions(input: {
return [
{
id: 'rename',
- label: '重命名对话',
+ label: i18n.t('session.menu.renameAction'),
tone: 'default',
disabled: input.writeDisabled,
testID: 'session.renameAction',
},
{
id: 'copyLink',
- label: '复制对话链接',
+ label: i18n.t('session.menu.copyLinkAction'),
tone: 'default',
disabled: input.busy,
testID: 'session.copyLinkAction',
},
{
id: 'pin',
- label: input.pinned ? '取消置顶' : '置顶',
+ label: input.pinned ? i18n.t('session.menu.unpin') : i18n.t('session.menu.pin'),
tone: 'default',
disabled: input.writeDisabled,
testID: 'session.pinButton',
},
{
id: 'archive',
- label: input.archived ? '恢复' : '归档',
+ label: input.archived ? i18n.t('session.menu.restore') : i18n.t('session.menu.archive'),
tone: 'default',
disabled: input.writeDisabled,
testID: input.archived ? 'session.restoreButton' : 'session.archiveButton',
},
{
id: 'delete',
- label: '删除会话',
+ label: i18n.t('session.menu.deleteAction'),
tone: 'danger',
disabled: input.writeDisabled,
testID: 'session.deleteButton',
@@ -116,7 +117,7 @@ export function buildSessionInfoWorkspace(
if (worktree) return { label: 'Worktree', name: worktree.name, path: worktree.path };
const workingDir = session.workingDir?.trim();
if (!workingDir) return null;
- return { label: '工作目录', name: lastPathPart(workingDir), path: workingDir };
+ return { label: i18n.t('session.menu.workingDir'), name: lastPathPart(workingDir), path: workingDir };
}
/** 附加引用目录入口条件(与旧设置面板一致):cc + project 会话且有工作目录。 */
@@ -175,12 +176,12 @@ const AI_RENAME_OFFLINE_ERROR_CODES = [
export function aiRenameFailureText(error: unknown): string {
const text = error instanceof Error ? `${readErrorCode(error)} ${error.message}` : String(error);
if (text.includes('CHANNEL_NOT_ALLOWED') || text.includes('VERSION_MISMATCH')) {
- return '被控电脑版本过旧,暂不支持自动起名。';
+ return i18n.t('session.menu.aiRenameUnsupported');
}
if (AI_RENAME_OFFLINE_ERROR_CODES.some((code) => text.includes(code))) {
- return '被控电脑不在线,稍后再试。';
+ return i18n.t('session.menu.aiRenameOffline');
}
- return '自动起名失败,请重试。';
+ return i18n.t('session.menu.aiRenameFailed');
}
function readErrorCode(error: Error): string {
@@ -209,7 +210,7 @@ function buildSessionMenuUsageSummary(session: RemoteSession): string | null {
const contextWindow = readPositiveNumber(session.contextWindow);
if (contextTokens !== null && contextWindow !== null) {
const percent = Math.min(100, Math.max(0, (contextTokens / contextWindow) * 100));
- parts.push(`上下文 ${Math.round(percent)}%`);
+ parts.push(i18n.t('session.menu.contextUsageSummary', { percent: Math.round(percent) }));
}
return parts.length > 0 ? parts.join(' · ') : null;
}
diff --git a/apps/mobile/src/session/sessionOutbox.ts b/apps/mobile/src/session/sessionOutbox.ts
index 83ad37c719..5c359d6b85 100644
--- a/apps/mobile/src/session/sessionOutbox.ts
+++ b/apps/mobile/src/session/sessionOutbox.ts
@@ -16,6 +16,7 @@
* 本模块只做纯数据变换(node 可单测);上传路由、enqueue RPC、React state 接线
* 在 [sessionId].tsx。
*/
+import { i18n } from '@/i18n';
import type { MobileSessionReference } from '@/session/sessionReferences';
import type { RemoteSerializedAttachment } from '@/session/types';
import type { AgentInputReference } from '@cindy/maker-shared/agent-input-projection';
@@ -364,7 +365,7 @@ export function outboxDisplayItem(item: MobileOutboxItem): MobileOutboxDisplayIt
failed: item.phase === 'failed',
errorText: item.phase !== 'failed'
? null
- : (item.enqueueError ?? (item.failedIds.length > 0 ? '附件上传失败,可重试或删除这条消息。' : null)),
+ : (item.enqueueError ?? (item.failedIds.length > 0 ? i18n.t('session.row.attachmentUploadFailed') : null)),
};
}
diff --git a/apps/mobile/src/session/sessionReferences.ts b/apps/mobile/src/session/sessionReferences.ts
index 0f22d84255..1fc6cd0365 100644
--- a/apps/mobile/src/session/sessionReferences.ts
+++ b/apps/mobile/src/session/sessionReferences.ts
@@ -2,6 +2,7 @@ import {
DL_HISTORY_MESSAGES_CHANNEL,
DL_SESSION_REFERENCE_CAPABILITY_CHANNEL,
} from '@cindy/device-link';
+import { i18n } from '@/i18n';
import type { RemoteInvoke } from '@/device-link/mobileMakerTransport';
import {
createSessionLinkPattern,
@@ -115,14 +116,16 @@ export function mobileSessionReferenceMetadataKey(
return `${sessionId}\u0000${messageClientId ?? ''}`;
}
-/** 移动端当前会话界面统一使用中文文案;这里只格式化展示安全的范围摘要。 */
+/** 格式化展示安全的范围摘要(文案经 i18n 本地化)。 */
export function formatMobileSessionReferenceMetadata(
metadata: MobilePersistedSessionReferenceMetadata,
): string {
return [
- metadata.range === 'around-anchor' ? '链接附近' : '最近消息',
- `${metadata.messageCount} 条`,
- ...(metadata.truncated ? ['已截断'] : []),
+ metadata.range === 'around-anchor'
+ ? i18n.t('session.row.referenceAroundAnchor')
+ : i18n.t('session.row.referenceRecent'),
+ i18n.t('session.row.referenceCount', { num: metadata.messageCount }),
+ ...(metadata.truncated ? [i18n.t('session.row.referenceTruncated')] : []),
].join(' · ');
}
diff --git a/apps/mobile/src/session/sessionTailBannerModel.ts b/apps/mobile/src/session/sessionTailBannerModel.ts
index 2bad22c9b0..ab1773eeda 100644
--- a/apps/mobile/src/session/sessionTailBannerModel.ts
+++ b/apps/mobile/src/session/sessionTailBannerModel.ts
@@ -27,6 +27,7 @@ import {
sortMessagesByCreatedAt,
} from '@cindy/maker-shared/message-normalize';
import { describeAgentAuthError } from '@cindy/maker-shared/device-link-contract';
+import { i18n } from '@/i18n';
import type { InputProjection, QueuedRemoteMessage, RemoteMessage, RemoteSession } from '@/session/types';
export interface SessionTailErrorBanner {
@@ -127,10 +128,10 @@ function describeNonRetryableTailError(text: string): string | null {
const authGuidance = describeAgentAuthError(text);
if (authGuidance) return authGuidance;
if (/thread not found/i.test(text)) {
- return 'Codex 鉴权模式已切换,当前会话无法继续 —— 请新建会话后生效。';
+ return i18n.t('session.tail.codexThreadLost');
}
if (/invalid_encrypted_content/i.test(text)) {
- return '由于更换供应商导致加密不可用,本会话只能在原供应商下使用;请回到电脑端处理(可 Fork 丢弃协议加密内容后在新会话继续)。';
+ return i18n.t('session.tail.encryptedContentInvalid');
}
return null;
}
diff --git a/apps/mobile/src/session/swipeRowRegistry.ts b/apps/mobile/src/session/swipeRowRegistry.ts
index 7b7948a884..a52f6c38b3 100644
--- a/apps/mobile/src/session/swipeRowRegistry.ts
+++ b/apps/mobile/src/session/swipeRowRegistry.ts
@@ -5,6 +5,7 @@
* 「置顶态 → 动作与文案」「选项菜单模型」「动作 → RPC 补丁」的确定性映射,
* 补丁生成直接转发共享层 mobileSessionBulkPatch,不自己拼字段。
*/
+import { i18n } from '@/i18n';
import { withTransientRemoteRetry } from '@/device-link/remoteRetry';
import {
mobileSessionBulkPatch,
@@ -309,8 +310,10 @@ export async function retryPatchWhileLatest<T>(
/** 右滑按钮:按当前置顶态给出动作与文案(置顶区行天然拿到「取消置顶」)。 */
export function pinToggleAction(
pinnedAt: string | null | undefined,
-): { action: 'pin' | 'unpin'; label: '置顶' | '取消置顶' } {
- return pinnedAt ? { action: 'unpin', label: '取消置顶' } : { action: 'pin', label: '置顶' };
+): { action: 'pin' | 'unpin'; label: string } {
+ return pinnedAt
+ ? { action: 'unpin', label: i18n.t('session.menu.unpin') }
+ : { action: 'pin', label: i18n.t('session.menu.pin') };
}
export interface SessionActionMenuItem {
@@ -326,10 +329,10 @@ export function buildSessionActionMenu(
): SessionActionMenuItem[] {
const pinToggle = pinToggleAction(pinnedAt);
return [
- { action: 'rename', label: '重命名对话' },
+ { action: 'rename', label: i18n.t('session.menu.renameAction') },
{ action: pinToggle.action, label: pinToggle.label },
- { action: 'archive', label: '归档' },
- { action: 'delete', label: '删除对话', destructive: true },
+ { action: 'archive', label: i18n.t('session.menu.archive') },
+ { action: 'delete', label: i18n.t('session.menu.deleteConversation'), destructive: true },
];
}
diff --git a/apps/mobile/src/session/systemCard.ts b/apps/mobile/src/session/systemCard.ts
index dffcf661c6..db79982e3d 100644
--- a/apps/mobile/src/session/systemCard.ts
+++ b/apps/mobile/src/session/systemCard.ts
@@ -9,6 +9,7 @@ import {
type SystemCardPresentation,
type SystemCardType,
} from '@cindy/maker-shared/system-card';
+import { i18n } from '@/i18n';
/**
* 手机端系统卡类型 = 共享 slash 命令卡 + goal 持久记录卡 + silent-stop 自动续跑卡。
@@ -35,7 +36,7 @@ function formatGoalCompleteCard(data: Record<string, unknown> | undefined): Syst
const elapsedMs = typeof data?.elapsedMs === 'number' ? data.elapsedMs : 0;
const reason = typeof data?.reason === 'string' ? data.reason : '';
return {
- title: `目标已达成 · ${turns} 轮 · 耗时 ${formatGoalDuration(elapsedMs)}`,
+ title: i18n.t('message.systemCard.goalComplete', { turns, duration: formatGoalDuration(elapsedMs) }),
...(reason ? { body: reason } : {}),
rows: [],
};
@@ -86,8 +87,8 @@ export function formatMobileSystemCard(
data: Record<string, unknown> | undefined,
): MobileSystemCardPresentation {
if (type === 'goal-complete') return formatGoalCompleteCard(data);
- if (type === 'goal-resumed') return { title: '用量已恢复,继续目标', rows: [] };
- if (type === 'auto-resume') return { title: '连接中断,已自动继续', rows: [] };
+ if (type === 'goal-resumed') return { title: i18n.t('message.systemCard.goalResumed'), rows: [] };
+ if (type === 'auto-resume') return { title: i18n.t('message.systemCard.autoResume'), rows: [] };
if (type === 'agent-switch') return formatAgentSwitchCard(data);
if (type === 'learn') return formatLearnCard(data);
return formatSystemCard(type, data);
@@ -104,11 +105,11 @@ function formatAgentSwitchCard(data: Record<string, unknown> | undefined): Syste
const from = engineLabel(data?.fromAgentKind);
const to = engineLabel(data?.toAgentKind);
const toModel = typeof data?.toModel === 'string' ? data.toModel : '';
- const rows = toModel ? [{ label: '模型', value: toModel }] : [];
+ const rows = toModel ? [{ label: i18n.t('message.systemCard.modelLabel'), value: toModel }] : [];
// Phase 2:resumed = 目标引擎续接了自己的停泊原生会话(增量交接)。
- if (data?.resumed === true) rows.push({ label: '会话', value: '已续接' });
+ if (data?.resumed === true) rows.push({ label: i18n.t('message.systemCard.sessionLabel'), value: i18n.t('message.systemCard.sessionResumed') });
return {
- title: `已从 ${from} 切换到 ${to}`,
+ title: i18n.t('message.systemCard.agentSwitch', { from, to }),
rows,
};
}
@@ -121,17 +122,17 @@ function formatLearnCard(data: Record<string, unknown> | undefined): SystemCardP
const runId = typeof data?.runId === 'string' ? data.runId : '';
if (runId) {
return {
- title: '技能学习已启动',
+ title: i18n.t('message.systemCard.learnStarted'),
rows: [{ label: 'run', value: runId.slice(0, 8) }],
- body: '蒸馏在桌面端后台进行,完成后请到桌面端查看并评审技能草案。',
+ body: i18n.t('message.systemCard.learnStartedBody'),
};
}
const error = typeof data?.error === 'string' ? data.error : 'learn-failed';
return {
- title: '技能学习未能启动',
+ title: i18n.t('message.systemCard.learnFailed'),
rows: [],
body: error === 'learn-busy'
- ? '已有一个学习任务在进行中,等它完成后再试。'
- : `启动失败:${typeof data?.detail === 'string' && data.detail ? data.detail : '未知错误'}`,
+ ? i18n.t('message.systemCard.learnBusyBody')
+ : i18n.t('message.systemCard.learnFailedBody', { detail: typeof data?.detail === 'string' && data.detail ? data.detail : i18n.t('message.systemCard.unknownError') }),
};
}
diff --git a/apps/mobile/src/session/useComposerImageAnnotations.ts b/apps/mobile/src/session/useComposerImageAnnotations.ts
index 490f17b863..ad31b9e913 100644
--- a/apps/mobile/src/session/useComposerImageAnnotations.ts
+++ b/apps/mobile/src/session/useComposerImageAnnotations.ts
@@ -20,6 +20,7 @@
* 发送清空时 best-effort 删除。
*/
import { useCallback, useMemo, useRef } from 'react';
+import { useTranslation } from 'react-i18next';
import { Alert } from 'react-native';
import * as FileSystem from 'expo-file-system/legacy';
import { useAnnotationBurnIn } from '@/session/AnnotationBurnInWebView';
@@ -120,6 +121,7 @@ async function ensureDir(dir: string): Promise<void> {
export function useComposerImageAnnotations(
options: UseComposerImageAnnotationsOptions,
): UseComposerImageAnnotationsResult {
+ const { t } = useTranslation();
const { burnIn, host } = useAnnotationBurnIn();
const metaRef = useRef<Map<string, AnnotationEditMeta>>(new Map());
/**
@@ -189,7 +191,7 @@ export function useComposerImageAnnotations(
? info.size
: 0;
if (size > MOBILE_MAX_ATTACHMENT_BYTES) {
- throw new Error(`图片超过 ${Math.round(MOBILE_MAX_ATTACHMENT_BYTES / 1024 / 1024)} MB,暂不能发送。`);
+ throw new Error(t('composer.upload.imageTooLargeSend', { size: Math.round(MOBILE_MAX_ATTACHMENT_BYTES / 1024 / 1024) }));
}
const head = await FileSystem.readAsStringAsync(fileUri, {
encoding: FileSystem.EncodingType.Base64,
@@ -197,7 +199,7 @@ export function useComposerImageAnnotations(
position: 0,
}).catch(() => '');
return { fileUri, mimeType: sniffImageMimeFromBase64(head) ?? fallbackMime, size };
- }, []);
+ }, [t]);
/**
* 把标注/转发源图物化成本 hook 私有的 file:// 副本。
@@ -231,12 +233,12 @@ export function useComposerImageAnnotations(
const fileUri = `${srcDir}src-${nextFileTag()}.${extForMime(mimeType)}`;
const result = await FileSystem.downloadAsync(displayUri, fileUri);
if (result.status < 200 || result.status >= 300) {
- throw new Error(`下载原图失败(HTTP ${result.status})。`);
+ throw new Error(t('composer.attachments.downloadOriginalFailed', { status: result.status }));
}
return finalizeSource(fileUri, mimeType);
}
- throw new Error('这张图片暂不支持标注或转发。');
- }, [srcDir, finalizeSource, nextFileTag]);
+ throw new Error(t('composer.attachments.imageNotAnnotatable'));
+ }, [srcDir, finalizeSource, nextFileTag, t]);
/**
* 标注提交主流程(聊天发送到对话 / 托盘再编辑保存共用):
@@ -255,7 +257,7 @@ export function useComposerImageAnnotations(
const opts = optionsRef.current;
try {
if (!replaceAttachmentId && opts.getRemainingAttachmentSlots() <= 0) {
- throw new Error(`最多添加 ${MOBILE_MAX_ATTACHMENTS} 个附件。`);
+ throw new Error(t('composer.upload.maxAttachments', { count: MOBILE_MAX_ATTACHMENTS }));
}
const replacedMeta = replaceAttachmentId ? metaRef.current.get(replaceAttachmentId) : undefined;
const source = await materializeSource(
@@ -337,10 +339,10 @@ export function useComposerImageAnnotations(
} catch (err) {
// 系统 Alert 能盖过全屏 lightbox Modal(composer 错误条此刻被遮挡不可见);
// lightbox 停留在标注模式,用户可重试或放弃。
- Alert.alert('标注保存失败', err instanceof Error && err.message ? err.message : '请重试。');
+ Alert.alert(t('composer.attachments.annotationSaveFailed'), err instanceof Error && err.message ? err.message : t('composer.attachments.tryAgain'));
throw err;
}
- }, [materializeSource, burnIn, burnedDir, nextFileTag, isHookGeneratedFile, deleteUnreferencedFiles]);
+ }, [materializeSource, burnIn, burnedDir, nextFileTag, isHookGeneratedFile, deleteUnreferencedFiles, t]);
const decorateUploadedAttachment = useCallback((
attachment: RemoteSerializedAttachment,
@@ -377,19 +379,19 @@ export function useComposerImageAnnotations(
}, [isHookGeneratedFile, deleteUnreferencedFiles]);
const chatAnnotation = useMemo<ImageLightboxAnnotationConfig>(() => ({
- submitLabel: '发送到对话',
+ submitLabel: t('composer.attachments.sendToChat'),
// 一级直发按钮(对齐桌面):不画笔迹也能把历史图转发进 composer 托盘。
allowDirectSubmit: true,
onSubmit: (_image, displayUri, strokes, context) =>
submitAnnotation(displayUri, strokes, context.mimeType, null),
- }), [submitAnnotation]);
+ }), [submitAnnotation, t]);
const trayAnnotation = useMemo<ImageLightboxAnnotationConfig>(() => ({
- submitLabel: '保存',
+ submitLabel: t('composer.attachments.save'),
initialStrokesFor: (image) => metaRef.current.get(image.key)?.strokes,
onSubmit: (image, displayUri, strokes, context) =>
submitAnnotation(displayUri, strokes, context.mimeType, image.key),
- }), [submitAnnotation]);
+ }), [submitAnnotation, t]);
/**
* 信箱消费入口:其它路由(文件浏览器 lightbox 画笔)投递的标注提交,由
diff --git a/apps/mobile/src/session/useContextSheetMediaAssets.ts b/apps/mobile/src/session/useContextSheetMediaAssets.ts
index 8c83c47bfb..4d074feaec 100644
--- a/apps/mobile/src/session/useContextSheetMediaAssets.ts
+++ b/apps/mobile/src/session/useContextSheetMediaAssets.ts
@@ -4,6 +4,7 @@ import { Linking, Platform } from 'react-native';
// 这里走官方保留的 legacy 入口,批量拿 uri/filename 一次到位。
import * as MediaLibrary from 'expo-media-library/legacy';
import { ImageManipulator, SaveFormat } from 'expo-image-manipulator';
+import { i18n } from '@/i18n';
import { MOBILE_IMAGE_UPLOAD_MAX_LONG_EDGE } from '@/session/mobileImagePreprocess';
/** Context 面板媒体列表的单个资产(展示 + 附加所需的最小字段)。 */
@@ -164,9 +165,6 @@ const HEIC_JPEG_COMPRESS = 0.9;
*/
const ASSET_INFO_TIMEOUT_MS = 60_000;
-const ICLOUD_DOWNLOAD_TIMEOUT_MESSAGE = '照片还在从 iCloud 下载,等待超时了。请检查网络,稍后重试。';
-const ASSET_NOT_READABLE_MESSAGE = '这张照片暂时无法读取(可能还没从 iCloud 下载完成),请稍后重试。';
-
async function getAssetInfoWithTimeout(assetId: string): Promise<MediaLibrary.AssetInfo> {
let timer: ReturnType<typeof setTimeout> | undefined;
// 竞速输家旁路兜底:超时赢了之后底层 getAssetInfoAsync 稍后 reject 的话,
@@ -177,7 +175,7 @@ async function getAssetInfoWithTimeout(assetId: string): Promise<MediaLibrary.As
return await Promise.race([
info,
new Promise<never>((_, reject) => {
- timer = setTimeout(() => reject(new Error(ICLOUD_DOWNLOAD_TIMEOUT_MESSAGE)), ASSET_INFO_TIMEOUT_MS);
+ timer = setTimeout(() => reject(new Error(i18n.t('interaction.contextSheet.icloudTimeout'))), ASSET_INFO_TIMEOUT_MS);
}),
]);
} finally {
@@ -201,7 +199,7 @@ export async function resolveContextSheetMediaAssetForUpload(
const info = await getAssetInfoWithTimeout(asset.id);
const localUri = info.localUri?.trim();
if (!localUri && Platform.OS === 'ios') {
- throw new Error(ASSET_NOT_READABLE_MESSAGE);
+ throw new Error(i18n.t('interaction.contextSheet.photoNotReadable'));
}
const uri = localUri || asset.uri;
if (!HEIC_EXT_PATTERN.test(asset.filename) && !HEIC_EXT_PATTERN.test(uri)) {
diff --git a/apps/mobile/src/session/useMobileLocalAttachments.ts b/apps/mobile/src/session/useMobileLocalAttachments.ts
index a71ddd9402..879b63ec00 100644
--- a/apps/mobile/src/session/useMobileLocalAttachments.ts
+++ b/apps/mobile/src/session/useMobileLocalAttachments.ts
@@ -14,6 +14,7 @@
* - 页面卸载时 hook 自动 dispose(在途上传完成后回收 OSS 中转对象)。
*/
import { useEffect, useMemo, useRef, useState } from 'react';
+import { useTranslation } from 'react-i18next';
import { Platform } from 'react-native';
import * as DocumentPicker from 'expo-document-picker';
import * as FileSystem from 'expo-file-system/legacy';
@@ -139,6 +140,7 @@ export interface UseMobileLocalAttachmentsResult {
export function useMobileLocalAttachments(
options: UseMobileLocalAttachmentsOptions,
): UseMobileLocalAttachmentsResult {
+ const { t } = useTranslation();
const [pendingUploads, setPendingUploads] = useState<readonly PendingLocalAttachmentUpload[]>([]);
const pickerBusyRef = useRef(false);
/** 本 hook 拥有的 WebView 粘贴缓存;注册持久缩略图后或卸载时统一回收。 */
@@ -189,7 +191,7 @@ export function useMobileLocalAttachments(
pastePlaceholderBatchesRef.current = [];
setPastePlaceholderCount(0);
flushPastePlaceholderWaiters();
- optionsRef.current.onError('粘贴图片处理超时,请重试。');
+ optionsRef.current.onError(t('composer.upload.pasteTimeout'));
}, PASTE_PLACEHOLDER_TIMEOUT_MS);
} else {
flushPastePlaceholderWaiters();
@@ -225,7 +227,7 @@ export function useMobileLocalAttachments(
const failPastePlaceholders = () => {
if (pastePlaceholderBatchesRef.current.length === 0) return;
shiftPastePlaceholderBatch();
- optionsRef.current.onError('剪贴板图片读取失败,请重新复制后再粘贴。');
+ optionsRef.current.onError(t('composer.upload.clipboardReadFailed'));
};
const controller = useMemo(() => createMobileLocalAttachmentUploadController({
@@ -299,7 +301,7 @@ export function useMobileLocalAttachments(
- optionsRef.current.getAttachmentCount()
- getPendingSlotCount();
if (remainingSlots <= 0) {
- optionsRef.current.onError(`最多添加 ${MOBILE_MAX_ATTACHMENTS} 个附件。`);
+ optionsRef.current.onError(t('composer.upload.maxAttachments', { count: MOBILE_MAX_ATTACHMENTS }));
return null;
}
pickerBusyRef.current = true;
@@ -314,7 +316,7 @@ export function useMobileLocalAttachments(
// iOS 模拟器无相机:不拦截会在原生层直接崩进程(见 isCameraUnavailableOnSimulator)。
if (source === 'camera'
&& isCameraUnavailableOnSimulator(Platform.OS, FileSystem.documentDirectory)) {
- optionsRef.current.onError('模拟器没有相机,请用「照片」从相册选择。');
+ optionsRef.current.onError(t('composer.upload.simulatorNoCamera'));
return;
}
const permission = source === 'camera'
@@ -322,8 +324,8 @@ export function useMobileLocalAttachments(
: await ImagePicker.requestMediaLibraryPermissionsAsync(false);
if (!permission.granted) {
optionsRef.current.onError(source === 'camera'
- ? '相机权限未开启,请在系统设置里允许 Cindy 使用相机。'
- : '照片权限未开启,请在系统设置里允许 Cindy 访问照片。');
+ ? t('composer.upload.cameraPermission')
+ : t('composer.upload.photoPermission'));
return;
}
@@ -370,13 +372,13 @@ export function useMobileLocalAttachments(
const uri = asset?.uri?.trim();
const name = asset?.name?.trim();
if (!asset || !uri || !name) {
- optionsRef.current.onError('没有读取到可上传的文件。');
+ optionsRef.current.onError(t('composer.upload.noFileRead'));
return;
}
// 类型白名单同步校验:不支持的类型即时报错,不进托盘、不触发上传
// (上传层还有同口径兜底,防 OSS 孤儿)。
if (!categorizeMobileAttachment(name)) {
- optionsRef.current.onError('这个本机文件类型暂不支持作为附件发送。');
+ optionsRef.current.onError(t('composer.upload.fileTypeUnsupported'));
return;
}
diff --git a/apps/mobile/src/settings/mobileSettings.ts b/apps/mobile/src/settings/mobileSettings.ts
index 7e737f2a83..7564c4908e 100644
--- a/apps/mobile/src/settings/mobileSettings.ts
+++ b/apps/mobile/src/settings/mobileSettings.ts
@@ -1,5 +1,6 @@
import type { DeviceLinkStatus } from '@cindy/device-link';
-import { relayStatusHint, relayStatusLabel } from '@cindy/maker-shared/device-link-contract';
+
+import { i18n } from '@/i18n';
export interface MobileSettingsOverviewInput {
authBaseUrl: string;
@@ -58,8 +59,8 @@ export interface MobileSettingsOverview {
export function buildMobileSettingsOverview(input: MobileSettingsOverviewInput): MobileSettingsOverview {
const relayLabel = relayStatusLabel(input.relayStatus);
const relayDetail = relayStatusHint(input.relayStatus, input.lastSyncedAt ?? null);
- const name = input.userName?.trim() || input.userEmail?.trim() || '未登录';
- const deviceName = input.deviceName.trim() || '当前手机';
+ const name = input.userName?.trim() || input.userEmail?.trim() || i18n.t('settings.header.notSignedIn');
+ const deviceName = input.deviceName.trim() || i18n.t('settings.header.thisPhone');
const email = input.userEmail?.trim();
return {
header: {
@@ -73,53 +74,53 @@ export function buildMobileSettingsOverview(input: MobileSettingsOverviewInput):
sections: [
{
id: 'about',
- title: '关于这台手机',
+ title: i18n.t('settings.about.sectionTitle'),
rows: compactRows([
{
id: 'about.deviceName',
- label: '设备名称',
+ label: i18n.t('settings.about.deviceName'),
value: deviceName,
- detail: '电脑端授权列表会显示这个名称。',
+ detail: i18n.t('settings.about.deviceNameDetail'),
},
{
id: 'about.platform',
- label: '平台',
+ label: i18n.t('settings.about.platform'),
value: platformLabel(input.platform),
},
{
id: 'about.remoteControl',
- label: '被控权限',
- value: '电脑端管理',
- detail: '手机只作为控制端。允许被控、撤销和恢复权限仍在电脑端设置里完成。',
+ label: i18n.t('settings.about.remoteControl'),
+ value: i18n.t('settings.about.remoteControlValue'),
+ detail: i18n.t('settings.about.remoteControlDetail'),
},
]),
},
{
id: 'debug',
- title: '调试 / 开发者',
+ title: i18n.t('settings.debug.sectionTitle'),
collapsible: true,
rows: compactRows([
{
id: 'debug.userId',
- label: '用户 ID',
- value: input.userId?.trim() || '未同步',
+ label: i18n.t('settings.debug.userId'),
+ value: input.userId?.trim() || i18n.t('settings.debug.notSynced'),
copyValue: input.userId?.trim() || undefined,
},
{
id: 'debug.deviceId',
- label: '设备 ID',
- value: input.deviceId?.trim() || '初始化中',
+ label: i18n.t('settings.debug.deviceId'),
+ value: input.deviceId?.trim() || i18n.t('settings.debug.initializing'),
copyValue: input.deviceId?.trim() || undefined,
},
{
id: 'debug.authBaseUrl',
- label: 'Auth Server',
+ label: i18n.t('settings.debug.authServer'),
value: input.authBaseUrl,
copyValue: input.authBaseUrl,
},
{
id: 'debug.authRegion',
- label: '登录区域',
+ label: i18n.t('settings.debug.authRegion'),
value: input.authRegion === 'global' ? 'Global' : 'CN',
},
]),
@@ -134,6 +135,33 @@ export function relayStatusTone(status: DeviceLinkStatus): 'ready' | 'busy' | 'o
return 'off';
}
+// Relay 状态文案:原来消费 @cindy/maker-shared 的中文直出 helper(桌面端不用那组),
+// mobile i18n 化后改在本层用 catalog key 组装,逻辑与共享包版本保持一致。
+function relayStatusLabel(status: DeviceLinkStatus): string {
+ if (status === 'online') return i18n.t('settings.relay.online');
+ if (status === 'connecting') return i18n.t('settings.relay.connecting');
+ return i18n.t('settings.relay.stopped');
+}
+
+function relayStatusHint(status: DeviceLinkStatus, lastSyncedAt: number | null): string {
+ if (status === 'online') {
+ return lastSyncedAt
+ ? i18n.t('settings.relay.lastSynced', { time: formatClock(lastSyncedAt) })
+ : i18n.t('settings.relay.canSync');
+ }
+ if (status === 'connecting') return i18n.t('settings.relay.reconnectHint');
+ return i18n.t('settings.relay.resumeHint');
+}
+
+function formatClock(timestamp: number): string {
+ const date = new Date(timestamp);
+ return [
+ date.getHours().toString().padStart(2, '0'),
+ date.getMinutes().toString().padStart(2, '0'),
+ date.getSeconds().toString().padStart(2, '0'),
+ ].join(':');
+}
+
function compactRows(rows: MobileSettingsRow[]): MobileSettingsRow[] {
return rows.filter((row) => row.value.length > 0);
}
diff --git a/apps/mobile/src/settings/updateInfo.ts b/apps/mobile/src/settings/updateInfo.ts
index b040199b01..fde6a64cee 100644
--- a/apps/mobile/src/settings/updateInfo.ts
+++ b/apps/mobile/src/settings/updateInfo.ts
@@ -1,5 +1,7 @@
import type { CurrentlyRunningInfo } from 'expo-updates';
+import { i18n } from '@/i18n';
+
// 热更验证标记:纯 JS 常量,发 OTA 后在设备设置页看到该值即证明热更 bundle 已生效。
// 每次要验证热更时改这个值(建议带日期),验证完可保留或删除,对功能无影响。
export const OTA_VERIFY_MARKER = 'ota-check-20260707-2';
@@ -21,8 +23,8 @@ type MobileUpdateInfoInput = Pick<
export function currentMobileOtaVersion(
currentlyRunning: Pick<CurrentlyRunningInfo, 'updateId' | 'isEmbeddedLaunch'>,
): string {
- if (currentlyRunning.isEmbeddedLaunch) return '随整包';
- return currentlyRunning.updateId?.trim().slice(0, 8) || '未知';
+ if (currentlyRunning.isEmbeddedLaunch) return i18n.t('settings.updateInfo.embedded');
+ return currentlyRunning.updateId?.trim().slice(0, 8) || i18n.t('settings.updateInfo.unknown');
}
/**
@@ -37,12 +39,18 @@ export function buildMobileUpdateInfoRows(currentlyRunning: MobileUpdateInfoInpu
const updateId = currentlyRunning.updateId;
const createdAt = currentlyRunning.createdAt;
return [
- { id: 'source', label: '运行来源', value: currentlyRunning.isEmbeddedLaunch ? '内置版本(随包)' : 'OTA 热更新' },
- { id: 'updateId', label: '更新 ID', value: updateId ? updateId.slice(0, 8) : '—' },
- { id: 'updatedAt', label: '更新时间', value: createdAt ? formatMobileUpdateTime(createdAt) : '—' },
- { id: 'channel', label: 'Channel', value: currentlyRunning.channel?.trim() || '—' },
- { id: 'runtimeVersion', label: 'Runtime', value: currentlyRunning.runtimeVersion?.trim() || '—' },
- { id: 'otaMarker', label: '热更标记', value: OTA_VERIFY_MARKER },
+ {
+ id: 'source',
+ label: i18n.t('settings.updateInfo.source'),
+ value: currentlyRunning.isEmbeddedLaunch
+ ? i18n.t('settings.updateInfo.sourceEmbedded')
+ : i18n.t('settings.updateInfo.sourceOta'),
+ },
+ { id: 'updateId', label: i18n.t('settings.updateInfo.updateId'), value: updateId ? updateId.slice(0, 8) : '—' },
+ { id: 'updatedAt', label: i18n.t('settings.updateInfo.updatedAt'), value: createdAt ? formatMobileUpdateTime(createdAt) : '—' },
+ { id: 'channel', label: i18n.t('settings.updateInfo.channel'), value: currentlyRunning.channel?.trim() || '—' },
+ { id: 'runtimeVersion', label: i18n.t('settings.updateInfo.runtime'), value: currentlyRunning.runtimeVersion?.trim() || '—' },
+ { id: 'otaMarker', label: i18n.t('settings.updateInfo.otaMarker'), value: OTA_VERIFY_MARKER },
];
}
diff --git a/apps/mobile/src/update/fetchLatestRelease.ts b/apps/mobile/src/update/fetchLatestRelease.ts
index 19811dcbe7..4e4f7f3431 100644
--- a/apps/mobile/src/update/fetchLatestRelease.ts
+++ b/apps/mobile/src/update/fetchLatestRelease.ts
@@ -1,4 +1,5 @@
// 拉 mobile-update-server 的 `/latest`(整包版本记录)。薄 IO 封装,判定逻辑在 bundleUpdate.ts。
+import { i18n } from '@/i18n';
import { OTA_SERVER_BASE_URL } from '@/config/env';
const DEFAULT_TIMEOUT_MS = 8000;
@@ -27,7 +28,7 @@ export async function fetchLatestRelease(
headers: { accept: 'application/json' },
});
if (res.status === 404) return null; // 服务端确认暂无记录 = 无更新
- if (!res.ok) throw new Error(`latest 请求失败:HTTP ${res.status}`); // 5xx 等服务异常,不能当成"无更新"
+ if (!res.ok) throw new Error(i18n.t('update.latestRequestFailed', { status: res.status })); // 5xx 等服务异常,不能当成"无更新"
return await res.json();
} finally {
clearTimeout(timer);
diff --git a/apps/mobile/src/update/manualUpdateCheck.test.ts b/apps/mobile/src/update/manualUpdateCheck.test.ts
index d8af5bd3be..5181ca3475 100644
--- a/apps/mobile/src/update/manualUpdateCheck.test.ts
+++ b/apps/mobile/src/update/manualUpdateCheck.test.ts
@@ -1,10 +1,16 @@
-import { describe, expect, it, vi } from 'vitest';
+import { beforeAll, describe, expect, it, vi } from 'vitest';
+import { i18n } from '@/i18n';
import {
runManualUpdateCheck,
type BundleUpdateCheckOutcome,
type ManualUpdateCheckDeps,
} from './manualUpdateCheck';
+// 文案已 i18n 化;固定 zh-CN 让字面量断言与语言环境解耦(全局 mock 默认 en-US)。
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
/** 创建保留字面量结果类型的整包检查 mock。 */
const bundleCheck = (outcome: BundleUpdateCheckOutcome) =>
vi.fn(async (): Promise<BundleUpdateCheckOutcome> => outcome);
diff --git a/apps/mobile/src/update/manualUpdateCheck.ts b/apps/mobile/src/update/manualUpdateCheck.ts
index 4ebbbed461..ac1322c6c9 100644
--- a/apps/mobile/src/update/manualUpdateCheck.ts
+++ b/apps/mobile/src/update/manualUpdateCheck.ts
@@ -1,3 +1,5 @@
+import { i18n } from '@/i18n';
+
/** 手动整包检查结果,供统一流程决定是否继续检查 JS 热更新。 */
export type BundleUpdateCheckOutcome =
| 'skipped'
@@ -48,10 +50,10 @@ export async function runManualUpdateCheck({
try {
bundleOutcome = await checkBundleUpdate();
} catch {
- return { kind: 'error', message: '无法检查整包更新,请稍后重试' };
+ return { kind: 'error', message: i18n.t('settings.version.bundleCheckFailed') };
}
if (bundleOutcome === 'update-available') return { kind: 'bundle-update-available' };
- if (bundleOutcome === 'error') return { kind: 'error', message: '无法检查整包更新,请稍后重试' };
+ if (bundleOutcome === 'error') return { kind: 'error', message: i18n.t('settings.version.bundleCheckFailed') };
if (bundleOutcome === 'busy') return { kind: 'busy' };
}
@@ -68,7 +70,9 @@ export async function runManualUpdateCheck({
const detail = error instanceof Error ? error.message.trim() : String(error).trim();
return {
kind: 'error',
- message: detail ? `检查更新失败:${detail}` : '检查更新失败,请稍后重试',
+ message: detail
+ ? i18n.t('settings.version.checkFailedDetail', { detail })
+ : i18n.t('settings.version.checkFailed'),
};
}
}
diff --git a/apps/mobile/src/update/useBundleUpdatePrompt.ts b/apps/mobile/src/update/useBundleUpdatePrompt.ts
index 8bf7a21233..ff8a321b2e 100644
--- a/apps/mobile/src/update/useBundleUpdatePrompt.ts
+++ b/apps/mobile/src/update/useBundleUpdatePrompt.ts
@@ -9,6 +9,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
import { Alert, Linking, Platform } from 'react-native';
import Constants from 'expo-constants';
import * as Updates from 'expo-updates';
+import { i18n } from '@/i18n';
import { IS_OTA_SELFHOST, REVIEW_MODE } from '@/config/env';
import { fetchLatestRelease } from './fetchLatestRelease';
import { evaluateBundleUpdate, preferredInstallUrl } from './bundleUpdate';
@@ -36,10 +37,10 @@ async function openInstall(url: string): Promise<void> {
// 注意 openURL 在系统接下 URL 时即 resolve,早于用户在系统弹框里点「安装/取消」,
// 无法得知用户的选择,措辞必须是条件引导式,不能断言"安装已开始"。
if (url.startsWith('itms-services://')) {
- Alert.alert('安装提示', '在系统弹框中点击「安装」后,请回到桌面查看安装进度;下载完成后系统会自动替换当前版本。');
+ Alert.alert(i18n.t('update.installHintTitle'), i18n.t('update.installHintBody'));
}
} catch {
- Alert.alert('无法打开安装链接', '请手动复制安装地址在 Safari 中打开。');
+ Alert.alert(i18n.t('update.openInstallFailedTitle'), i18n.t('update.openInstallFailedBody'));
}
}
@@ -50,8 +51,8 @@ export function promptBundleUpdate(evaluation: ReturnType<typeof evaluateBundleU
if (!url) return;
const notes = evaluation.target.releaseNotes?.trim();
const message = [
- '发现新版本,需要下载安装整包更新。',
- notes ? `\n更新内容:\n${notes}` : '',
+ i18n.t('update.bundleAvailableBody'),
+ notes ? i18n.t('update.releaseNotes', { notes }) : '',
].join('');
if (evaluation.forced) {
@@ -60,12 +61,12 @@ export function promptBundleUpdate(evaluation: ReturnType<typeof evaluateBundleU
// 避免"已标记但未展示"导致强更对本进程永久失声。
markForcedPrompted(evaluation.target.runtimeVersion);
// 强制更新:不可取消,只留"去更新"。
- Alert.alert('需要更新', message, [{ text: '去更新', onPress: () => void openInstall(url) }], { cancelable: false });
+ Alert.alert(i18n.t('update.forcedTitle'), message, [{ text: i18n.t('update.goUpdate'), onPress: () => void openInstall(url) }], { cancelable: false });
return;
}
- Alert.alert('发现新版本', message, [
- { text: '稍后', style: 'cancel' },
- { text: '去更新', onPress: () => void openInstall(url) },
+ Alert.alert(i18n.t('update.newVersionTitle'), message, [
+ { text: i18n.t('update.later'), style: 'cancel' },
+ { text: i18n.t('update.goUpdate'), onPress: () => void openInstall(url) },
]);
}
@@ -113,7 +114,7 @@ export function useBundleUpdatePrompt({
return 'update-available';
} else {
setState('up-to-date');
- if (notifyWhenUpToDate) Alert.alert('已是最新版本', '当前已是最新整包版本。');
+ if (notifyWhenUpToDate) Alert.alert(i18n.t('update.upToDateTitle'), i18n.t('update.upToDateBody'));
return 'up-to-date';
}
} catch {
@@ -121,7 +122,7 @@ export function useBundleUpdatePrompt({
// fetchLatestRelease 连不上(网络/超时/5xx)时抛错:自动检查静默(尽力而为),
// 手动检查须提示"检查失败",不能沿用旧行为误报"已是最新"。
setState('error');
- if (notifyWhenUpToDate) Alert.alert('检查失败', '无法连接更新服务器,请稍后重试。');
+ if (notifyWhenUpToDate) Alert.alert(i18n.t('update.checkFailedTitle'), i18n.t('update.checkFailedBody'));
return 'error';
} finally {
inFlightChannels.current.delete(isCanary);
diff --git a/apps/mobile/vitest.config.ts b/apps/mobile/vitest.config.ts
index ed728ddc6d..3474568735 100644
--- a/apps/mobile/vitest.config.ts
+++ b/apps/mobile/vitest.config.ts
@@ -30,6 +30,9 @@ export default defineConfig({
// TEST_COLLECT_FAILED);无空格路径下两者逐字节一致,CI 行为零变化。
'@': fileURLToPath(new URL('./src', import.meta.url)),
'expo-constants': fileURLToPath(new URL('./src/__tests__/expo-constants.mock.ts', import.meta.url)),
+ // expo-localization 同款处理:真模块拖 react-native(Flow 语法)依赖链;
+ // 需要控制语言的测试用 vi.mock 覆盖(优先于 alias)。
+ 'expo-localization': fileURLToPath(new URL('./src/__tests__/expo-localization.mock.ts', import.meta.url)),
},
},
test: {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 6802793eb6..a78485a4a2 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -625,6 +625,9 @@ importers:
expo-web-browser:
specifier: ^56.0.5
version: 56.0.5([email protected])([email protected](patch_hash=9442031604caa9cd185e0b2be6867055459fc3a6d2781296027989db098f972d)(@babel/[email protected])(@react-native/[email protected](@babel/[email protected]))(@types/[email protected])([email protected]))
+ i18next:
+ specifier: ^26.3.6
+ version: 26.3.6([email protected])
lucide-react-native:
specifier: 0.468.0
version: 0.468.0([email protected]([email protected](patch_hash=9442031604caa9cd185e0b2be6867055459fc3a6d2781296027989db098f972d)(@babel/[email protected])(@react-native/[email protected](@babel/[email protected]))(@types/[email protected])([email protected]))([email protected]))([email protected](patch_hash=9442031604caa9cd185e0b2be6867055459fc3a6d2781296027989db098f972d)(@babel/[email protected])(@react-native/[email protected](@babel/[email protected]))(@types/[email protected])([email protected]))([email protected])
@@ -637,6 +640,9 @@ importers:
react-dom:
specifier: 19.2.3
version: 19.2.3([email protected])
+ react-i18next:
+ specifier: ^17.0.10
+ version: 17.0.10([email protected]([email protected]))([email protected]([email protected]))([email protected](patch_hash=9442031604caa9cd185e0b2be6867055459fc3a6d2781296027989db098f972d)(@babel/[email protected])(@react-native/[email protected](@babel/[email protected]))(@types/[email protected])([email protected]))([email protected])([email protected])
react-native:
specifier: 0.85.3
version: 0.85.3(patch_hash=9442031604caa9cd185e0b2be6867055459fc3a6d2781296027989db098f972d)(@babel/[email protected])(@react-native/[email protected](@babel/[email protected]))(@types/[email protected])([email protected])
@@ -17784,6 +17790,10 @@ snapshots:
optionalDependencies:
typescript: 5.9.3
+ optionalDependencies:
+ typescript: 6.0.3
+
dependencies:
cli-truncate: 2.1.0
@@ -19704,6 +19714,18 @@ snapshots:
react-dom: 19.2.3([email protected])
typescript: 5.9.3
+ dependencies:
+ '@babel/runtime': 7.29.7
+ html-parse-stringify: 3.0.1
+ i18next: 26.3.6([email protected])
+ react: 19.2.3
+ use-sync-external-store: 1.6.0([email protected])
+ optionalDependencies:
+ react-dom: 19.2.3([email protected])
+ react-native: 0.85.3(patch_hash=9442031604caa9cd185e0b2be6867055459fc3a6d2781296027989db098f972d)(@babel/[email protected])(@react-native/[email protected](@babel/[email protected]))(@types/[email protected])([email protected])
+ typescript: 6.0.3
+