Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

feat(i18n): migrate Settings batch 3 — Session, IP, Compliance, Fallback (36+ strings)

diegosouzapw8592d02951a1
diff --git a/src/app/(dashboard)/dashboard/settings/components/ComplianceTab.tsx b/src/app/(dashboard)/dashboard/settings/components/ComplianceTab.tsx
index 1c16d43eee..084cb07fac 100644
--- a/src/app/(dashboard)/dashboard/settings/components/ComplianceTab.tsx
+++ b/src/app/(dashboard)/dashboard/settings/components/ComplianceTab.tsx
@@ -3,6 +3,7 @@
import { useState, useEffect, useCallback } from "react";
import { Card, DataTable, FilterBar, ColumnToggle } from "@/shared/components";
import { useNotificationStore } from "@/store/notificationStore";
+import { useTranslations } from "next-intl";
const ALL_COLUMNS = [
{ key: "timestamp", label: "Time" },
@@ -23,6 +24,7 @@ export default function ComplianceTab() {
details: true,
});
const notify = useNotificationStore();
+ const t = useTranslations("settings");
useEffect(() => {
fetch("/api/compliance/audit-log?limit=100")
@@ -33,7 +35,7 @@ export default function ComplianceTab() {
})
.catch(() => {
setLoading(false);
- notify.error("Failed to load audit log");
+ notify.error(t("failedLoadAuditLog"));
});
}, []); // eslint-disable-line react-hooks/exhaustive-deps
@@ -92,7 +94,7 @@ export default function ComplianceTab() {
<div className="flex items-center justify-between mb-4">
<h3 className="text-lg font-semibold text-text-main flex items-center gap-2">
<span className="material-symbols-outlined text-[20px]">policy</span>
- Audit Log
+ {t("auditLog")}
</h3>
<ColumnToggle columns={ALL_COLUMNS} visible={visibleCols} onToggle={handleToggleCol} />
</div>
@@ -100,7 +102,7 @@ export default function ComplianceTab() {
<FilterBar
searchValue={search}
onSearchChange={setSearch}
- placeholder="Search audit logs..."
+ placeholder={t("searchAuditLogs")}
filters={[
{ key: "action", label: "Action", options: actionOptions },
{ key: "actor", label: "Actor", options: actorOptions },
@@ -118,7 +120,7 @@ export default function ComplianceTab() {
loading={loading}
maxHeight="400px"
emptyIcon="📋"
- emptyMessage="No audit events found"
+ emptyMessage={t("noAuditEvents")}
/>
</Card>
);
diff --git a/src/app/(dashboard)/dashboard/settings/components/FallbackChainsEditor.tsx b/src/app/(dashboard)/dashboard/settings/components/FallbackChainsEditor.tsx
index b44ffb3612..fd6947a889 100644
--- a/src/app/(dashboard)/dashboard/settings/components/FallbackChainsEditor.tsx
+++ b/src/app/(dashboard)/dashboard/settings/components/FallbackChainsEditor.tsx
@@ -11,6 +11,7 @@
import { useState, useEffect, useCallback } from "react";
import { Card, Button, Input, EmptyState } from "@/shared/components";
import { useNotificationStore } from "@/store/notificationStore";
+import { useTranslations } from "next-intl";
const CHAIN_COLORS = [
"#6366f1",
@@ -31,6 +32,8 @@ export default function FallbackChainsEditor() {
const [newProviders, setNewProviders] = useState("");
const [saving, setSaving] = useState(false);
const notify = useNotificationStore();
+ const t = useTranslations("settings");
+ const tc = useTranslations("common");
const fetchChains = useCallback(async () => {
try {
@@ -52,7 +55,7 @@ export default function FallbackChainsEditor() {
const handleCreate = async () => {
if (!newModel.trim() || !newProviders.trim()) {
- notify.warning("Please fill model name and providers");
+ notify.warning(t("fillModelAndProviders"));
return;
}
@@ -63,7 +66,7 @@ export default function FallbackChainsEditor() {
.map((provider, i) => ({ provider, priority: i + 1, enabled: true }));
if (providers.length === 0) {
- notify.warning("Add at least one provider");
+ notify.warning(t("addAtLeastOneProvider"));
return;
}
@@ -75,16 +78,16 @@ export default function FallbackChainsEditor() {
body: JSON.stringify({ model: newModel.trim(), chain: providers }),
});
if (res.ok) {
- notify.success(`Chain created for ${newModel.trim()}`);
+ notify.success(t("chainCreated", { model: newModel.trim() }));
setNewModel("");
setNewProviders("");
setShowCreate(false);
await fetchChains();
} else {
- notify.error("Failed to create chain");
+ notify.error(t("failedCreateChain"));
}
} catch {
- notify.error("Failed to create chain");
+ notify.error(t("failedCreateChain"));
} finally {
setSaving(false);
}
@@ -99,13 +102,13 @@ export default function FallbackChainsEditor() {
body: JSON.stringify({ model }),
});
if (res.ok) {
- notify.success(`Chain deleted for ${model}`);
+ notify.success(t("chainDeleted", { model }));
await fetchChains();
} else {
- notify.error("Failed to delete chain");
+ notify.error(t("failedDeleteChain"));
}
} catch {
- notify.error("Failed to delete chain");
+ notify.error(t("failedDeleteChain"));
}
};
@@ -114,7 +117,7 @@ export default function FallbackChainsEditor() {
<Card className="p-6 mt-6">
<div className="flex items-center gap-2 text-text-muted animate-pulse">
<span className="material-symbols-outlined text-[20px]">timeline</span>
- Loading fallback chains...
+ {t("loadingFallbackChains")}
</div>
</Card>
);
@@ -129,11 +132,11 @@ export default function FallbackChainsEditor() {
<span className="material-symbols-outlined text-[20px]">timeline</span>
</div>
<div className="flex-1">
- <h3 className="text-lg font-semibold">Fallback Chains</h3>
- <p className="text-sm text-text-muted">Define provider fallback order per model</p>
+ <h3 className="text-lg font-semibold">{t("fallbackChainsTitle")}</h3>
+ <p className="text-sm text-text-muted">{t("fallbackChainsDesc")}</p>
</div>
<Button size="sm" variant="primary" onClick={() => setShowCreate(!showCreate)}>
- {showCreate ? "Cancel" : "+ Add Chain"}
+ {showCreate ? tc("cancel") : t("addChain")}
</Button>
</div>
@@ -142,20 +145,20 @@ export default function FallbackChainsEditor() {
<div className="mx-6 p-4 rounded-lg border border-border/30 bg-surface/20 mb-4">
<div className="grid grid-cols-1 md:grid-cols-2 gap-3 mb-3">
<Input
- label="Model Name"
+ label={t("modelName")}
placeholder="claude-sonnet-4-20250514"
value={newModel}
onChange={(e) => setNewModel(e.target.value)}
/>
<Input
- label="Providers (comma-separated, in priority order)"
+ label={t("providersCommaSeparated")}
placeholder="anthropic, openai, gemini"
value={newProviders}
onChange={(e) => setNewProviders(e.target.value)}
/>
</div>
<Button variant="primary" size="sm" onClick={handleCreate} loading={saving}>
- Create Chain
+ {t("createChain")}
</Button>
</div>
)}
@@ -165,8 +168,8 @@ export default function FallbackChainsEditor() {
{chainEntries.length === 0 ? (
<EmptyState
icon="timeline"
- title="No Fallback Chains"
- description="Create a chain to define provider fallback order for a model."
+ title={t("noFallbackChains")}
+ description={t("noFallbackChainsDesc")}
/>
) : (
<div className="flex flex-col gap-2">
diff --git a/src/app/(dashboard)/dashboard/settings/components/IPFilterSection.tsx b/src/app/(dashboard)/dashboard/settings/components/IPFilterSection.tsx
index 245a833cfe..37f4267baa 100644
--- a/src/app/(dashboard)/dashboard/settings/components/IPFilterSection.tsx
+++ b/src/app/(dashboard)/dashboard/settings/components/IPFilterSection.tsx
@@ -2,6 +2,7 @@
import { useState, useEffect } from "react";
import { Card, Button, Input, Toggle } from "@/shared/components";
+import { useTranslations } from "next-intl";
const MODES = [
{ value: "disabled", label: "Disabled", icon: "block" },
@@ -11,10 +12,17 @@ const MODES = [
];
export default function IPFilterSection() {
- const [config, setConfig] = useState({ enabled: false, mode: "blacklist", blacklist: [], whitelist: [], tempBans: [] });
+ const [config, setConfig] = useState({
+ enabled: false,
+ mode: "blacklist",
+ blacklist: [],
+ whitelist: [],
+ tempBans: [],
+ });
const [loading, setLoading] = useState(true);
const [newIP, setNewIP] = useState("");
- const [listTarget, setListTarget] = useState("blacklist"); // "blacklist" | "whitelist"
+ const [listTarget, setListTarget] = useState("blacklist");
+ const t = useTranslations("settings");
useEffect(() => {
loadConfig();
@@ -24,7 +32,8 @@ export default function IPFilterSection() {
try {
const res = await fetch("/api/settings/ip-filter");
if (res.ok) setConfig(await res.json());
- } catch {} finally {
+ } catch {
+ } finally {
setLoading(false);
}
};
@@ -75,8 +84,8 @@ export default function IPFilterSection() {
</span>
</div>
<div className="flex-1">
- <h3 className="text-lg font-semibold">IP Access Control</h3>
- <p className="text-sm text-text-muted">Block or allow specific IP addresses</p>
+ <h3 className="text-lg font-semibold">{t("ipAccessControl")}</h3>
+ <p className="text-sm text-text-muted">{t("ipAccessControlDesc")}</p>
</div>
</div>
@@ -93,10 +102,16 @@ export default function IPFilterSection() {
: "border-border/50 hover:border-border hover:bg-surface/30"
}`}
>
- <span className={`material-symbols-outlined text-[20px] ${
- activeMode === m.value ? "text-red-400" : "text-text-muted"
- }`}>{m.icon}</span>
- <span className={`text-xs font-medium ${activeMode === m.value ? "text-red-400" : "text-text-muted"}`}>
+ <span
+ className={`material-symbols-outlined text-[20px] ${
+ activeMode === m.value ? "text-red-400" : "text-text-muted"
+ }`}
+ >
+ {m.icon}
+ </span>
+ <span
+ className={`text-xs font-medium ${activeMode === m.value ? "text-red-400" : "text-text-muted"}`}
+ >
{m.label}
</span>
</button>
@@ -109,7 +124,7 @@ export default function IPFilterSection() {
<div className="flex gap-2 items-end">
<div className="flex-1">
<Input
- label="Add IP Address"
+ label={t("addIpAddress")}
placeholder="192.168.1.0/24 or 10.0.*.*"
value={newIP}
onChange={(e) => setNewIP(e.target.value)}
@@ -120,16 +135,22 @@ export default function IPFilterSection() {
<Button
size="sm"
variant={listTarget === "blacklist" ? "danger" : "secondary"}
- onClick={() => { setListTarget("blacklist"); if (newIP.trim()) addIP(); }}
+ onClick={() => {
+ setListTarget("blacklist");
+ if (newIP.trim()) addIP();
+ }}
>
- + Block
+ {t("block")}
</Button>
<Button
size="sm"
variant={listTarget === "whitelist" ? "primary" : "secondary"}
- onClick={() => { setListTarget("whitelist"); if (newIP.trim()) addIP(); }}
+ onClick={() => {
+ setListTarget("whitelist");
+ if (newIP.trim()) addIP();
+ }}
>
- + Allow
+ {t("allow")}
</Button>
</div>
</div>
@@ -148,7 +169,10 @@ export default function IPFilterSection() {
bg-red-500/10 text-red-400 border border-red-500/20"
>
{ip}
- <button onClick={() => removeIP(ip, "blacklist")} className="hover:text-red-300">
+ <button
+ onClick={() => removeIP(ip, "blacklist")}
+ className="hover:text-red-300"
+ >
<span className="material-symbols-outlined text-[14px]">close</span>
</button>
</span>
@@ -171,7 +195,10 @@ export default function IPFilterSection() {
bg-emerald-500/10 text-emerald-400 border border-emerald-500/20"
>
{ip}
- <button onClick={() => removeIP(ip, "whitelist")} className="hover:text-emerald-300">
+ <button
+ onClick={() => removeIP(ip, "whitelist")}
+ className="hover:text-emerald-300"
+ >
<span className="material-symbols-outlined text-[14px]">close</span>
</button>
</span>
@@ -201,7 +228,10 @@ export default function IPFilterSection() {
<span className="text-xs text-text-muted tabular-nums">
{Math.ceil(ban.remainingMs / 60000)}m left
</span>
- <button onClick={() => removeBan(ban.ip)} className="text-text-muted hover:text-orange-400">
+ <button
+ onClick={() => removeBan(ban.ip)}
+ className="text-text-muted hover:text-orange-400"
+ >
<span className="material-symbols-outlined text-[16px]">delete</span>
</button>
</div>
diff --git a/src/app/(dashboard)/dashboard/settings/components/SessionInfoCard.tsx b/src/app/(dashboard)/dashboard/settings/components/SessionInfoCard.tsx
index 03674933ac..9a0dfa8e01 100644
--- a/src/app/(dashboard)/dashboard/settings/components/SessionInfoCard.tsx
+++ b/src/app/(dashboard)/dashboard/settings/components/SessionInfoCard.tsx
@@ -9,6 +9,7 @@
import { useState, useEffect } from "react";
import { Card, Button } from "@/shared/components";
+import { useTranslations } from "next-intl";
interface SessionInfo {
authenticated: boolean;
@@ -21,6 +22,7 @@ interface SessionInfo {
export default function SessionInfoCard() {
const [session, setSession] = useState<SessionInfo | null>(null);
const [loading, setLoading] = useState(true);
+ const t = useTranslations("settings");
useEffect(() => {
let cancelled = false;
@@ -81,7 +83,7 @@ export default function SessionInfoCard() {
};
const handleClearStorage = () => {
- if (confirm("Clear all local data? This will reset your preferences.")) {
+ if (confirm(t("clearLocalDataConfirm"))) {
localStorage.clear();
sessionStorage.clear();
window.location.reload();
@@ -104,46 +106,46 @@ export default function SessionInfoCard() {
person
</span>
</div>
- <h3 className="text-lg font-semibold">Session</h3>
+ <h3 className="text-lg font-semibold">{t("session")}</h3>
</div>
<div className="flex flex-col gap-3" role="list" aria-label="Session details">
<div className="flex justify-between items-center text-sm" role="listitem">
- <span className="text-text-muted">Status</span>
+ <span className="text-text-muted">{t("status")}</span>
<span className="flex items-center gap-1.5">
<span
className={`w-2 h-2 rounded-full ${session?.authenticated ? "bg-green-500" : "bg-yellow-500"}`}
aria-hidden="true"
/>
- {session?.authenticated ? "Authenticated" : "Guest"}
+ {session?.authenticated ? t("authenticated") : t("guest")}
</span>
</div>
{session?.loginTime && (
<div className="flex justify-between items-center text-sm" role="listitem">
- <span className="text-text-muted">Login Time</span>
+ <span className="text-text-muted">{t("loginTime")}</span>
<span className="font-mono text-xs">{session.loginTime}</span>
</div>
)}
<div className="flex justify-between items-center text-sm" role="listitem">
- <span className="text-text-muted">Session Age</span>
+ <span className="text-text-muted">{t("sessionAge")}</span>
<span className="font-mono text-xs">{session?.sessionAge}</span>
</div>
<div className="flex justify-between items-center text-sm" role="listitem">
- <span className="text-text-muted">Browser</span>
+ <span className="text-text-muted">{t("browser")}</span>
<span className="font-mono text-xs truncate max-w-[200px]">{session?.userAgent}</span>
</div>
</div>
<div className="flex gap-3 mt-4 pt-4 border-t border-border/50">
<Button variant="secondary" onClick={handleClearStorage}>
- Clear Local Data
+ {t("clearLocalData")}
</Button>
{session?.authenticated && (
<Button variant="danger" onClick={handleLogout}>
- Logout
+ {t("logout")}
</Button>
)}
</div>
diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json
index c09704a8e5..cb8c6d3b07 100644
--- a/src/i18n/messages/en.json
+++ b/src/i18n/messages/en.json
@@ -706,7 +706,50 @@
"modelAliasesDesc": "Wildcard patterns to remap model names • Use * and ?",
"pattern": "Pattern",
"targetModel": "Target Model",
- "add": "+ Add"
+ "add": "+ Add",
+ "session": "Session",
+ "status": "Status",
+ "authenticated": "Authenticated",
+ "guest": "Guest",
+ "loginTime": "Login Time",
+ "sessionAge": "Session Age",
+ "browser": "Browser",
+ "clearLocalData": "Clear Local Data",
+ "logout": "Logout",
+ "clearLocalDataConfirm": "Clear all local data? This will reset your preferences.",
+ "ipAccessControl": "IP Access Control",
+ "ipAccessControlDesc": "Block or allow specific IP addresses",
+ "addIpAddress": "Add IP Address",
+ "block": "+ Block",
+ "allow": "+ Allow",
+ "blocked": "Blocked ({count})",
+ "allowed": "Allowed ({count})",
+ "temporaryBans": "Temporary Bans ({count})",
+ "minLeft": "{min}m left",
+ "auditLog": "Audit Log",
+ "searchAuditLogs": "Search audit logs...",
+ "failedLoadAuditLog": "Failed to load audit log",
+ "noAuditEvents": "No audit events found",
+ "action": "Action",
+ "actor": "Actor",
+ "details": "Details",
+ "time": "Time",
+ "fallbackChainsTitle": "Fallback Chains",
+ "fallbackChainsDesc": "Define provider fallback order per model",
+ "addChain": "+ Add Chain",
+ "modelName": "Model Name",
+ "providersCommaSeparated": "Providers (comma-separated, in priority order)",
+ "createChain": "Create Chain",
+ "noFallbackChains": "No Fallback Chains",
+ "noFallbackChainsDesc": "Create a chain to define provider fallback order for a model.",
+ "loadingFallbackChains": "Loading fallback chains...",
+ "deleteChainConfirm": "Delete fallback chain for \"{model}\"?",
+ "chainCreated": "Chain created for {model}",
+ "chainDeleted": "Chain deleted for {model}",
+ "failedCreateChain": "Failed to create chain",
+ "failedDeleteChain": "Failed to delete chain",
+ "fillModelAndProviders": "Please fill model name and providers",
+ "addAtLeastOneProvider": "Add at least one provider"
},
"translator": {
"title": "Translator",
diff --git a/src/i18n/messages/pt-BR.json b/src/i18n/messages/pt-BR.json
index 3664c46f09..c8d7cc6838 100644
--- a/src/i18n/messages/pt-BR.json
+++ b/src/i18n/messages/pt-BR.json
@@ -706,7 +706,50 @@
"modelAliasesDesc": "Padrões coringa para remapear nomes de modelos • Use * e ?",
"pattern": "Padrão",
"targetModel": "Modelo Alvo",
- "add": "+ Adicionar"
+ "add": "+ Adicionar",
+ "session": "Sessão",
+ "status": "Status",
+ "authenticated": "Autenticado",
+ "guest": "Visitante",
+ "loginTime": "Hora do Login",
+ "sessionAge": "Duração da Sessão",
+ "browser": "Navegador",
+ "clearLocalData": "Limpar Dados Locais",
+ "logout": "Sair",
+ "clearLocalDataConfirm": "Limpar todos os dados locais? Isso redefinirá suas preferências.",
+ "ipAccessControl": "Controle de Acesso por IP",
+ "ipAccessControlDesc": "Bloquear ou permitir endereços IP específicos",
+ "addIpAddress": "Adicionar Endereço IP",
+ "block": "+ Bloquear",
+ "allow": "+ Permitir",
+ "blocked": "Bloqueados ({count})",
+ "allowed": "Permitidos ({count})",
+ "temporaryBans": "Banimentos Temporários ({count})",
+ "minLeft": "{min}m restantes",
+ "auditLog": "Log de Auditoria",
+ "searchAuditLogs": "Buscar logs de auditoria...",
+ "failedLoadAuditLog": "Falha ao carregar log de auditoria",
+ "noAuditEvents": "Nenhum evento de auditoria encontrado",
+ "action": "Ação",
+ "actor": "Ator",
+ "details": "Detalhes",
+ "time": "Hora",
+ "fallbackChainsTitle": "Cadeias de Fallback",
+ "fallbackChainsDesc": "Definir ordem de fallback de provedores por modelo",
+ "addChain": "+ Adicionar Cadeia",
+ "modelName": "Nome do Modelo",
+ "providersCommaSeparated": "Provedores (separados por vírgula, em ordem de prioridade)",
+ "createChain": "Criar Cadeia",
+ "noFallbackChains": "Sem Cadeias de Fallback",
+ "noFallbackChainsDesc": "Crie uma cadeia para definir a ordem de fallback de provedores para um modelo.",
+ "loadingFallbackChains": "Carregando cadeias de fallback...",
+ "deleteChainConfirm": "Excluir cadeia de fallback para \"{model}\"?",
+ "chainCreated": "Cadeia criada para {model}",
+ "chainDeleted": "Cadeia excluída para {model}",
+ "failedCreateChain": "Falha ao criar cadeia",
+ "failedDeleteChain": "Falha ao excluir cadeia",
+ "fillModelAndProviders": "Preencha o nome do modelo e os provedores",
+ "addAtLeastOneProvider": "Adicione pelo menos um provedor"
},
"translator": {
"title": "Tradutor",