Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(i18n): add memory family gate translations for multiple locales

Steven Enamakel901e8c927ac6
diff --git a/app/src/components/intelligence/MemoryFamilyGate.tsx b/app/src/components/intelligence/MemoryFamilyGate.tsx
new file mode 100644
index 0000000000..dc8ba7ff7b
--- /dev/null
+++ b/app/src/components/intelligence/MemoryFamilyGate.tsx
@@ -0,0 +1,35 @@
+import type { ReactNode } from 'react';
+
+import { useT } from '../../lib/i18n/I18nContext';
+import { useMemoryEngineCapabilities } from './useMemoryEngineCapabilities';
+
+interface MemoryFamilyGateProps {
+ /** Capability family the wrapped content needs (e.g. `tree`, `goals`). */
+ family: string;
+ children: ReactNode;
+}
+
+/**
+ * Renders `children` when the bound memory engine has `family` (or when that is
+ * not yet known), otherwise a friendly "Not available with <engine>" state in
+ * place of an error.
+ */
+export default function MemoryFamilyGate({ family, children }: MemoryFamilyGateProps) {
+ const { t } = useT();
+ const { id, label, capabilities } = useMemoryEngineCapabilities();
+
+ if (!id || !capabilities || capabilities.has(family)) return <>{children}</>;
+
+ const engine = t(`memoryEngine.engine.${id}.label`, label ?? id);
+ return (
+ <div
+ data-testid="memory-family-unavailable"
+ data-family={family}
+ className="rounded-lg border border-line px-4 py-6 text-center">
+ <p className="text-sm font-medium text-content">
+ {t('memoryEngine.unavailable').replace('{engine}', engine)}
+ </p>
+ <p className="mt-1 text-xs text-content-muted">{t('memoryEngine.unavailableHint')}</p>
+ </div>
+ );
+}
diff --git a/app/src/components/intelligence/useMemoryEngineCapabilities.ts b/app/src/components/intelligence/useMemoryEngineCapabilities.ts
new file mode 100644
index 0000000000..9d94e50b88
--- /dev/null
+++ b/app/src/components/intelligence/useMemoryEngineCapabilities.ts
@@ -0,0 +1,52 @@
+import debug from 'debug';
+import { useEffect, useState } from 'react';
+
+import { memoryEngineGet, memoryEnginesList } from '../../utils/tauriCommands/memoryEngine';
+
+const log = debug('brain:memory-engine-capabilities');
+
+export interface MemoryEngineCapabilities {
+ /** Id of the bound engine; null until the core answers or if it cannot. */
+ id: string | null;
+ /** Human label of the bound engine (falls back to the id). */
+ label: string | null;
+ /** Capability families the bound engine advertises; null while unknown. */
+ capabilities: ReadonlySet<string> | null;
+}
+
+const UNKNOWN: MemoryEngineCapabilities = { id: null, label: null, capabilities: null };
+
+/**
+ * The active memory engine and the capability families it advertises, from
+ * `engine_get` + `engines_list`.
+ *
+ * Fails open: while loading, or if the core does not answer, `capabilities` is
+ * null and callers must treat every family as available. Hiding a working
+ * feature because a status probe failed would be worse than showing an error.
+ */
+export function useMemoryEngineCapabilities(): MemoryEngineCapabilities {
+ const [state, setState] = useState<MemoryEngineCapabilities>(UNKNOWN);
+
+ useEffect(() => {
+ let cancelled = false;
+ void (async () => {
+ try {
+ const [list, current] = await Promise.all([memoryEnginesList(), memoryEngineGet()]);
+ if (cancelled) return;
+ const entry = list.engines.find(e => e.id === current.driver);
+ setState({
+ id: current.driver,
+ label: entry?.label ?? current.driver,
+ capabilities: entry ? new Set(entry.capabilities) : null,
+ });
+ } catch (err) {
+ log('capabilities unavailable: %o', err);
+ }
+ })();
+ return () => {
+ cancelled = true;
+ };
+ }, []);
+
+ return state;
+}
diff --git a/app/src/lib/i18n/ar.ts b/app/src/lib/i18n/ar.ts
index 4ca92f8df1..bbcf37930f 100644
--- a/app/src/lib/i18n/ar.ts
+++ b/app/src/lib/i18n/ar.ts
@@ -7153,6 +7153,8 @@ const messages: TranslationMap = {
'memoryEngine.error.signIn': 'تسجيل الدخول',
'memoryEngine.row.label': 'محرك الذاكرة:',
'memoryEngine.row.change': 'تغيير',
+ 'memoryEngine.unavailable': 'غير متاح مع {engine}',
+ 'memoryEngine.unavailableHint': 'بدّل محرك الذاكرة لاستخدام هذه الميزة.',
'memoryEngine.engine.tinymemory.label': 'محلي (TinyCortex)',
'memoryEngine.engine.tinymemory.description':
'يُحفظ على هذا الجهاز باستخدام TinyCortex. خاص ومجاني وهو الخيار الافتراضي.',
diff --git a/app/src/lib/i18n/bn.ts b/app/src/lib/i18n/bn.ts
index 10c8ad9c52..310d0da94d 100644
--- a/app/src/lib/i18n/bn.ts
+++ b/app/src/lib/i18n/bn.ts
@@ -7308,6 +7308,8 @@ const messages: TranslationMap = {
'memoryEngine.error.signIn': 'সাইন ইন',
'memoryEngine.row.label': 'মেমোরি ইঞ্জিন:',
'memoryEngine.row.change': 'পরিবর্তন',
+ 'memoryEngine.unavailable': '{engine}-এ উপলব্ধ নয়',
+ 'memoryEngine.unavailableHint': 'এই ফিচারটি ব্যবহার করতে মেমোরি ইঞ্জিন পরিবর্তন করুন।',
'memoryEngine.engine.tinymemory.label': 'লোকাল (TinyCortex)',
'memoryEngine.engine.tinymemory.description':
'TinyCortex দিয়ে এই ডিভাইসে সংরক্ষিত। ব্যক্তিগত, বিনামূল্যে এবং ডিফল্ট।',
diff --git a/app/src/lib/i18n/de.ts b/app/src/lib/i18n/de.ts
index d9f9f54aa3..d704ce391c 100644
--- a/app/src/lib/i18n/de.ts
+++ b/app/src/lib/i18n/de.ts
@@ -7509,6 +7509,8 @@ const messages: TranslationMap = {
'memoryEngine.error.signIn': 'Anmelden',
'memoryEngine.row.label': 'Speicher-Engine:',
'memoryEngine.row.change': 'Ändern',
+ 'memoryEngine.unavailable': 'Mit {engine} nicht verfügbar',
+ 'memoryEngine.unavailableHint': 'Wechsle die Speicher-Engine, um diese Funktion zu nutzen.',
'memoryEngine.engine.tinymemory.label': 'Lokal (TinyCortex)',
'memoryEngine.engine.tinymemory.description':
'Auf diesem Gerät mit TinyCortex gespeichert. Privat, kostenlos und der Standard.',
diff --git a/app/src/lib/i18n/en.ts b/app/src/lib/i18n/en.ts
index 4f4119b00b..9251ae3bb1 100644
--- a/app/src/lib/i18n/en.ts
+++ b/app/src/lib/i18n/en.ts
@@ -7622,6 +7622,8 @@ const en: TranslationMap = {
'memoryEngine.error.signIn': 'Sign in',
'memoryEngine.row.label': 'Memory engine:',
'memoryEngine.row.change': 'Change',
+ 'memoryEngine.unavailable': 'Not available with {engine}',
+ 'memoryEngine.unavailableHint': 'Switch memory engine to use this feature.',
'memoryEngine.engine.tinymemory.label': 'Local (TinyCortex)',
'memoryEngine.engine.tinymemory.description':
'Stored on this device with TinyCortex. Private, free and the default.',
diff --git a/app/src/lib/i18n/es.ts b/app/src/lib/i18n/es.ts
index 625e874d8b..5c9573014c 100644
--- a/app/src/lib/i18n/es.ts
+++ b/app/src/lib/i18n/es.ts
@@ -7463,6 +7463,8 @@ const messages: TranslationMap = {
'memoryEngine.error.signIn': 'Iniciar sesión',
'memoryEngine.row.label': 'Motor de memoria:',
'memoryEngine.row.change': 'Cambiar',
+ 'memoryEngine.unavailable': 'No disponible con {engine}',
+ 'memoryEngine.unavailableHint': 'Cambia el motor de memoria para usar esta función.',
'memoryEngine.engine.tinymemory.label': 'En este equipo (TinyCortex)',
'memoryEngine.engine.tinymemory.description':
'Guardada en este dispositivo con TinyCortex. Privada, gratuita y predeterminada.',
diff --git a/app/src/lib/i18n/fr.ts b/app/src/lib/i18n/fr.ts
index 0afc890286..5f22ee2fdc 100644
--- a/app/src/lib/i18n/fr.ts
+++ b/app/src/lib/i18n/fr.ts
@@ -7492,6 +7492,8 @@ const messages: TranslationMap = {
'memoryEngine.error.signIn': 'Se connecter',
'memoryEngine.row.label': 'Moteur de mémoire :',
'memoryEngine.row.change': 'Modifier',
+ 'memoryEngine.unavailable': 'Non disponible avec {engine}',
+ 'memoryEngine.unavailableHint': 'Changez de moteur de mémoire pour utiliser cette fonctionnalité.',
'memoryEngine.engine.tinymemory.label': 'Sur cet appareil (TinyCortex)',
'memoryEngine.engine.tinymemory.description':
'Stockée sur cet appareil avec TinyCortex. Privée, gratuite et par défaut.',
diff --git a/app/src/lib/i18n/hi.ts b/app/src/lib/i18n/hi.ts
index 4d0f6e5350..db6e1f85c8 100644
--- a/app/src/lib/i18n/hi.ts
+++ b/app/src/lib/i18n/hi.ts
@@ -7309,6 +7309,8 @@ const messages: TranslationMap = {
'memoryEngine.error.signIn': 'साइन इन करें',
'memoryEngine.row.label': 'मेमोरी इंजन:',
'memoryEngine.row.change': 'बदलें',
+ 'memoryEngine.unavailable': '{engine} के साथ उपलब्ध नहीं',
+ 'memoryEngine.unavailableHint': 'इस सुविधा का उपयोग करने के लिए मेमोरी इंजन बदलें।',
'memoryEngine.engine.tinymemory.label': 'लोकल (TinyCortex)',
'memoryEngine.engine.tinymemory.description':
'TinyCortex के साथ इसी डिवाइस पर सहेजा जाता है। निजी, मुफ़्त और डिफ़ॉल्ट।',
diff --git a/app/src/lib/i18n/id.ts b/app/src/lib/i18n/id.ts
index ad7d34e67c..2bf222d475 100644
--- a/app/src/lib/i18n/id.ts
+++ b/app/src/lib/i18n/id.ts
@@ -7357,6 +7357,8 @@ const messages: TranslationMap = {
'memoryEngine.error.signIn': 'Masuk',
'memoryEngine.row.label': 'Mesin memori:',
'memoryEngine.row.change': 'Ubah',
+ 'memoryEngine.unavailable': 'Tidak tersedia dengan {engine}',
+ 'memoryEngine.unavailableHint': 'Ganti mesin memori untuk memakai fitur ini.',
'memoryEngine.engine.tinymemory.label': 'Lokal (TinyCortex)',
'memoryEngine.engine.tinymemory.description':
'Disimpan di perangkat ini dengan TinyCortex. Privat, gratis, dan bawaan.',
diff --git a/app/src/lib/i18n/it.ts b/app/src/lib/i18n/it.ts
index 6f9af38b09..73fccfef66 100644
--- a/app/src/lib/i18n/it.ts
+++ b/app/src/lib/i18n/it.ts
@@ -7440,6 +7440,8 @@ const messages: TranslationMap = {
'memoryEngine.error.signIn': 'Accedi',
'memoryEngine.row.label': 'Motore di memoria:',
'memoryEngine.row.change': 'Modifica',
+ 'memoryEngine.unavailable': 'Non disponibile con {engine}',
+ 'memoryEngine.unavailableHint': 'Cambia il motore di memoria per usare questa funzione.',
'memoryEngine.engine.tinymemory.label': 'Locale (TinyCortex)',
'memoryEngine.engine.tinymemory.description':
'Salvata su questo dispositivo con TinyCortex. Privata, gratuita e predefinita.',
diff --git a/app/src/lib/i18n/ko.ts b/app/src/lib/i18n/ko.ts
index 3bf067fb5a..2ec236d226 100644
--- a/app/src/lib/i18n/ko.ts
+++ b/app/src/lib/i18n/ko.ts
@@ -7226,6 +7226,8 @@ const messages: TranslationMap = {
'memoryEngine.error.signIn': '로그인',
'memoryEngine.row.label': '메모리 엔진:',
'memoryEngine.row.change': '변경',
+ 'memoryEngine.unavailable': '{engine}에서는 사용할 수 없음',
+ 'memoryEngine.unavailableHint': '이 기능을 사용하려면 메모리 엔진을 바꾸세요.',
'memoryEngine.engine.tinymemory.label': '로컬 (TinyCortex)',
'memoryEngine.engine.tinymemory.description':
'TinyCortex로 이 기기에 저장됩니다. 비공개, 무료이며 기본값입니다.',
diff --git a/app/src/lib/i18n/pl.ts b/app/src/lib/i18n/pl.ts
index d3d14831a0..b60f37cf41 100644
--- a/app/src/lib/i18n/pl.ts
+++ b/app/src/lib/i18n/pl.ts
@@ -7416,6 +7416,8 @@ const messages: TranslationMap = {
'memoryEngine.error.signIn': 'Zaloguj się',
'memoryEngine.row.label': 'Silnik pamięci:',
'memoryEngine.row.change': 'Zmień',
+ 'memoryEngine.unavailable': 'Niedostępne w {engine}',
+ 'memoryEngine.unavailableHint': 'Zmień silnik pamięci, aby korzystać z tej funkcji.',
'memoryEngine.engine.tinymemory.label': 'Lokalny (TinyCortex)',
'memoryEngine.engine.tinymemory.description':
'Przechowywana na tym urządzeniu za pomocą TinyCortex. Prywatna, bezpłatna i domyślna.',
diff --git a/app/src/lib/i18n/pt.ts b/app/src/lib/i18n/pt.ts
index acf2196046..52a149a1cf 100644
--- a/app/src/lib/i18n/pt.ts
+++ b/app/src/lib/i18n/pt.ts
@@ -7431,6 +7431,8 @@ const messages: TranslationMap = {
'memoryEngine.error.signIn': 'Iniciar sessão',
'memoryEngine.row.label': 'Mecanismo de memória:',
'memoryEngine.row.change': 'Alterar',
+ 'memoryEngine.unavailable': 'Indisponível com {engine}',
+ 'memoryEngine.unavailableHint': 'Troque o mecanismo de memória para usar este recurso.',
'memoryEngine.engine.tinymemory.label': 'Neste dispositivo (TinyCortex)',
'memoryEngine.engine.tinymemory.description':
'Armazenada neste dispositivo com o TinyCortex. Privada, gratuita e padrão.',
diff --git a/app/src/lib/i18n/ru.ts b/app/src/lib/i18n/ru.ts
index c6560e9b6b..196b481079 100644
--- a/app/src/lib/i18n/ru.ts
+++ b/app/src/lib/i18n/ru.ts
@@ -7384,6 +7384,8 @@ const messages: TranslationMap = {
'memoryEngine.error.signIn': 'Войти',
'memoryEngine.row.label': 'Движок памяти:',
'memoryEngine.row.change': 'Изменить',
+ 'memoryEngine.unavailable': 'Недоступно с {engine}',
+ 'memoryEngine.unavailableHint': 'Смените движок памяти, чтобы использовать эту функцию.',
'memoryEngine.engine.tinymemory.label': 'Локальный (TinyCortex)',
'memoryEngine.engine.tinymemory.description':
'Хранится на этом устройстве с помощью TinyCortex. Приватно, бесплатно и по умолчанию.',
diff --git a/app/src/lib/i18n/zh-CN.ts b/app/src/lib/i18n/zh-CN.ts
index 96a3f80204..6a9310e2b5 100644
--- a/app/src/lib/i18n/zh-CN.ts
+++ b/app/src/lib/i18n/zh-CN.ts
@@ -6926,6 +6926,8 @@ const messages: TranslationMap = {
'memoryEngine.error.signIn': '登录',
'memoryEngine.row.label': '记忆引擎:',
'memoryEngine.row.change': '更改',
+ 'memoryEngine.unavailable': '{engine} 不支持此功能',
+ 'memoryEngine.unavailableHint': '请切换记忆引擎以使用此功能。',
'memoryEngine.engine.tinymemory.label': '本地(TinyCortex)',
'memoryEngine.engine.tinymemory.description':
'通过 TinyCortex 存储在此设备上。私密、免费,为默认选项。',