From 372c4827ab7d3a306219e18787e107bf0d2bba79 Mon Sep 17 00:00:00 2001 From: NaeemDosh Date: Fri, 14 Aug 2026 18:42:30 +0500 Subject: [PATCH] =?UTF-8?q?i18n:=20expand=20German=20coverage=20=E2=80=94?= =?UTF-8?q?=20wrap=20onboarding=20+=20app-shell=20components=20(v4.5.2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extends the v4.5.2 i18n patch to translate 8 more user components the initial re-sync had left English (onboarding NameStep/LLMStep/NonAdminStep, AppChrome, AppPage, settings layout, MultiModelSelector, opal sidebar). ~24 additional strings, using PR #12558's own keys (already in de.json), so German resolves immediately. Method: extracted the PR's exact string->key wrapping and re-applied it onto v4.5.2's versions, injecting each useTranslation hook at the PR's own anchor (verified every t() call is inside its hook's function scope). Patch applies clean to pristine v4.5.2 (55 files). Un-wrapped strings fall back to English, so no breakage. Remaining un-wrapped (documented): components v4.5.2 restructured heavily (chat greeting is a logic refactor, some sidebar/modal/model-selector text) — bespoke per-component work, added incrementally. Note: final image build to be run on a stable connection (local Docker build network- blocked this session); patch + hook scoping verified statically. --- README.md | 10 +- branding/i18n/end-user-i18n.patch | 357 ++++++++++++++++++++++++++++++ 2 files changed, 363 insertions(+), 4 deletions(-) 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