diff --git a/apps/compliance-portal/src/_locales/en-US.json b/apps/compliance-portal/src/_locales/en-US.json index a0f812fd9..a4a7548e4 100644 --- a/apps/compliance-portal/src/_locales/en-US.json +++ b/apps/compliance-portal/src/_locales/en-US.json @@ -1,5 +1,32 @@ { + "topBar": { + "tagline": "Compliance Portal", + "getAccess": "Get Access", + "nav": { + "documents": "Documents", + "subprocessors": "Subprocessors", + "updates": "Updates", + "requests": "Requests" + } + }, + "userMenu": { + "signOut": "Sign out" + }, + "home": { + "heroTitle": "Trust at {{name}}." + }, "documents": { "title": "Documents" + }, + "subprocessors": { + "title": "Subprocessors" + }, + "updates": { + "title": "Updates", + "subscribe": "Subscribe to updates" + }, + "requests": { + "title": "Data Requests", + "newRequest": "New Request" } } diff --git a/apps/compliance-portal/src/_locales/fr-FR.json b/apps/compliance-portal/src/_locales/fr-FR.json index a0f812fd9..429514070 100644 --- a/apps/compliance-portal/src/_locales/fr-FR.json +++ b/apps/compliance-portal/src/_locales/fr-FR.json @@ -1,5 +1,32 @@ { + "topBar": { + "tagline": "Portail de conformité", + "getAccess": "Obtenir l'accès", + "nav": { + "documents": "Documents", + "subprocessors": "Sous-traitants", + "updates": "Mises à jour", + "requests": "Demandes" + } + }, + "userMenu": { + "signOut": "Se déconnecter" + }, + "home": { + "heroTitle": "La confiance chez {{name}}." + }, "documents": { "title": "Documents" + }, + "subprocessors": { + "title": "Sous-traitants" + }, + "updates": { + "title": "Mises à jour", + "subscribe": "S'abonner aux mises à jour" + }, + "requests": { + "title": "Demandes de données", + "newRequest": "Nouvelle demande" } } diff --git a/apps/compliance-portal/src/components/TopBar/TopBar.tsx b/apps/compliance-portal/src/components/TopBar/TopBar.tsx index 35d7edd33..63ea06411 100644 --- a/apps/compliance-portal/src/components/TopBar/TopBar.tsx +++ b/apps/compliance-portal/src/components/TopBar/TopBar.tsx @@ -17,6 +17,7 @@ import { Avatar } from "@probo/ui/src/v2/Avatar/Avatar"; import { Button } from "@probo/ui/src/v2/Button/Button"; import { Link } from "@probo/ui/src/v2/Button/Link"; import { Text } from "@probo/ui/src/v2/typography/Text"; +import { useTranslation } from "react-i18next"; import { graphql, useFragment } from "react-relay"; import { Link as RouterLink, useLocation } from "react-router"; @@ -25,10 +26,10 @@ import { TopBarUserMenu } from "./TopBarUserMenu"; import { topBar } from "./variants"; const NAV_ITEMS = [ - { to: "/documents", label: "Documents" }, - { to: "/subprocessors", label: "Subprocessors" }, - { to: "/updates", label: "Updates" }, - { to: "/requests", label: "Requests" }, + { to: "/documents", labelKey: "topBar.nav.documents" }, + { to: "/subprocessors", labelKey: "topBar.nav.subprocessors" }, + { to: "/updates", labelKey: "topBar.nav.updates" }, + { to: "/requests", labelKey: "topBar.nav.requests" }, ] as const; const topBarFragment = graphql` @@ -57,6 +58,7 @@ function isActive(pathname: string, to: string): boolean { } export function TopBar({ queryKey }: TopBarProps) { + const { t } = useTranslation(); const data = useFragment(topBarFragment, queryKey); const { pathname } = useLocation(); @@ -83,7 +85,7 @@ export function TopBar({ queryKey }: TopBarProps) { {organizationName} - Compliance Portal + {t("topBar.tagline")} @@ -99,13 +101,13 @@ export function TopBar({ queryKey }: TopBarProps) { size={2} active={isActive(pathname, item.to)} > - {item.label} + {t(item.labelKey)} ))} {data.viewer == null ? ( ) : } diff --git a/apps/compliance-portal/src/components/TopBar/TopBarUserMenu.tsx b/apps/compliance-portal/src/components/TopBar/TopBarUserMenu.tsx index 50e27e5ad..34f33eb38 100644 --- a/apps/compliance-portal/src/components/TopBar/TopBarUserMenu.tsx +++ b/apps/compliance-portal/src/components/TopBar/TopBarUserMenu.tsx @@ -21,6 +21,7 @@ import { DropdownPopup } from "@probo/ui/src/v2/Dropdown/DropdownPopup"; import { DropdownSeparator } from "@probo/ui/src/v2/Dropdown/DropdownSeparator"; import { DropdownTrigger } from "@probo/ui/src/v2/Dropdown/DropdownTrigger"; import { Text } from "@probo/ui/src/v2/typography/Text"; +import { useTranslation } from "react-i18next"; import { graphql, useFragment } from "react-relay"; import type { TopBarUserMenu_identity$key } from "./__generated__/TopBarUserMenu_identity.graphql"; @@ -38,6 +39,7 @@ interface TopBarUserMenuProps { } export function TopBarUserMenu({ identityKey }: TopBarUserMenuProps) { + const { t } = useTranslation(); const identity = useFragment(topBarUserMenuFragment, identityKey); return ( @@ -63,7 +65,7 @@ export function TopBarUserMenu({ identityKey }: TopBarUserMenuProps) { {identity.email} }> - Sign out + {t("userMenu.signOut")} diff --git a/apps/compliance-portal/src/pages/HomePage.tsx b/apps/compliance-portal/src/pages/HomePage.tsx index 55cdd36d9..ad82afaa2 100644 --- a/apps/compliance-portal/src/pages/HomePage.tsx +++ b/apps/compliance-portal/src/pages/HomePage.tsx @@ -12,6 +12,7 @@ // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. +import { useTranslation } from "react-i18next"; import type { PreloadedQuery } from "react-relay"; import { graphql, usePreloadedQuery } from "react-relay"; @@ -37,11 +38,15 @@ interface HomePageProps { } export function HomePage({ queryRef }: HomePageProps) { + const { t } = useTranslation(); const data = usePreloadedQuery(homePageQuery, queryRef); const { organization } = data.currentTrustCenter; return ( - + ); diff --git a/apps/compliance-portal/src/pages/RequestsPage.tsx b/apps/compliance-portal/src/pages/RequestsPage.tsx index bbf084f9d..e7f437fdb 100644 --- a/apps/compliance-portal/src/pages/RequestsPage.tsx +++ b/apps/compliance-portal/src/pages/RequestsPage.tsx @@ -14,16 +14,18 @@ import { PlusIcon } from "@phosphor-icons/react"; import { Button } from "@probo/ui/src/v2/Button/Button"; +import { useTranslation } from "react-i18next"; import { PageHeader } from "#/components/PageHeader/PageHeader"; export default function RequestsPage() { + const { t } = useTranslation(); return ( }> - New Request + {t("requests.newRequest")} )} /> diff --git a/apps/compliance-portal/src/pages/SubprocessorsPage.tsx b/apps/compliance-portal/src/pages/SubprocessorsPage.tsx index 6dc812a07..869b82609 100644 --- a/apps/compliance-portal/src/pages/SubprocessorsPage.tsx +++ b/apps/compliance-portal/src/pages/SubprocessorsPage.tsx @@ -12,10 +12,13 @@ // OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. +import { useTranslation } from "react-i18next"; + import { PageHeader } from "#/components/PageHeader/PageHeader"; // Toolbar (category/region filters, search, Download CSV) and the subprocessor // count are deferred until the v2 Select/TextField components exist. export default function SubprocessorsPage() { - return ; + const { t } = useTranslation(); + return ; } diff --git a/apps/compliance-portal/src/pages/UpdatesPage.tsx b/apps/compliance-portal/src/pages/UpdatesPage.tsx index f70e32415..711a50d03 100644 --- a/apps/compliance-portal/src/pages/UpdatesPage.tsx +++ b/apps/compliance-portal/src/pages/UpdatesPage.tsx @@ -14,16 +14,18 @@ import { BellIcon } from "@phosphor-icons/react"; import { Button } from "@probo/ui/src/v2/Button/Button"; +import { useTranslation } from "react-i18next"; import { PageHeader } from "#/components/PageHeader/PageHeader"; export default function UpdatesPage() { + const { t } = useTranslation(); return ( }> - Subscribe to updates + {t("updates.subscribe")} )} />