From 87c7c83dd959ee0a6f96fd203cd8d4142384cb55 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Wed, 25 Feb 2026 14:11:06 -0300 Subject: [PATCH] feat(i18n): migrate Providers page (1110 lines, 30+ strings) - ProvidersPage: section headers, test buttons, compatible provider modals - Expanded providers namespace from 16 to 73 keys in en.json and pt-BR.json - Coverage: OAuth/Free/API Key/Compatible sections, batch test, modals --- .../(dashboard)/dashboard/providers/page.tsx | 55 ++++++++------- src/i18n/messages/en.json | 68 ++++++++++++++++++- src/i18n/messages/pt-BR.json | 68 ++++++++++++++++++- 3 files changed, 163 insertions(+), 28 deletions(-) diff --git a/src/app/(dashboard)/dashboard/providers/page.tsx b/src/app/(dashboard)/dashboard/providers/page.tsx index 7ab21fcae9..c51591df2d 100644 --- a/src/app/(dashboard)/dashboard/providers/page.tsx +++ b/src/app/(dashboard)/dashboard/providers/page.tsx @@ -23,6 +23,7 @@ import Link from "next/link"; import { getErrorCode, getRelativeTime } from "@/shared/utils"; import { useNotificationStore } from "@/store/notificationStore"; import ModelAvailabilityBadge from "./components/ModelAvailabilityBadge"; +import { useTranslations } from "next-intl"; // Shared helper function to avoid code duplication between ProviderCard and ApiKeyProviderCard function getStatusDisplay(connected, error, errorCode) { @@ -97,6 +98,8 @@ export default function ProvidersPage() { const [testingMode, setTestingMode] = useState(null); const [testResults, setTestResults] = useState(null); const notify = useNotificationStore(); + const t = useTranslations("providers"); + const tc = useTranslations("common"); useEffect(() => { const fetchData = async () => { @@ -194,12 +197,12 @@ export default function ProvidersPage() { setTestResults(data); if (data.summary) { const { passed, failed, total } = data.summary; - if (failed === 0) notify.success(`All ${total} tests passed`); - else notify.warning(`${passed}/${total} passed, ${failed} failed`); + if (failed === 0) notify.success(t("allTestsPassed", { total })); + else notify.warning(t("testSummary", { passed, failed, total })); } } catch (error) { - setTestResults({ error: "Test request failed" }); - notify.error("Provider test failed"); + setTestResults({ error: t("providerTestFailed") }); + notify.error(t("providerTestFailed")); } finally { setTestingMode(null); } @@ -239,7 +242,8 @@ export default function ProvidersPage() {

- OAuth Providers + {t("oauthProviders")}{" "} +

@@ -251,13 +255,13 @@ export default function ProvidersPage() { ? "bg-primary/20 border-primary/40 text-primary animate-pulse" : "bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40" }`} - title="Test all OAuth connections" - aria-label="Test all OAuth connections" + title={t("testAllOAuth")} + aria-label={t("testAllOAuth")} > {testingMode === "oauth" ? "sync" : "play_arrow"} - {testingMode === "oauth" ? "Testing..." : "Test All"} + {testingMode === "oauth" ? t("testing") : t("testAll")}
@@ -279,7 +283,8 @@ export default function ProvidersPage() {

- Free Providers + {t("freeProviders")}{" "} +

@@ -316,7 +321,7 @@ export default function ProvidersPage() {

- API Key Providers{" "} + {t("apiKeyProviders")}{" "}

@@ -354,7 +359,7 @@ export default function ProvidersPage() {

- API Key Compatible Providers{" "} + {t("compatibleProviders")}{" "}

@@ -367,16 +372,16 @@ export default function ProvidersPage() { ? "bg-primary/20 border-primary/40 text-primary animate-pulse" : "bg-bg-subtle border-border text-text-muted hover:text-text-primary hover:border-primary/40" }`} - title="Test all Compatible connections" + title={t("testAllCompatible")} > {testingMode === "compatible" ? "sync" : "play_arrow"} - {testingMode === "compatible" ? "Testing..." : "Test All"} + {testingMode === "compatible" ? t("testing") : t("testAll")} )}
@@ -394,10 +399,8 @@ export default function ProvidersPage() { extension -

No compatible providers added yet

-

- Use the buttons above to add OpenAI or Anthropic compatible endpoints -

+

{t("noCompatibleYet")}

+

{t("compatibleHint")}

) : (
@@ -442,7 +445,7 @@ export default function ProvidersPage() { onClick={(e) => e.stopPropagation()} >
-

Test Results

+

{t("testResults")}