mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 20:34:19 +00:00
fix(ui): localize status and Kilo messages
Route resource and extras status labels through the locale dictionaries. Translate the Kilo project environment-reference error while preserving its project path and server name.
This commit is contained in:
@@ -15,7 +15,7 @@ import MCPServerDialog from './MCPServerDialog';
|
||||
import MCPServerList from './MCPServerList';
|
||||
import MCPSyncBox from './MCPSyncBox';
|
||||
import { TargetPill } from './TargetPicker';
|
||||
import { buildMatrix, describeEndpoint, projectOf, targetLabel } from './mcpView';
|
||||
import { buildMatrix, describeEndpoint, describeError, projectOf, targetLabel } from './mcpView';
|
||||
|
||||
type MCPList = Awaited<ReturnType<typeof mcpApi.list>>;
|
||||
|
||||
@@ -64,7 +64,7 @@ export default function MCPProjectView({ data, root, offered, onChanged, onRemov
|
||||
await mcpApi.save({ ...mutation, project: root });
|
||||
onChanged();
|
||||
} catch (e) {
|
||||
toast((e as Error).message, 'error');
|
||||
toast(describeError(t, (e as Error).message), 'error');
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
@@ -100,7 +100,7 @@ export default function MCPProjectView({ data, root, offered, onChanged, onRemov
|
||||
await mcpApi.save({ project: root, remove: true });
|
||||
onRemoved();
|
||||
} catch (e) {
|
||||
toast((e as Error).message, 'error');
|
||||
toast(describeError(t, (e as Error).message), 'error');
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ import { useT } from '../../i18n';
|
||||
import PiExtensionField from './PiExtensionField';
|
||||
import DirectToolsField, { directToolsComplete, directToolsDraft, directToolsValue } from './DirectToolsField';
|
||||
import MCPConfigView from './MCPConfigView';
|
||||
import { joinCommand, splitCommand, targetLabel } from './mcpView';
|
||||
import { describeError, joinCommand, splitCommand, targetLabel } from './mcpView';
|
||||
|
||||
// Mirrors mcp.serverName
|
||||
const NAME = /^[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}$/;
|
||||
@@ -146,7 +146,7 @@ export default function MCPServerDialog({ initial, defaultTargets, defaultPiExte
|
||||
await mcpApi.save({ project, name: trimmed, server: next, replace: Boolean(initial) });
|
||||
onSaved();
|
||||
} catch (e) {
|
||||
setError((e as Error).message);
|
||||
setError(describeError(t, (e as Error).message));
|
||||
setSaving(false);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import type { MCPPlan } from '../../api/mcp';
|
||||
import { buildMatrix, describeMessage, isResolvable, joinCommand, splitCommand, targetLabel } from './mcpView';
|
||||
import { buildMatrix, describeError, describeMessage, isResolvable, joinCommand, splitCommand, targetLabel } from './mcpView';
|
||||
import { mcpTargets } from '../../api/mcp';
|
||||
|
||||
const change = (name: string, target: string, action: string, message?: string) => ({ name, target, action, message, path: `/${target}.json` });
|
||||
@@ -26,6 +26,12 @@ describe('MCP view helpers', () => {
|
||||
.toBe('[mcp.conflictOtherConfig]: /live/config.yaml');
|
||||
});
|
||||
|
||||
it('translates the Kilo project environment error and preserves its project path', () => {
|
||||
const t = (key: string, params?: Record<string, string>) => `[${key}:${params?.name}]`;
|
||||
expect(describeError(t, 'D:\\project: Kilo Code MCP mcp-test: Kilo does not allow environment references in project config and ignores the whole file when it finds one; remove fromEnv here or define this server in global mode'))
|
||||
.toBe('D:\\project: [mcp.kilocodeProjectEnv:mcp-test]');
|
||||
});
|
||||
|
||||
// The owner messages end in a path, so matching them needs the same prefix search
|
||||
// describeMessage uses. A live owner keeps no buttons: only it can release the entry.
|
||||
it('only offers import or replace for conflicts the source can take over', () => {
|
||||
|
||||
@@ -66,6 +66,19 @@ export const describeMessage = (t: (key: string) => string, message = '') => {
|
||||
return start ? t(conflictKeys[start]) + message.slice(start.length) : message;
|
||||
};
|
||||
|
||||
const kiloProjectEnvPrefix = 'Kilo Code MCP ';
|
||||
const kiloProjectEnvSuffix = ': Kilo does not allow environment references in project config and ignores the whole file when it finds one; remove fromEnv here or define this server in global mode';
|
||||
|
||||
/** Localizes the actionable Kilo project error while preserving a leading project path. */
|
||||
export const describeError = (t: (key: string, params?: Record<string, string>) => string, message = '') => {
|
||||
const start = message.indexOf(kiloProjectEnvPrefix);
|
||||
if (start < 0) return message;
|
||||
const nameStart = start + kiloProjectEnvPrefix.length;
|
||||
const end = message.indexOf(kiloProjectEnvSuffix, nameStart);
|
||||
if (end < 0) return message;
|
||||
return message.slice(0, start) + t('mcp.kilocodeProjectEnv', { name: message.slice(nameStart, end) });
|
||||
};
|
||||
|
||||
/** A synced Claude entry that a local-scope server of the same name hides in this project. */
|
||||
export const isShadowed = (change: MCPChange) => change.action !== 'conflict' && Boolean(change.message?.startsWith(shadowMessage));
|
||||
|
||||
|
||||
@@ -71,4 +71,11 @@ describe('i18n dictionaries', () => {
|
||||
expect(translate('zh-TW', 'theme.settings')).toBe('主題');
|
||||
expect(translate('zh-TW', 'missing.key', undefined, 'Fallback')).toBe('Fallback');
|
||||
});
|
||||
|
||||
it('localizes resource, extra, and Kilo project status copy', () => {
|
||||
expect(translate('zh-TW', 'resources.status.enabled')).toBe('已啟用');
|
||||
expect(translate('zh-TW', 'extras.status.synced')).toBe('已同步');
|
||||
expect(translate('zh-TW', 'mcp.kilocodeProjectEnv', { name: 'mcp-test' }))
|
||||
.toContain('Kilo Code MCP mcp-test:Kilo 不允許');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -351,6 +351,10 @@
|
||||
"extras.subtitle.global": "Weitere Ordner neben Skills, die synchron bleiben sollen: rules, commands, prompts. Jeder hat eigene Source und Targets.",
|
||||
"extras.subtitle.project": "Weitere Projektordner neben Skills, die synchron bleiben sollen: rules, commands, prompts. Jeder hat eigene Source und Targets.",
|
||||
"extras.sync": "Synchronisieren",
|
||||
"extras.status.synced": "Synchronisiert",
|
||||
"extras.status.drift": "Abweichung",
|
||||
"extras.status.notSynced": "Nicht synchronisiert",
|
||||
"extras.status.sourceMissing": "Quelle fehlt",
|
||||
"extras.title": "Extras",
|
||||
"extras.toast.created": "Extra \"{name}\" erstellt",
|
||||
"extras.toast.nErrors": "{errors} Fehler",
|
||||
@@ -807,6 +811,9 @@
|
||||
"resources.search.agents": "Agents suchen",
|
||||
"resources.toolbar.source": "Quelle",
|
||||
"resources.toolbar.status": "Status",
|
||||
"resources.status.all": "Alle",
|
||||
"resources.status.enabled": "Aktiviert",
|
||||
"resources.status.disabled": "Deaktiviert",
|
||||
"resources.toolbar.target": "Ziel",
|
||||
"resources.toolbar.group": "Gruppe",
|
||||
"resources.toolbar.sort": "Sortierung",
|
||||
@@ -1641,6 +1648,7 @@
|
||||
"mcp.projects.writesSwitch": "{target} bekommt {field}",
|
||||
"mcp.projects.noSwitch": "Keiner seiner Agents hat einen Schalter pro Projekt.",
|
||||
"mcp.projects.overridden": "Dieses Projekt definiert einen eigenen Server mit diesem Namen.",
|
||||
"mcp.kilocodeProjectEnv": "Kilo Code MCP {name}: Kilo erlaubt keine Umgebungsvariablen-Referenzen in der Projektkonfiguration und ignoriert die gesamte Datei, sobald eine gefunden wird. Entfernen Sie hier fromEnv oder definieren Sie diesen Server im globalen Modus.",
|
||||
"projects.title": "Projekte",
|
||||
"projects.subtitle": "Projektordner, die aus der globalen config.yaml synchronisiert werden. Die Ordner brauchen kein .skillshare/, und ein Sync schreibt sie alle.",
|
||||
"projects.emptyTitle": "Noch keine Projekte",
|
||||
|
||||
@@ -429,6 +429,10 @@
|
||||
"extras.subtitle.project": "Other project folders you want in sync besides skills: rules, commands, prompts. Each one has its own source and targets.",
|
||||
"extras.forceSync": "Force sync",
|
||||
"extras.sync": "Sync",
|
||||
"extras.status.synced": "In sync",
|
||||
"extras.status.drift": "Drift",
|
||||
"extras.status.notSynced": "Not synced",
|
||||
"extras.status.sourceMissing": "Source missing",
|
||||
"extras.title": "Extras",
|
||||
"extras.toast.created": "Extra \"{name}\" created",
|
||||
"extras.toast.modeChanged": "Mode changed to \"{mode}\"",
|
||||
@@ -807,6 +811,9 @@
|
||||
"resources.search.agents": "Search agents",
|
||||
"resources.toolbar.source": "Source",
|
||||
"resources.toolbar.status": "Status",
|
||||
"resources.status.all": "All",
|
||||
"resources.status.enabled": "Enabled",
|
||||
"resources.status.disabled": "Disabled",
|
||||
"resources.toolbar.target": "Target",
|
||||
"resources.toolbar.group": "Group",
|
||||
"resources.toolbar.sort": "Sort",
|
||||
@@ -1641,6 +1648,7 @@
|
||||
"mcp.projects.writesSwitch": "{target} gets {field}",
|
||||
"mcp.projects.noSwitch": "None of its Agents has a per-project switch.",
|
||||
"mcp.projects.overridden": "This project defines its own server with this name.",
|
||||
"mcp.kilocodeProjectEnv": "Kilo Code MCP {name}: Kilo does not allow environment references in project config and ignores the whole file when it finds one; remove fromEnv here or define this server in global mode",
|
||||
"projects.title": "Projects",
|
||||
"projects.subtitle": "Project folders synced from the global config.yaml. The folders need no .skillshare/, and one Sync writes them all.",
|
||||
"projects.emptyTitle": "No projects yet",
|
||||
|
||||
@@ -351,6 +351,10 @@
|
||||
"extras.subtitle.global": "Otras carpetas que quieres sincronizar además de los skills: rules, commands, prompts. Cada una tiene su propio source y targets.",
|
||||
"extras.subtitle.project": "Otras carpetas del proyecto que quieres sincronizar además de los skills: rules, commands, prompts. Cada una tiene su propio source y targets.",
|
||||
"extras.sync": "Sincronizar",
|
||||
"extras.status.synced": "Sincronizado",
|
||||
"extras.status.drift": "Con diferencias",
|
||||
"extras.status.notSynced": "No sincronizado",
|
||||
"extras.status.sourceMissing": "Falta la fuente",
|
||||
"extras.title": "Extras",
|
||||
"extras.toast.nErrors": "{errors} error(es)",
|
||||
"extras.toast.nMoreErrors": "+{errors} más",
|
||||
@@ -807,6 +811,9 @@
|
||||
"resources.search.agents": "Buscar agentes",
|
||||
"resources.toolbar.source": "Origen",
|
||||
"resources.toolbar.status": "Estado",
|
||||
"resources.status.all": "Todos",
|
||||
"resources.status.enabled": "Habilitado",
|
||||
"resources.status.disabled": "Deshabilitado",
|
||||
"resources.toolbar.target": "Destino",
|
||||
"resources.toolbar.group": "Agrupar",
|
||||
"resources.toolbar.sort": "Orden",
|
||||
@@ -1641,6 +1648,7 @@
|
||||
"mcp.projects.writesSwitch": "{target} recibe {field}",
|
||||
"mcp.projects.noSwitch": "Ninguno de sus Agents tiene un interruptor por proyecto.",
|
||||
"mcp.projects.overridden": "Este proyecto define su propio servidor con este nombre.",
|
||||
"mcp.kilocodeProjectEnv": "Kilo Code MCP {name}: Kilo no permite referencias a variables de entorno en la configuración del proyecto e ignora todo el archivo cuando encuentra una; elimina fromEnv aquí o define este servidor en modo global.",
|
||||
"projects.title": "Proyectos",
|
||||
"projects.subtitle": "Carpetas de proyecto sincronizadas desde el config.yaml global. Las carpetas no necesitan .skillshare/, y un solo Sync las escribe todas.",
|
||||
"projects.emptyTitle": "Aún no hay proyectos",
|
||||
|
||||
@@ -351,6 +351,10 @@
|
||||
"extras.subtitle.global": "پوشههای دیگری که علاوه بر skillها میخواهید همگام بمانند: rules، commands، prompts. هر کدام source و targets خودش را دارد.",
|
||||
"extras.subtitle.project": "پوشههای دیگر پروژه که علاوه بر skillها میخواهید همگام بمانند: rules، commands، prompts. هر کدام source و targets خودش را دارد.",
|
||||
"extras.sync": "همگامسازی",
|
||||
"extras.status.synced": "همگام است",
|
||||
"extras.status.drift": "دارای تفاوت",
|
||||
"extras.status.notSynced": "همگام نشده",
|
||||
"extras.status.sourceMissing": "منبع موجود نیست",
|
||||
"extras.title": "موارد اضافی",
|
||||
"extras.toast.created": "مورد اضافی \"{name}\" ایجاد شد",
|
||||
"extras.toast.extensionChanged": "افزونه روی «{extension}» تنظیم شد (حالت copy)",
|
||||
@@ -807,6 +811,9 @@
|
||||
"resources.search.agents": "جستجوی عاملها",
|
||||
"resources.toolbar.source": "منبع",
|
||||
"resources.toolbar.status": "وضعیت",
|
||||
"resources.status.all": "همه",
|
||||
"resources.status.enabled": "فعال",
|
||||
"resources.status.disabled": "غیرفعال",
|
||||
"resources.toolbar.target": "هدف",
|
||||
"resources.toolbar.group": "گروه",
|
||||
"resources.toolbar.sort": "مرتبسازی",
|
||||
@@ -1641,6 +1648,7 @@
|
||||
"mcp.projects.writesSwitch": "{target} مقدار {field} را میگیرد",
|
||||
"mcp.projects.noSwitch": "هیچکدام از Agentهایش کلید جداگانه برای هر پروژه ندارد.",
|
||||
"mcp.projects.overridden": "این پروژه سرور خودش را با همین نام تعریف کرده است.",
|
||||
"mcp.kilocodeProjectEnv": "Kilo Code MCP {name}: کیلو ارجاع به متغیر محیطی را در پیکربندی پروژه مجاز نمیداند و با یافتن آن، کل فایل را نادیده میگیرد؛ fromEnv را از اینجا حذف کنید یا این سرور را در حالت سراسری تعریف کنید.",
|
||||
"projects.title": "پروژهها",
|
||||
"projects.subtitle": "پوشههای پروژه که از config.yaml سراسری همگام میشوند. این پوشهها به .skillshare/ نیاز ندارند و یک همگامسازی همه را مینویسد.",
|
||||
"projects.emptyTitle": "هنوز پروژهای نیست",
|
||||
|
||||
@@ -351,6 +351,10 @@
|
||||
"extras.subtitle.global": "D’autres dossiers à synchroniser en plus des skills : rules, commands, prompts. Chacun a sa propre source et ses targets.",
|
||||
"extras.subtitle.project": "D’autres dossiers du projet à synchroniser en plus des skills : rules, commands, prompts. Chacun a sa propre source et ses targets.",
|
||||
"extras.sync": "Synchroniser",
|
||||
"extras.status.synced": "Synchronisé",
|
||||
"extras.status.drift": "Différences détectées",
|
||||
"extras.status.notSynced": "Non synchronisé",
|
||||
"extras.status.sourceMissing": "Source manquante",
|
||||
"extras.title": "Extras",
|
||||
"extras.toast.created": "Extra « {name} » créé",
|
||||
"extras.toast.nErrors": "{errors} erreur(s)",
|
||||
@@ -807,6 +811,9 @@
|
||||
"resources.search.agents": "Rechercher des agents",
|
||||
"resources.toolbar.source": "Source",
|
||||
"resources.toolbar.status": "Statut",
|
||||
"resources.status.all": "Tous",
|
||||
"resources.status.enabled": "Activé",
|
||||
"resources.status.disabled": "Désactivé",
|
||||
"resources.toolbar.target": "Cible",
|
||||
"resources.toolbar.group": "Grouper",
|
||||
"resources.toolbar.sort": "Tri",
|
||||
@@ -1641,6 +1648,7 @@
|
||||
"mcp.projects.writesSwitch": "{target} reçoit {field}",
|
||||
"mcp.projects.noSwitch": "Aucun de ses Agents n'a d'interrupteur par projet.",
|
||||
"mcp.projects.overridden": "Ce projet définit son propre serveur avec ce nom.",
|
||||
"mcp.kilocodeProjectEnv": "Kilo Code MCP {name} : Kilo n’autorise pas les références aux variables d’environnement dans la configuration du projet et ignore tout le fichier lorsqu’il en trouve une ; supprimez fromEnv ici ou définissez ce serveur en mode global.",
|
||||
"projects.title": "Projets",
|
||||
"projects.subtitle": "Dossiers de projet synchronisés depuis le config.yaml global. Ces dossiers n'ont pas besoin de .skillshare/, et un seul Sync les écrit tous.",
|
||||
"projects.emptyTitle": "Aucun projet pour l'instant",
|
||||
|
||||
@@ -351,6 +351,10 @@
|
||||
"extras.subtitle.global": "Folder lain yang ingin disinkronkan selain skills: rules, commands, prompts. Masing-masing punya source dan targets sendiri.",
|
||||
"extras.subtitle.project": "Folder proyek lain yang ingin disinkronkan selain skills: rules, commands, prompts. Masing-masing punya source dan targets sendiri.",
|
||||
"extras.sync": "Sinkronkan",
|
||||
"extras.status.synced": "Tersinkron",
|
||||
"extras.status.drift": "Ada perbedaan",
|
||||
"extras.status.notSynced": "Belum tersinkron",
|
||||
"extras.status.sourceMissing": "Sumber tidak ada",
|
||||
"extras.title": "Extras",
|
||||
"extras.toast.nErrors": "{errors} kesalahan",
|
||||
"extras.toast.nMoreErrors": "+{errors} lagi",
|
||||
@@ -807,6 +811,9 @@
|
||||
"resources.search.agents": "Cari agen",
|
||||
"resources.toolbar.source": "Sumber",
|
||||
"resources.toolbar.status": "Status",
|
||||
"resources.status.all": "Semua",
|
||||
"resources.status.enabled": "Aktif",
|
||||
"resources.status.disabled": "Nonaktif",
|
||||
"resources.toolbar.target": "Target",
|
||||
"resources.toolbar.group": "Grup",
|
||||
"resources.toolbar.sort": "Urutkan",
|
||||
@@ -1641,6 +1648,7 @@
|
||||
"mcp.projects.writesSwitch": "{target} mendapat {field}",
|
||||
"mcp.projects.noSwitch": "Tidak ada Agent-nya yang punya sakelar per proyek.",
|
||||
"mcp.projects.overridden": "Proyek ini mendefinisikan server sendiri dengan nama ini.",
|
||||
"mcp.kilocodeProjectEnv": "Kilo Code MCP {name}: Kilo tidak mengizinkan referensi variabel lingkungan dalam konfigurasi proyek dan akan mengabaikan seluruh file saat menemukannya; hapus fromEnv di sini atau definisikan server ini dalam mode global.",
|
||||
"projects.title": "Proyek",
|
||||
"projects.subtitle": "Folder proyek yang disinkronkan dari config.yaml global. Folder ini tidak perlu .skillshare/, dan satu kali Sync menulis semuanya.",
|
||||
"projects.emptyTitle": "Belum ada proyek",
|
||||
|
||||
@@ -351,6 +351,10 @@
|
||||
"extras.subtitle.global": "skills 以外に同期したいフォルダー(rules、commands、prompts など)。それぞれに source と targets があります。",
|
||||
"extras.subtitle.project": "プロジェクト内で skills 以外に同期したいフォルダー(rules、commands、prompts など)。それぞれに source と targets があります。",
|
||||
"extras.sync": "同期",
|
||||
"extras.status.synced": "同期済み",
|
||||
"extras.status.drift": "差分あり",
|
||||
"extras.status.notSynced": "未同期",
|
||||
"extras.status.sourceMissing": "ソースがありません",
|
||||
"extras.title": "Extras",
|
||||
"extras.toast.created": "Extra「{name}」を作成しました",
|
||||
"extras.toast.nErrors": "{errors} 件のエラー",
|
||||
@@ -807,6 +811,9 @@
|
||||
"resources.search.agents": "エージェントを検索",
|
||||
"resources.toolbar.source": "ソース",
|
||||
"resources.toolbar.status": "状態",
|
||||
"resources.status.all": "すべて",
|
||||
"resources.status.enabled": "有効",
|
||||
"resources.status.disabled": "無効",
|
||||
"resources.toolbar.target": "ターゲット",
|
||||
"resources.toolbar.group": "グループ",
|
||||
"resources.toolbar.sort": "並び順",
|
||||
@@ -1641,6 +1648,7 @@
|
||||
"mcp.projects.writesSwitch": "{target} に {field} を書き込み",
|
||||
"mcp.projects.noSwitch": "どの Agent にもプロジェクト単位のスイッチがありません。",
|
||||
"mcp.projects.overridden": "このプロジェクトは同じ名前のサーバーを独自に定義しています。",
|
||||
"mcp.kilocodeProjectEnv": "Kilo Code MCP {name}: Kilo はプロジェクト設定で環境変数参照を許可しておらず、検出するとファイル全体を無視します。ここで fromEnv を削除するか、このサーバーをグローバルモードで定義してください。",
|
||||
"projects.title": "プロジェクト",
|
||||
"projects.subtitle": "グローバルの config.yaml から同期するプロジェクトフォルダーです。フォルダーに .skillshare/ は不要で、1 回の同期ですべて書き込まれます。",
|
||||
"projects.emptyTitle": "プロジェクトがまだありません",
|
||||
|
||||
@@ -351,6 +351,10 @@
|
||||
"extras.subtitle.global": "skills 외에 동기화할 폴더(rules, commands, prompts 등). 각각 자체 source와 targets가 있습니다.",
|
||||
"extras.subtitle.project": "프로젝트에서 skills 외에 동기화할 폴더(rules, commands, prompts 등). 각각 자체 source와 targets가 있습니다.",
|
||||
"extras.sync": "동기화",
|
||||
"extras.status.synced": "동기화됨",
|
||||
"extras.status.drift": "차이 있음",
|
||||
"extras.status.notSynced": "동기화되지 않음",
|
||||
"extras.status.sourceMissing": "소스 없음",
|
||||
"extras.title": "Extras",
|
||||
"extras.toast.created": "\"{name}\" extra가 생성되었습니다",
|
||||
"extras.toast.extensionChanged": "extension을 \"{extension}\"(으)로 설정했습니다 (copy 모드)",
|
||||
@@ -807,6 +811,9 @@
|
||||
"resources.search.agents": "에이전트 검색",
|
||||
"resources.toolbar.source": "소스",
|
||||
"resources.toolbar.status": "상태",
|
||||
"resources.status.all": "전체",
|
||||
"resources.status.enabled": "활성화됨",
|
||||
"resources.status.disabled": "비활성화됨",
|
||||
"resources.toolbar.target": "대상",
|
||||
"resources.toolbar.group": "그룹",
|
||||
"resources.toolbar.sort": "정렬",
|
||||
@@ -1641,6 +1648,7 @@
|
||||
"mcp.projects.writesSwitch": "{target}에 {field} 기록",
|
||||
"mcp.projects.noSwitch": "이 서버의 Agent 중 프로젝트별 스위치가 있는 것이 없습니다.",
|
||||
"mcp.projects.overridden": "이 프로젝트에 같은 이름의 자체 서버가 정의되어 있습니다.",
|
||||
"mcp.kilocodeProjectEnv": "Kilo Code MCP {name}: Kilo는 프로젝트 설정에서 환경 변수 참조를 허용하지 않으며, 이를 발견하면 파일 전체를 무시합니다. 여기서 fromEnv를 제거하거나 이 서버를 전역 모드로 정의하세요.",
|
||||
"projects.title": "프로젝트",
|
||||
"projects.subtitle": "전역 config.yaml에서 동기화되는 프로젝트 폴더입니다. 폴더에는 .skillshare/가 필요 없으며, 동기화 한 번으로 전부 기록됩니다.",
|
||||
"projects.emptyTitle": "아직 프로젝트가 없습니다",
|
||||
|
||||
@@ -351,6 +351,10 @@
|
||||
"extras.subtitle.global": "Outras pastas que você quer sincronizar além dos skills: rules, commands, prompts. Cada uma tem sua própria source e targets.",
|
||||
"extras.subtitle.project": "Outras pastas do projeto que você quer sincronizar além dos skills: rules, commands, prompts. Cada uma tem sua própria source e targets.",
|
||||
"extras.sync": "Sincronizar",
|
||||
"extras.status.synced": "Sincronizado",
|
||||
"extras.status.drift": "Com diferenças",
|
||||
"extras.status.notSynced": "Não sincronizado",
|
||||
"extras.status.sourceMissing": "Origem ausente",
|
||||
"extras.title": "Extras",
|
||||
"extras.toast.created": "Extra \"{name}\" criado",
|
||||
"extras.toast.nErrors": "{errors} erro(s)",
|
||||
@@ -807,6 +811,9 @@
|
||||
"resources.search.agents": "Buscar agentes",
|
||||
"resources.toolbar.source": "Origem",
|
||||
"resources.toolbar.status": "Status",
|
||||
"resources.status.all": "Todos",
|
||||
"resources.status.enabled": "Ativado",
|
||||
"resources.status.disabled": "Desativado",
|
||||
"resources.toolbar.target": "Destino",
|
||||
"resources.toolbar.group": "Agrupar",
|
||||
"resources.toolbar.sort": "Ordem",
|
||||
@@ -1641,6 +1648,7 @@
|
||||
"mcp.projects.writesSwitch": "{target} recebe {field}",
|
||||
"mcp.projects.noSwitch": "Nenhum dos Agents dele tem um interruptor por projeto.",
|
||||
"mcp.projects.overridden": "Este projeto define seu próprio servidor com este nome.",
|
||||
"mcp.kilocodeProjectEnv": "Kilo Code MCP {name}: o Kilo não permite referências a variáveis de ambiente na configuração do projeto e ignora o arquivo inteiro quando encontra uma; remova fromEnv daqui ou defina este servidor no modo global.",
|
||||
"projects.title": "Projetos",
|
||||
"projects.subtitle": "Pastas de projeto sincronizadas a partir do config.yaml global. As pastas não precisam de .skillshare/, e um Sync grava todas elas.",
|
||||
"projects.emptyTitle": "Ainda não há projetos",
|
||||
|
||||
@@ -351,6 +351,10 @@
|
||||
"extras.subtitle.global": "skills 以外也想同步的文件夹,例如 rules、commands、prompts。每个都有自己的 source 和 targets。",
|
||||
"extras.subtitle.project": "项目里 skills 以外也想同步的文件夹,例如 rules、commands、prompts。每个都有自己的 source 和 targets。",
|
||||
"extras.sync": "同步",
|
||||
"extras.status.synced": "已同步",
|
||||
"extras.status.drift": "存在差异",
|
||||
"extras.status.notSynced": "尚未同步",
|
||||
"extras.status.sourceMissing": "来源不存在",
|
||||
"extras.title": "Extras",
|
||||
"extras.toast.created": "Extra \"{name}\" 已创建",
|
||||
"extras.toast.nErrors": "{errors} 个错误",
|
||||
@@ -807,6 +811,9 @@
|
||||
"resources.search.agents": "搜索 agent",
|
||||
"resources.toolbar.source": "来源",
|
||||
"resources.toolbar.status": "状态",
|
||||
"resources.status.all": "全部",
|
||||
"resources.status.enabled": "已启用",
|
||||
"resources.status.disabled": "已禁用",
|
||||
"resources.toolbar.target": "目标",
|
||||
"resources.toolbar.group": "分组",
|
||||
"resources.toolbar.sort": "排序",
|
||||
@@ -1641,6 +1648,7 @@
|
||||
"mcp.projects.writesSwitch": "{target} 写入 {field}",
|
||||
"mcp.projects.noSwitch": "它的 Agent 都没有项目级的开关。",
|
||||
"mcp.projects.overridden": "这个项目有自己的同名服务器。",
|
||||
"mcp.kilocodeProjectEnv": "Kilo Code MCP {name}:Kilo 不允许在项目配置中使用环境变量引用;一旦发现就会忽略整个文件。请在此移除 fromEnv,或改用全局模式定义此服务器。",
|
||||
"projects.title": "项目",
|
||||
"projects.subtitle": "从全局 config.yaml 同步的项目文件夹。文件夹不需要 .skillshare/,一次 Sync 就会全部写入。",
|
||||
"projects.emptyTitle": "还没有项目",
|
||||
|
||||
@@ -351,6 +351,10 @@
|
||||
"extras.subtitle.global": "skills 以外也想同步的資料夾,例如 rules、commands、prompts。每個都有自己的 source 和 targets。",
|
||||
"extras.subtitle.project": "專案裡 skills 以外也想同步的資料夾,例如 rules、commands、prompts。每個都有自己的 source 和 targets。",
|
||||
"extras.sync": "同步",
|
||||
"extras.status.synced": "已同步",
|
||||
"extras.status.drift": "有差異",
|
||||
"extras.status.notSynced": "尚未同步",
|
||||
"extras.status.sourceMissing": "來源不存在",
|
||||
"extras.title": "附加目錄",
|
||||
"extras.toast.created": "Extra「{name}」已建立",
|
||||
"extras.toast.extensionChanged": "擴充功能已設為「{extension}」(複製模式)",
|
||||
@@ -807,6 +811,9 @@
|
||||
"resources.search.agents": "搜尋 agents",
|
||||
"resources.toolbar.source": "來源",
|
||||
"resources.toolbar.status": "狀態",
|
||||
"resources.status.all": "全部",
|
||||
"resources.status.enabled": "已啟用",
|
||||
"resources.status.disabled": "已停用",
|
||||
"resources.toolbar.target": "目標",
|
||||
"resources.toolbar.group": "分組",
|
||||
"resources.toolbar.sort": "排序",
|
||||
@@ -1641,6 +1648,7 @@
|
||||
"mcp.projects.writesSwitch": "{target} 寫入 {field}",
|
||||
"mcp.projects.noSwitch": "它的 Agent 都沒有專案層級的開關。",
|
||||
"mcp.projects.overridden": "這個專案有自己的同名伺服器。",
|
||||
"mcp.kilocodeProjectEnv": "Kilo Code MCP {name}:Kilo 不允許在專案設定中使用環境變數參照;一旦找到就會忽略整份檔案。請在此移除 fromEnv,或改用全域模式定義這個伺服器。",
|
||||
"projects.title": "專案",
|
||||
"projects.subtitle": "由全域 config.yaml 同步的專案資料夾。資料夾裡不需要 .skillshare/,一次 Sync 就會全部寫入。",
|
||||
"projects.emptyTitle": "還沒有專案",
|
||||
|
||||
@@ -22,12 +22,11 @@ import { shortenHome } from '../lib/paths';
|
||||
|
||||
const MODES = ['merge', 'copy', 'symlink'] as const;
|
||||
|
||||
// Status and mode labels stay in English, like the CLI
|
||||
const STATUS: Record<string, { tone: string; label: string }> = {
|
||||
synced: { tone: 'ok', label: 'In sync' },
|
||||
drift: { tone: 'warn', label: 'Drift' },
|
||||
'not synced': { tone: 'warn', label: 'Not synced' },
|
||||
'no source': { tone: 'bad', label: 'Source missing' },
|
||||
const STATUS: Record<string, { tone: string; labelKey: string }> = {
|
||||
synced: { tone: 'ok', labelKey: 'extras.status.synced' },
|
||||
drift: { tone: 'warn', labelKey: 'extras.status.drift' },
|
||||
'not synced': { tone: 'warn', labelKey: 'extras.status.notSynced' },
|
||||
'no source': { tone: 'bad', labelKey: 'extras.status.sourceMissing' },
|
||||
};
|
||||
|
||||
/** The tool a target folder belongs to: the known target whose home folder (e.g. ~/.claude) holds the path. */
|
||||
@@ -451,7 +450,7 @@ export default function ExtrasPage() {
|
||||
<span className="min-w-0 flex-1 truncate font-mono text-[13px]" title={tg.path}>{shortenHome(tg.path)}</span>
|
||||
<TargetTags target={tg} />
|
||||
<span className="w-[120px] shrink-0">
|
||||
<span className={`ss-st ${status?.tone ?? ''}`}>{status?.label ?? tg.status}</span>
|
||||
<span className={`ss-st ${status?.tone ?? ''}`}>{status ? t(status.labelKey) : tg.status}</span>
|
||||
</span>
|
||||
<button type="button" className="ss-ib" aria-label={t('extras.targetActions', { path: tg.path })} onClick={(e) => openMenu(e, targetMenu(extra, tg))}>
|
||||
<Ellipsis size={16} />
|
||||
|
||||
@@ -22,7 +22,7 @@ import { MCPConfigDialog } from '../components/mcp/MCPConfigView';
|
||||
import MCPRemoveDialog from '../components/mcp/MCPRemoveDialog';
|
||||
import MCPRestoreDialog from '../components/mcp/MCPRestoreDialog';
|
||||
import MCPServerDialog from '../components/mcp/MCPServerDialog';
|
||||
import { buildMatrix, describeMessage, isShadowed, isResolvable, targetLabel, type MCPChange } from '../components/mcp/mcpView';
|
||||
import { buildMatrix, describeError, describeMessage, isShadowed, isResolvable, targetLabel, type MCPChange } from '../components/mcp/mcpView';
|
||||
import { useT } from '../i18n';
|
||||
import { shortenHome } from '../lib/paths';
|
||||
import { queryKeys } from '../lib/queryKeys';
|
||||
@@ -97,7 +97,7 @@ export default function MCPPage() {
|
||||
await mcpApi.save({ name, server, replace: true });
|
||||
} catch (e) {
|
||||
if (prev) cache.setQueryData(queryKeys.mcp, prev);
|
||||
toast((e as Error).message, 'error');
|
||||
toast(describeError(t, (e as Error).message), 'error');
|
||||
}
|
||||
refresh();
|
||||
};
|
||||
@@ -106,7 +106,7 @@ export default function MCPPage() {
|
||||
try {
|
||||
await mcpApi.save({ settings, replace: true });
|
||||
} catch (e) {
|
||||
toast((e as Error).message, 'error');
|
||||
toast(describeError(t, (e as Error).message), 'error');
|
||||
}
|
||||
refresh();
|
||||
};
|
||||
@@ -121,7 +121,7 @@ export default function MCPPage() {
|
||||
try {
|
||||
setReplace({ plan: await mcpApi.preview(mutation), mutation });
|
||||
} catch (e) {
|
||||
toast((e as Error).message, 'error');
|
||||
toast(describeError(t, (e as Error).message), 'error');
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
@@ -134,7 +134,7 @@ export default function MCPPage() {
|
||||
await mcpApi.configure(replace.mutation, replace.plan.revision, true);
|
||||
done(t('mcp.toast.replaced'));
|
||||
} catch (e) {
|
||||
toast((e as Error).message, 'error');
|
||||
toast(describeError(t, (e as Error).message), 'error');
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
@@ -180,7 +180,7 @@ export default function MCPPage() {
|
||||
/>
|
||||
|
||||
{error && <div className="ss-note bad mb-4"><span className="flex-1">{error.message}</span></div>}
|
||||
{data?.previewError && <div className="ss-note bad mb-4"><AlertCircle size={16} /><span className="flex-1">{data.previewError}</span></div>}
|
||||
{data?.previewError && <div className="ss-note bad mb-4"><AlertCircle size={16} /><span className="flex-1">{describeError(t, data.previewError)}</span></div>}
|
||||
|
||||
{data && (
|
||||
<RailLayout rail={<>
|
||||
|
||||
@@ -81,8 +81,6 @@ const SOURCE_ORDER: SourceType[] = ['tracked', 'github', 'remote', 'local'];
|
||||
// Source names stay in English, like the CLI.
|
||||
const SOURCE_LABEL: Record<SourceFilter, string> = { all: 'All', tracked: 'Tracked', github: 'GitHub', remote: 'Remote', local: 'Local' };
|
||||
const SOURCE_ICON = { tracked: GitBranch, github: Github, remote: Globe, local: Folder };
|
||||
// Status labels stay in English too.
|
||||
const STATUS_LABEL: Record<StatusFilter, string> = { all: 'All', enabled: 'Enabled', disabled: 'Disabled' };
|
||||
const VIEW_KEY = 'skillshare:skills-view';
|
||||
const COLLAPSED_KEY = 'skillshare:folder-collapsed';
|
||||
|
||||
@@ -406,10 +404,10 @@ export default function ResourcesPage({ kind }: { kind: Kind }) {
|
||||
const entries = getSkillTargets(s.flatName);
|
||||
const synced = entries.filter((e) => e.status === 'synced').map((e) => e.target).sort();
|
||||
const applicable = entries.some((e) => e.status !== 'na');
|
||||
if (s.disabled) return { synced, tone: 'off', label: STATUS_LABEL.disabled };
|
||||
if (s.disabled) return { synced, tone: 'off', label: t('resources.status.disabled') };
|
||||
if (entries.length > 0 && !applicable) return { synced, tone: 'off', label: t('resources.tree.noAgentTargets.label') };
|
||||
if (applicable && synced.length === 0) return { synced, tone: 'off', label: t('resources.tree.filteredOut.label') };
|
||||
return { synced, tone: 'ok', label: STATUS_LABEL.enabled };
|
||||
return { synced, tone: 'ok', label: t('resources.status.enabled') };
|
||||
};
|
||||
|
||||
/* -- Mutations -- */
|
||||
@@ -819,7 +817,7 @@ export default function ResourcesPage({ kind }: { kind: Kind }) {
|
||||
prefix={t('resources.toolbar.status')}
|
||||
value={status}
|
||||
onChange={(v) => resetting(setStatus)(v as StatusFilter)}
|
||||
options={(['all', 'enabled', 'disabled'] as StatusFilter[]).map((v) => ({ value: v, label: STATUS_LABEL[v] }))}
|
||||
options={(['all', 'enabled', 'disabled'] as StatusFilter[]).map((v) => ({ value: v, label: t(`resources.status.${v}`) }))}
|
||||
/>
|
||||
{targetIndex.size > 1 && (
|
||||
<Select
|
||||
|
||||
Reference in New Issue
Block a user