diff --git a/src/app/(dashboard)/dashboard/HomePageClient.tsx b/src/app/(dashboard)/dashboard/HomePageClient.tsx index d9681c514d..5d439d2af8 100644 --- a/src/app/(dashboard)/dashboard/HomePageClient.tsx +++ b/src/app/(dashboard)/dashboard/HomePageClient.tsx @@ -14,6 +14,7 @@ import { useNotificationStore } from "@/store/notificationStore"; export default function HomePageClient({ machineId }) { const t = useTranslations("home"); const tc = useTranslations("common"); + const ts = useTranslations("sidebar"); const [providerConnections, setProviderConnections] = useState([]); const [models, setModels] = useState([]); const [loading, setLoading] = useState(true); @@ -108,11 +109,11 @@ export default function HomePageClient({ machineId }) { const quickStartLinks = [ { label: t("documentation"), href: "/docs", icon: "menu_book" }, - { label: tc("provider") + "s", href: "/dashboard/providers", icon: "dns" }, - { label: "Combos", href: "/dashboard/combos", icon: "layers" }, - { label: "Analytics", href: "/dashboard/analytics", icon: "analytics" }, + { label: ts("providers"), href: "/dashboard/providers", icon: "dns" }, + { label: ts("combos"), href: "/dashboard/combos", icon: "layers" }, + { label: ts("analytics"), href: "/dashboard/analytics", icon: "analytics" }, { label: t("healthMonitor"), href: "/dashboard/health", icon: "health_and_safety" }, - { label: "CLI Tools", href: "/dashboard/cli-tools", icon: "terminal" }, + { label: ts("cliTools"), href: "/dashboard/cli-tools", icon: "terminal" }, { label: t("reportIssue"), href: "https://github.com/diegosouzapw/OmniRoute/issues", @@ -159,11 +160,13 @@ export default function HomePageClient({ machineId }) {
{t("step1Title")}

- Go to{" "} - - Endpoint - {" "} - → Registered Keys. Generate one key per environment. + {t.rich("step1Desc", { + endpoint: (chunks) => ( + + {chunks} + + ), + })}

@@ -174,11 +177,13 @@ export default function HomePageClient({ machineId }) {
{t("step2Title")}

- Add accounts in{" "} - - Providers - - . Supports OAuth, API Key, and free tiers. + {t.rich("step2Desc", { + providers: (chunks) => ( + + {chunks} + + ), + })}

@@ -188,13 +193,7 @@ export default function HomePageClient({ machineId }) {
{t("step3Title")} -

- Set base URL to{" "} - - {currentEndpoint} - {" "} - in your IDE or API client. -

+

{t("step3Desc", { url: currentEndpoint })}

  • @@ -204,15 +203,18 @@ export default function HomePageClient({ machineId }) {
    {t("step4Title")}

    - Track tokens, cost and errors in{" "} - - Request Logs - {" "} - and{" "} - - Analytics - - . + {t.rich("step4Desc", { + logs: (chunks) => ( + + {chunks} + + ), + analytics: (chunks) => ( + + {chunks} + + ), + })}

  • @@ -243,20 +245,22 @@ export default function HomePageClient({ machineId }) {

    {t("providersOverview")}

    - {providerStats.filter((item) => item.total > 0).length} configured of{" "} - {providerStats.length} available providers + {t("configuredOf", { + configured: providerStats.filter((item) => item.total > 0).length, + total: providerStats.length, + })}

    - Free + {tc("free")} - OAuth + {t("oauthLabel")} - API Key + {t("apiKeyLabel")}
    settings - Manage + {tc("manage")}
    @@ -299,15 +303,16 @@ HomePageClient.propTypes = { function ProviderOverviewCard({ item, metrics, onClick }) { const [imgError, setImgError] = useState(false); + const t = useTranslations("home"); const tc = useTranslations("common"); const statusVariant = item.errors > 0 ? "text-red-500" : item.connected > 0 ? "text-green-500" : "text-text-muted"; const authTypeConfig = { - free: { color: "bg-green-500", label: "Free" }, - oauth: { color: "bg-blue-500", label: "OAuth" }, - apikey: { color: "bg-amber-500", label: "API Key" }, + free: { color: "bg-green-500", label: tc("free") }, + oauth: { color: "bg-blue-500", label: t("oauthLabel") }, + apikey: { color: "bg-amber-500", label: t("apiKeyLabel") }, }; const authInfo = authTypeConfig[item.authType] || authTypeConfig.apikey; @@ -352,13 +357,13 @@ function ProviderOverviewCard({ item, metrics, onClick }) {

    {item.total === 0 ? tc("notConfigured") - : `${item.connected} active · ${item.errors} error`} + : t("activeError", { active: item.connected, errors: item.errors })}

    {metrics && metrics.totalRequests > 0 && (
    {metrics.totalSuccesses}/ - {metrics.totalRequests} reqs + {t("requestsShort", { count: metrics.totalRequests })} {metrics.successRate}% ~{metrics.avgLatencyMs}ms @@ -368,7 +373,7 @@ function ProviderOverviewCard({ item, metrics, onClick }) {

    {item.modelCount}

    -

    models

    +

    {tc("models")}

    @@ -406,6 +411,7 @@ function ProviderModelsModal({ provider, models, onClose }) { const router = useRouter(); const t = useTranslations("home"); const tc = useTranslations("common"); + const ts = useTranslations("sidebar"); const navigateTo = (path) => { onClose(); @@ -415,20 +421,29 @@ function ProviderModelsModal({ provider, models, onClose }) { const handleCopy = (text) => { navigator.clipboard.writeText(text); setCopiedModel(text); - notify.success(`Copied: ${text}`); + notify.success(t("copiedModel", { model: text })); setTimeout(() => setCopiedModel(null), 2000); }; return ( - +
    {/* Summary */}
    token - {models.length} model{models.length !== 1 ? "s" : ""} available + {models.length === 1 + ? t("modelAvailable", { count: models.length }) + : t("modelsAvailable", { count: models.length })} {provider.total > 0 && ( - ● {provider.connected} connection{provider.connected !== 1 ? "s" : ""} active + ●{" "} + {provider.connected === 1 + ? t("connectionsActive", { count: provider.connected }) + : t("connectionsActivePlural", { count: provider.connected })} )}
    @@ -440,13 +455,7 @@ function ProviderModelsModal({ provider, models, onClose }) {

    {t("noModelsAvailable")}

    - Configure a connection first in{" "} - + {t("configureFirst", { providers: ts("providers") })}

    ) : ( @@ -459,7 +468,9 @@ function ProviderModelsModal({ provider, models, onClose }) {

    {m.fullModel}

    {m.alias !== m.model && ( -

    alias: {m.alias}

    +

    + {t("aliasLabel")}: {m.alias} +

    )}
    diff --git a/src/app/(dashboard)/dashboard/audit-log/page.tsx b/src/app/(dashboard)/dashboard/audit-log/page.tsx index 77b4a2b3f7..b0f4c4dcef 100644 --- a/src/app/(dashboard)/dashboard/audit-log/page.tsx +++ b/src/app/(dashboard)/dashboard/audit-log/page.tsx @@ -50,11 +50,11 @@ export default function AuditLogPage() { setHasMore(data.length > PAGE_SIZE); setEntries(data.slice(0, PAGE_SIZE)); } catch (err: any) { - setError(err.message || "Failed to fetch audit log"); + setError(err.message || t("failedFetchAuditLog")); } finally { setLoading(false); } - }, [actionFilter, actorFilter, offset]); + }, [actionFilter, actorFilter, offset, t]); useEffect(() => { fetchEntries(); @@ -96,7 +96,7 @@ export default function AuditLogPage() {