diff --git a/README.md b/README.md index 67ee05e..49ed29c 100644 --- a/README.md +++ b/README.md @@ -176,10 +176,12 @@ It's wired into the overlay, config-driven from `branding.config.json → i18n`: applies with **zero conflicts**. It will *not* apply to a different Onyx version — that's why the deployment must run the pinned release (see the re-sync note below). -> **Coverage:** most end-user components are translated. Where v4.5.2 refactored a -> component the PR also touched, that component keeps its English text (rather than risk a -> broken UI) — so translation coverage grows over time / with each re-sync, and the app is -> always guaranteed to build and run. +> **Coverage:** the core user UI plus the full onboarding flow and app shell are +> translated. A handful of components that v4.5.2 restructured more heavily (the chat +> greeting, some sidebar/modal/model-selector text) still show English — wiring those to +> the dictionary is bespoke per-component work (a few are logic refactors, not simple +> string wraps), added incrementally. Un-wrapped strings always fall back to English, so +> the app is guaranteed to build and run; coverage only grows. ### Editing the German translations diff --git a/branding/i18n/end-user-i18n.patch b/branding/i18n/end-user-i18n.patch index 17086df..94ab6f9 100644 --- a/branding/i18n/end-user-i18n.patch +++ b/branding/i18n/end-user-i18n.patch @@ -178,6 +178,35 @@ index 9ccfc31a..029d4a9d 100644 sizePreset="headline" variant="heading" /> +diff --git a/web/lib/opal/src/layouts/sidebar/components.tsx b/web/lib/opal/src/layouts/sidebar/components.tsx +index b2f9d111..6465ad0c 100644 +--- a/web/lib/opal/src/layouts/sidebar/components.tsx ++++ b/web/lib/opal/src/layouts/sidebar/components.tsx +@@ -1,6 +1,7 @@ + "use client"; + + import "@opal/layouts/sidebar/styles.css"; ++import { useTranslation } from "react-i18next"; + import { + createContext, + useCallback, +@@ -135,6 +136,7 @@ function SidebarHeader({ + showLogoWhenFolded = true, + children, + }: SidebarHeaderProps) { ++ const { t } = useTranslation(); + const foldable = useContext(SidebarFoldableContext); + const { folded, setFolded } = useSidebarState(); + const toggleFolded = useCallback( +@@ -147,7 +149,7 @@ function SidebarHeader({ + + } + > +@@ -391,7 +393,7 @@ function Header() { + : SvgBubbleText + } + > +- {effectiveMode === "search" ? "Search" : "Chat"} ++ {effectiveMode === "search" ? "Search" : t("settings.chats.mode_chat", "Chat")} + + + +@@ -403,7 +405,7 @@ function Header() { + state={ + effectiveMode === "search" ? "selected" : "empty" + } +- title="Search" ++ title={t("settings.chats.mode_search", "Search")} + description="Quick search for documents" + onClick={noProp(() => { + setAppMode("search"); +@@ -417,7 +419,7 @@ function Header() { + state={ + effectiveMode === "chat" ? "selected" : "empty" + } +- title="Chat" ++ title={t("settings.chats.mode_chat", "Chat")} + description="Conversation and research" + onClick={noProp(() => { + setAppMode("chat"); diff --git a/web/src/lib/i18n.ts b/web/src/lib/i18n.ts new file mode 100644 index 00000000..23029a41 @@ -12876,6 +13016,35 @@ index 66a7a6b1..bc7f79d6 100644 )} + + +@@ -123,7 +125,7 @@ export default function NonAdminStep() { + +
{ +@@ -149,7 +151,7 @@ export default function NonAdminStep() { +
+ {/* TODO(@raunakab): migrate to opal Button once className/iconClassName is resolved */} + +- ++ + + +
diff --git a/web/src/sections/onboarding/components/OnboardingHeader.tsx b/web/src/sections/onboarding/components/OnboardingHeader.tsx index 6bf2691e..7a01ea51 100644 --- a/web/src/sections/onboarding/components/OnboardingHeader.tsx @@ -13066,6 +13300,100 @@ index 139000c5..d4f82845 100644 } +diff --git a/web/src/sections/onboarding/steps/LLMStep.tsx b/web/src/sections/onboarding/steps/LLMStep.tsx +index ed33003b..2a8df2cc 100644 +--- a/web/src/sections/onboarding/steps/LLMStep.tsx ++++ b/web/src/sections/onboarding/steps/LLMStep.tsx +@@ -1,6 +1,7 @@ + "use client"; + + import { memo, useState, useCallback } from "react"; ++import { useTranslation } from "react-i18next"; + import Text from "@/refresh-components/texts/Text"; + import { Button, Divider } from "@opal/components"; + import LLMProviderCard from "@/sections/onboarding/components/LLMProviderCard"; +@@ -90,6 +91,7 @@ const LLMStep = memo( + actions: onboardingActions, + disabled, + }: LLMStepProps) => { ++ const { t } = useTranslation(); + const { llmProviderOptions, isLoading } = useLLMProviderOptions(); + const llmDescriptors = llmProviderOptions ?? []; + +@@ -143,7 +145,7 @@ const LLMStep = memo( + rightIcon={SvgExternalLink} + href="/admin/configuration/language-models" + > +- View in Admin Panel ++ {t("onboarding.llm.btn_view_admin", "View in Admin Panel")} + + } + /> +@@ -235,7 +237,7 @@ const LLMStep = memo( + onboardingActions.setButtonActive(true); + onboardingActions.goToStep(OnboardingStep.LlmSetup); + }} +- aria-label="Edit LLM providers" ++ aria-label={t("onboarding.llm.edit_providers", "Edit LLM providers")} + > +
+ +
+diff --git a/web/src/sections/onboarding/steps/NameStep.tsx b/web/src/sections/onboarding/steps/NameStep.tsx +index dbd41f2c..d4e5c45e 100644 +--- a/web/src/sections/onboarding/steps/NameStep.tsx ++++ b/web/src/sections/onboarding/steps/NameStep.tsx +@@ -1,6 +1,7 @@ + "use client"; + + import React, { useRef } from "react"; ++import { useTranslation } from "react-i18next"; + import Text from "@/refresh-components/texts/Text"; + import { InputTypeIn } from "@opal/components"; + import { +@@ -22,6 +23,7 @@ export interface NameStepProps { + + const NameStep = React.memo( + ({ state: onboardingState, actions: onboardingActions }: NameStepProps) => { ++ const { t } = useTranslation(); + const { userName } = onboardingState.data; + const { updateName, goToStep, setButtonActive, nextStep } = + onboardingActions; +@@ -49,7 +51,7 @@ const NameStep = React.memo( + + +@@ -93,7 +95,7 @@ const NameStep = React.memo( +
+ {/* TODO(@raunakab): migrate to opal Button once className/iconClassName is resolved */} + +- ++ + + )} +diff --git a/web/src/views/AppPage.tsx b/web/src/views/AppPage.tsx +index a051002d..535af1b5 100644 +--- a/web/src/views/AppPage.tsx ++++ b/web/src/views/AppPage.tsx +@@ -1,6 +1,7 @@ + "use client"; + + import { redirect, useRouter, useSearchParams } from "next/navigation"; ++import { useTranslation } from "react-i18next"; + import { personaIncludesRetrieval } from "@/app/app/services/lib"; + import { useCallback, useEffect, useMemo, useRef, useState } from "react"; + import { SEARCH_PARAM_NAMES } from "@/app/app/services/searchParams"; +@@ -111,6 +112,7 @@ export interface ChatPageProps { + } + + export default function AppPage({ firstMessage }: ChatPageProps) { ++ const { t } = useTranslation(); + // Performance tracking + // Keeping this here in case we need to track down slow renders in the future + // const renderCount = useRef(0); +@@ -742,7 +744,7 @@ export default function AppPage({ firstMessage }: ChatPageProps) { + + updateCurrentDocumentSidebarVisible(false)} + /> + diff --git a/web/src/views/SettingsPage.tsx b/web/src/views/SettingsPage.tsx index f1638662..de08d7ca 100644 --- a/web/src/views/SettingsPage.tsx