Skip to content

The agent that grows with you

fix(desktop): localize remaining MoA preset controls

brooklyn!11dcf8f97ab9
diff --git a/apps/desktop/src/app/settings/model-settings.test.tsx b/apps/desktop/src/app/settings/model-settings.test.tsx
index 8d32a557e35..ce5d5a5dd25 100644
--- a/apps/desktop/src/app/settings/model-settings.test.tsx
+++ b/apps/desktop/src/app/settings/model-settings.test.tsx
@@ -520,6 +520,46 @@ describe('ModelSettings MoA preset editor', () => {
saveMoaModels.mockImplementation((body: unknown) => Promise.resolve(body))
})
+ it.each(['zh', 'zh-hant', 'ja'] as const)(
+ 'localizes MoA preset and reference controls in %s without changing their saved identities',
+ async locale => {
+ const { ModelSettings } = await import('./model-settings')
+ const { I18nProvider, TRANSLATIONS } = await import('@/i18n')
+ const client = new QueryClient({ defaultOptions: { queries: { retry: false } } })
+ const m = TRANSLATIONS[locale].settings.model
+ render(
+ <MemoryRouter>
+ <I18nProvider configClient={null} initialLocale={locale}>
+ <QueryClientProvider client={client}>
+ <ModelSettings subpage="moa" />
+ </QueryClientProvider>
+ </I18nProvider>
+ </MemoryRouter>
+ )
+ expect(m.moaDescription).not.toBe(TRANSLATIONS.en.settings.model.moaDescription)
+ expect(m.moaReferenceHint).not.toBe(TRANSLATIONS.en.settings.model.moaReferenceHint)
+ expect(m.moaAggregatorBilled).not.toBe(TRANSLATIONS.en.settings.model.moaAggregatorBilled)
+ await screen.findByText(m.moaDescription)
+ expect(screen.getByText(m.moaReferenceTitle(1))).toBeTruthy()
+ expect(screen.getByText(m.moaAggregator)).toBeTruthy()
+ expect(screen.getByRole('button', { name: m.moaAddReference })).toBeTruthy()
+ expect(screen.getByRole('button', { name: m.moaSetDefault })).toBeTruthy()
+ expect(screen.getByPlaceholderText(m.moaNewPresetPlaceholder)).toBeTruthy()
+ fireEvent.click(screen.getByRole('switch', { name: m.moaReferenceToggle(true, 1) }))
+ expect(screen.getByRole('switch', { name: m.moaReferenceToggle(false, 1) }).getAttribute('aria-checked')).toBe(
+ 'false'
+ )
+ await waitFor(() => expect(saveMoaModels).toHaveBeenCalled())
+ const saved = saveMoaModels.mock.calls.at(-1)![0] as ReturnType<typeof moaConfig>
+ expect(saved.default_preset).toBe('default')
+ expect(saved.presets.default.reference_models[0]).toMatchObject({
+ provider: 'nous',
+ model: 'hermes-4',
+ enabled: false
+ })
+ }
+ )
+
async function openReferenceEditor() {
await renderModelSettings()
expect(await screen.findByText('Reference 1')).toBeTruthy()
diff --git a/apps/desktop/src/app/settings/model-settings.tsx b/apps/desktop/src/app/settings/model-settings.tsx
index c5d0fefea37..a4d1f5eb39a 100644
--- a/apps/desktop/src/app/settings/model-settings.tsx
+++ b/apps/desktop/src/app/settings/model-settings.tsx
@@ -1196,7 +1196,7 @@ export function ModelSettings({ onMainModelChanged, scopeProfile, subpage }: Mod
</SelectContent>
</Select>
<label className="flex items-center gap-2 rounded-sm border border-border px-2 py-1 text-xs">
- Enabled
+ {m.moaEnabled}
<Switch
checked={currentMoaPreset.enabled !== false}
disabled={applying}
@@ -1217,7 +1217,7 @@ export function ModelSettings({ onMainModelChanged, scopeProfile, subpage }: Mod
size="sm"
variant="text"
>
- Set default
+ {m.moaSetDefault}
</Button>
<Button
disabled={Object.keys(moa.presets).length <= 1 || applying}
@@ -1243,12 +1243,12 @@ export function ModelSettings({ onMainModelChanged, scopeProfile, subpage }: Mod
size="sm"
variant="ghost"
>
- Delete
+ {t.common.delete}
</Button>
<Input
className={cn('w-40', CONTROL_TEXT)}
onChange={event => setNewMoaPresetName(event.target.value)}
- placeholder="new preset"
+ placeholder={m.moaNewPresetPlaceholder}
value={newMoaPresetName}
/>
<Button
@@ -1271,18 +1271,18 @@ export function ModelSettings({ onMainModelChanged, scopeProfile, subpage }: Mod
size="sm"
variant="textStrong"
>
- Add preset
+ {m.moaAddPreset}
</Button>
</div>
<div className="mb-2 text-xs text-muted-foreground">
- Default: <span className="font-mono">{moa.default_preset}</span>
+ {m.moaDefault} <span className="font-mono">{moa.default_preset}</span>
</div>
<div className="grid gap-1">
{currentMoaPreset.reference_models.map((slot, index) => (
<ListRow
action={
<Switch
- aria-label={`${slot.enabled !== false ? 'Disable' : 'Enable'} reference ${index + 1}`}
+ aria-label={m.moaReferenceToggle(slot.enabled !== false, index + 1)}
checked={slot.enabled !== false}
disabled={applying}
onCheckedChange={checked =>
@@ -1359,7 +1359,7 @@ export function ModelSettings({ onMainModelChanged, scopeProfile, subpage }: Mod
size="sm"
variant="ghost"
>
- Remove
+ {t.common.remove}
</Button>
</div>
}
@@ -1372,7 +1372,7 @@ export function ModelSettings({ onMainModelChanged, scopeProfile, subpage }: Mod
key={`${selectedMoaPreset}-${index}`}
title={
<span className="flex items-baseline gap-2">
- {`Reference ${index + 1}`}
+ {m.moaReferenceTitle(index + 1)}
<Pill>{m.moaReferenceHint}</Pill>
</span>
}
@@ -1389,7 +1389,7 @@ export function ModelSettings({ onMainModelChanged, scopeProfile, subpage }: Mod
size="sm"
variant="textStrong"
>
- Add reference model
+ {m.moaAddReference}
</Button>
<ListRow
below={
diff --git a/apps/desktop/src/i18n/ar.ts b/apps/desktop/src/i18n/ar.ts
index 6a887d268a4..52b717e3163 100644
--- a/apps/desktop/src/i18n/ar.ts
+++ b/apps/desktop/src/i18n/ar.ts
@@ -1070,6 +1070,21 @@ export const ar = defineLocale({
deepLinkErrorTooLarge: 'حجم الإعدادات يتجاوز الحد الأقصى 32KB.'
},
model: {
+ moaTitle: 'مزيج الوكلاء (Mixture of Agents)',
+ moaPreset: 'إعداد مسبق',
+ moaDescription:
+ 'اضبط إعدادات مسبقة مسماة تظهر كنماذج ضمن موفّر Mixture of Agents. نموذج التجميع هو المنفّذ؛ ينفّذ كل خطوة في حلقة الأدوات وتُحتسب غالبية تكلفة التشغيل على موفّره. تقدّم النماذج المرجعية المشورة مرة واحدة لكل رسالة مستخدم افتراضياً.',
+ moaAggregator: 'نموذج التجميع',
+ moaAggregatorBilled: 'النموذج المنفّذ · تُحتسب عليه تكلفة التشغيل',
+ moaReferenceHint: 'يقدّم المشورة مرة واحدة لكل رسالة افتراضياً',
+ moaEnabled: 'مُفعّل',
+ moaSetDefault: 'تعيين الافتراضي',
+ moaNewPresetPlaceholder: 'إعداد جديد',
+ moaAddPreset: 'إضافة إعداد',
+ moaDefault: 'الافتراضي:',
+ moaReferenceToggle: (enabled, index) => `${enabled ? 'تعطيل' : 'تفعيل'} المرجع ${index}`,
+ moaReferenceTitle: index => `المرجع ${index}`,
+ moaAddReference: 'إضافة نموذج مرجعي',
loading: 'جار تحميل إعدادات النموذج...',
appliesDesc: 'ينطبق على الجلسات الجديدة. استخدم منتقي النموذج في صندوق الإنشاء لتبديل المحادثة النشطة فورا.',
provider: 'المزوّد',
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index 259ef3ac637..8013f4eec8b 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -1632,6 +1632,14 @@ export const en: Translations = {
deepLinkErrorTooLarge: 'The config payload exceeds the 32KB limit.'
},
model: {
+ moaEnabled: 'Enabled',
+ moaSetDefault: 'Set default',
+ moaNewPresetPlaceholder: 'new preset',
+ moaAddPreset: 'Add preset',
+ moaDefault: 'Default:',
+ moaReferenceToggle: (enabled, index) => `${enabled ? 'Disable' : 'Enable'} reference ${index}`,
+ moaReferenceTitle: index => `Reference ${index}`,
+ moaAddReference: 'Add reference model',
loading: 'Loading model configuration...',
appliesDesc: 'Applies to new sessions. Use the model picker in the composer to hot-swap the active chat.',
provider: 'Provider',
diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts
index 7be457ab853..6b701f119a3 100644
--- a/apps/desktop/src/i18n/ja.ts
+++ b/apps/desktop/src/i18n/ja.ts
@@ -1230,6 +1230,21 @@ export const ja = defineLocale({
deepLinkErrorTooLarge: '設定ペイロードが 32KB の上限を超えています。'
},
model: {
+ moaTitle: 'エージェント混合(Mixture of Agents)',
+ moaPreset: 'プリセット',
+ moaDescription:
+ '「Mixture of Agents」プロバイダーのモデルとして表示される名前付きプリセットを設定します。集約モデルが実行を担当し、ツールループのすべての処理を行うため、実行費用のほぼ全額がそのプロバイダーに請求されます。参照モデルは既定でユーザーの各ターンに一度だけ助言します。',
+ moaAggregator: '集約モデル',
+ moaAggregatorBilled: '実行モデル · 実行費用の請求先',
+ moaReferenceHint: '既定では各ターンに一度だけ助言',
+ moaEnabled: '有効',
+ moaSetDefault: 'デフォルトに設定',
+ moaNewPresetPlaceholder: '新しいプリセット',
+ moaAddPreset: 'プリセットを追加',
+ moaDefault: 'デフォルト:',
+ moaReferenceToggle: (enabled, index) => `参照 ${index} を${enabled ? '無効化' : '有効化'}`,
+ moaReferenceTitle: index => `参照 ${index}`,
+ moaAddReference: '参照モデルを追加',
loading: 'モデル設定を読み込み中...',
appliesDesc:
'新しいセッションに適用されます。コンポーザーのモデルピッカーを使ってアクティブなチャットをホットスワップできます。',
diff --git a/apps/desktop/src/i18n/ru.ts b/apps/desktop/src/i18n/ru.ts
index 691690332bb..5d003b83c2a 100644
--- a/apps/desktop/src/i18n/ru.ts
+++ b/apps/desktop/src/i18n/ru.ts
@@ -1424,6 +1424,20 @@ export const ru = defineLocale({
deepLinkErrorTooLarge: 'Пакет конфигурации превышает лимит 32 КБ.'
},
model: {
+ moaPreset: 'Пресет',
+ moaDescription:
+ 'Настройте именованные пресеты, которые появятся как модели провайдера Mixture of Agents. Модель-агрегатор выполняет каждый шаг цикла инструментов; почти вся стоимость запуска списывается у её провайдера. По умолчанию референсные модели дают совет один раз на сообщение пользователя.',
+ moaAggregator: 'Модель-агрегатор',
+ moaAggregatorBilled: 'исполняющая модель · на неё приходится стоимость запуска',
+ moaReferenceHint: 'по умолчанию советует один раз за ход',
+ moaEnabled: 'Включено',
+ moaSetDefault: 'Сделать основным',
+ moaNewPresetPlaceholder: 'новый пресет',
+ moaAddPreset: 'Добавить пресет',
+ moaDefault: 'По умолчанию:',
+ moaReferenceToggle: (enabled, index) => `${enabled ? 'Отключить' : 'Включить'} референс ${index}`,
+ moaReferenceTitle: index => `Референс ${index}`,
+ moaAddReference: 'Добавить референсную модель',
loading: 'Загрузка конфигурации модели…',
appliesDesc:
'Применяется к новым сеансам. Для горячей смены модели в активном чате используйте выборщик модели в композере.',
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index 7cab3a37714..5db61ae2790 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -1388,6 +1388,14 @@ export interface Translations {
deepLinkErrorTooLarge: string
}
model: {
+ moaEnabled: string
+ moaSetDefault: string
+ moaNewPresetPlaceholder: string
+ moaAddPreset: string
+ moaDefault: string
+ moaReferenceToggle: (enabled: boolean, index: number) => string
+ moaReferenceTitle: (index: number) => string
+ moaAddReference: string
loading: string
appliesDesc: string
provider: string
diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.ts
index 357cbd83eae..98efd90f5fb 100644
--- a/apps/desktop/src/i18n/zh-hant.ts
+++ b/apps/desktop/src/i18n/zh-hant.ts
@@ -1246,6 +1246,14 @@ export const zhHant = defineLocale({
deepLinkErrorTooLarge: '設定內容超過 32KB 上限。'
},
model: {
+ moaEnabled: '啟用',
+ moaSetDefault: '設為預設',
+ moaNewPresetPlaceholder: '新預設',
+ moaAddPreset: '新增預設',
+ moaDefault: '預設:',
+ moaReferenceToggle: (enabled, index) => `${enabled ? '停用' : '啟用'}參考 ${index}`,
+ moaReferenceTitle: index => `參考 ${index}`,
+ moaAddReference: '新增參考模型',
loading: '正在載入模型設定...',
appliesDesc: '套用至新工作階段。可在輸入框的模型選擇器中臨時切換目前對話。',
provider: '提供方',
diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts
index 36076d004bb..f284c8c9113 100644
--- a/apps/desktop/src/i18n/zh.ts
+++ b/apps/desktop/src/i18n/zh.ts
@@ -1584,6 +1584,14 @@ export const zh = defineLocale({
deepLinkErrorTooLarge: '配置负载超过 32KB 上限。'
},
model: {
+ moaEnabled: '启用',
+ moaSetDefault: '设为默认',
+ moaNewPresetPlaceholder: '新预设',
+ moaAddPreset: '添加预设',
+ moaDefault: '默认:',
+ moaReferenceToggle: (enabled, index) => `${enabled ? '禁用' : '启用'}参考 ${index}`,
+ moaReferenceTitle: index => `参考 ${index}`,
+ moaAddReference: '添加参考模型',
loading: '正在加载模型配置...',
appliesDesc: '应用于新会话。可在输入框的模型选择器中临时切换当前对话。',
provider: '提供方',