i18n: expand German coverage — wrap onboarding + app-shell components (v4.5.2)

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.
This commit is contained in:
NaeemDosh 2026-08-14 18:42:30 +05:00
parent ea2c56f9e0
commit 372c4827ab
2 changed files with 363 additions and 4 deletions

View file

@ -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 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). 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 > **Coverage:** the core user UI plus the full onboarding flow and app shell are
> component the PR also touched, that component keeps its English text (rather than risk a > translated. A handful of components that v4.5.2 restructured more heavily (the chat
> broken UI) — so translation coverage grows over time / with each re-sync, and the app is > greeting, some sidebar/modal/model-selector text) still show English — wiring those to
> always guaranteed to build and run. > 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 ### Editing the German translations

View file

@ -178,6 +178,35 @@ index 9ccfc31a..029d4a9d 100644
sizePreset="headline" sizePreset="headline"
variant="heading" 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({
<Button
icon={SvgSidebar}
prominence="tertiary"
- tooltip={folded ? "Open Sidebar" : "Close Sidebar"}
+ tooltip={folded ? "Open Sidebar" : t("chat.sidebar.close_sidebar", "Close Sidebar")}
tooltipSide={folded ? "right" : "bottom"}
size="md"
onClick={toggleFolded}
diff --git a/web/package.json b/web/package.json diff --git a/web/package.json b/web/package.json
index 43c3eeff..c0895dc4 100644 index 43c3eeff..c0895dc4 100644
--- a/web/package.json --- a/web/package.json
@ -11279,6 +11308,52 @@ index e877f6c7..186d0111 100644
} }
} }
diff --git a/web/src/app/app/settings/layout.tsx b/web/src/app/app/settings/layout.tsx
index c5c96174..199b3f7a 100644
--- a/web/src/app/app/settings/layout.tsx
+++ b/web/src/app/app/settings/layout.tsx
@@ -1,6 +1,7 @@
"use client";
import { usePathname, useRouter } from "next/navigation";
+import { useTranslation } from "react-i18next";
import type { Route } from "next";
import { SettingsLayouts } from "@opal/layouts";
import { SidebarTab, Text } from "@opal/components";
@@ -20,6 +21,7 @@ interface SettingsTab {
}
export default function Layout({ children }: LayoutProps) {
+ const { t } = useTranslation();
const pathname = usePathname();
const router = useRouter();
const { user } = useUser();
@@ -30,12 +32,12 @@ export default function Layout({ children }: LayoutProps) {
const showAccountsAccessTab = showPasswordSection || showTokensSection;
const tabs: SettingsTab[] = [
- { href: "/app/settings/general", label: "General" },
- { href: "/app/settings/chat-preferences", label: "Chat Preferences" },
+ { href: "/app/settings/general", label: t("settings.tabs.general", "General") },
+ { href: "/app/settings/chat-preferences", label: t("settings.tabs.chat_preferences", "Chat Preferences") },
...(showAccountsAccessTab
- ? [{ href: "/app/settings/accounts-access", label: "Accounts & Access" }]
+ ? [{ href: "/app/settings/accounts-access", label: t("settings.tabs.accounts_access", "Accounts & Access") }]
: []),
- { href: "/app/settings/connectors", label: "Connectors" },
+ { href: "/app/settings/connectors", label: t("settings.tabs.connectors", "Connectors") },
];
// Derive the trigger label from the pathname directly. InputSelect normally
@@ -46,7 +48,7 @@ export default function Layout({ children }: LayoutProps) {
return (
<SettingsLayouts.Root width="lg">
- <SettingsLayouts.Header icon={SvgSliders} title="Settings" divider />
+ <SettingsLayouts.Header icon={SvgSliders} title={t("settings.header", "Settings")} divider />
<SettingsLayouts.Body>
<Section
diff --git a/web/src/app/auth/login/LoginText.tsx b/web/src/app/auth/login/LoginText.tsx diff --git a/web/src/app/auth/login/LoginText.tsx b/web/src/app/auth/login/LoginText.tsx
index 6be13325..ef787fac 100644 index 6be13325..ef787fac 100644
--- a/web/src/app/auth/login/LoginText.tsx --- a/web/src/app/auth/login/LoginText.tsx
@ -11470,6 +11545,71 @@ index 28d376ef..4df8a551 100644
</Text> </Text>
</ErrorPageLayout> </ErrorPageLayout>
); );
diff --git a/web/src/layouts/chromes/AppChrome.tsx b/web/src/layouts/chromes/AppChrome.tsx
index 2ecb033e..72c56150 100644
--- a/web/src/layouts/chromes/AppChrome.tsx
+++ b/web/src/layouts/chromes/AppChrome.tsx
@@ -9,6 +9,7 @@ import {
type ReactNode,
} from "react";
import { RootLayout, RootLayoutRightPanelSlotContext } from "@opal/layouts";
+import { useTranslation } from "react-i18next";
import { cn, markdown } from "@opal/utils";
import { INTERACTIVE_SELECTOR, noProp } from "@/lib/utils";
import { useAppBackground } from "@/providers/AppBackgroundProvider";
@@ -74,6 +75,7 @@ import { useFullWidthChat } from "@/providers/FullWidthChatProvider";
// ---------------------------------------------------------------------------
function Header() {
+ const { t } = useTranslation();
const appFocus = useAppFocus();
const businessTier = useTierAtLeast(Tier.BUSINESS);
const { state, setAppMode } = useQueryController();
@@ -294,7 +296,7 @@ function Header() {
rounding="sm"
color="danger"
icon={SvgTrash}
- title="Delete"
+ title={t("settings.danger_zone.delete_btn", "Delete")}
onClick={noProp(() => setDeleteConfirmationModalOpen(true))}
/>,
];
@@ -344,7 +346,7 @@ function Header() {
onClose={() => setDeleteModalOpen(false)}
submit={
<Button variant="danger" onClick={handleDeleteChat}>
- Delete
+ {t("settings.danger_zone.delete_btn", "Delete")}
</Button>
}
>
@@ -391,7 +393,7 @@ function Header() {
: SvgBubbleText
}
>
- {effectiveMode === "search" ? "Search" : "Chat"}
+ {effectiveMode === "search" ? "Search" : t("settings.chats.mode_chat", "Chat")}
</OpenButton>
</Popover.Trigger>
<Popover.Content align="start" width="lg">
@@ -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 diff --git a/web/src/lib/i18n.ts b/web/src/lib/i18n.ts
new file mode 100644 new file mode 100644
index 00000000..23029a41 index 00000000..23029a41
@ -12876,6 +13016,35 @@ index 66a7a6b1..bc7f79d6 100644
</Button> </Button>
)} )}
<Button <Button
diff --git a/web/src/sections/model-selector/MultiModelSelector.tsx b/web/src/sections/model-selector/MultiModelSelector.tsx
index e287ff79..5912e39a 100644
--- a/web/src/sections/model-selector/MultiModelSelector.tsx
+++ b/web/src/sections/model-selector/MultiModelSelector.tsx
@@ -1,6 +1,7 @@
"use client";
import { useState, useMemo, useRef } from "react";
+import { useTranslation } from "react-i18next";
import { getModelIcon } from "@/lib/languageModels";
import {
Button,
@@ -53,6 +54,7 @@ export default function MultiModelSelector({
temperatureManager,
reasoningManager,
}: MultiModelSelectorProps) {
+ const { t } = useTranslation();
const [open, setOpen] = useState(false);
const [replacingIndex, setReplacingIndex] = useState<number | null>(null);
const anchorRef = useRef<HTMLElement | null>(null);
@@ -177,7 +179,7 @@ export default function MultiModelSelector({
prominence="tertiary"
icon={SvgPlusCircle}
size="sm"
- tooltip="Add Model"
+ tooltip={t("chat.model_selector.add_model", "Add Model")}
onClick={(e: React.MouseEvent) => {
if (noModelsToSelect) return;
anchorRef.current = e.currentTarget as HTMLElement;
diff --git a/web/src/sections/onboarding/components/LLMProviderCard.tsx b/web/src/sections/onboarding/components/LLMProviderCard.tsx diff --git a/web/src/sections/onboarding/components/LLMProviderCard.tsx b/web/src/sections/onboarding/components/LLMProviderCard.tsx
index e652ce73..ab88c792 100644 index e652ce73..ab88c792 100644
--- a/web/src/sections/onboarding/components/LLMProviderCard.tsx --- a/web/src/sections/onboarding/components/LLMProviderCard.tsx
@ -12905,6 +13074,71 @@ index e652ce73..ab88c792 100644
</Text> </Text>
<div className="p-0.5"> <div className="p-0.5">
<SvgArrowExchange className="w-4 h-4 stroke-text-03" /> <SvgArrowExchange className="w-4 h-4 stroke-text-03" />
diff --git a/web/src/sections/onboarding/components/NonAdminStep.tsx b/web/src/sections/onboarding/components/NonAdminStep.tsx
index 405e1b97..58a43458 100644
--- a/web/src/sections/onboarding/components/NonAdminStep.tsx
+++ b/web/src/sections/onboarding/components/NonAdminStep.tsx
@@ -1,6 +1,7 @@
"use client";
import React, { useRef, useState, useEffect } from "react";
+import { useTranslation } from "react-i18next";
import Text from "@/refresh-components/texts/Text";
import { InputTypeIn } from "@opal/components";
import { updateUserPersonalization } from "@/lib/users/svc";
@@ -14,6 +15,7 @@ import { ContentAction, InputHorizontal, toast } from "@opal/layouts";
import { Hoverable } from "@opal/core";
export default function NonAdminStep() {
+ const { t } = useTranslation();
const inputRef = useRef<HTMLInputElement>(null);
const { user, refreshUser } = useUser();
const [name, setName] = useState("");
@@ -69,7 +71,7 @@ export default function NonAdminStep() {
{...props}
/>
)}
- title="You're all set!"
+ title={t("onboarding.all_set", "You're all set!")}
sizePreset="main-ui"
variant="body"
color="muted"
@@ -95,7 +97,7 @@ export default function NonAdminStep() {
<InputHorizontal
responsive
icon={SvgUser}
- title="What should Onyx call you?"
+ title={t("onboarding.name_prompt", "What should Onyx call you?")}
description="We will display this name in the app."
>
<div className="flex w-full items-center gap-2">
@@ -114,7 +116,7 @@ export default function NonAdminStep() {
}}
/>
<Button disabled={name === ""} onClick={handleSave}>
- Save
+ {t("onboarding.btn_save", "Save")}
</Button>
</div>
</InputHorizontal>
@@ -123,7 +125,7 @@ export default function NonAdminStep() {
<Hoverable.Root group="nonAdminName" width="full">
<div
className={containerClasses}
- aria-label="Edit display name"
+ aria-label={t("onboarding.edit_display_name", "Edit display name")}
role="button"
tabIndex={0}
onClick={() => {
@@ -149,7 +151,7 @@ export default function NonAdminStep() {
<div className="p-1 flex items-center gap-1">
{/* TODO(@raunakab): migrate to opal Button once className/iconClassName is resolved */}
<Hoverable.Item group="nonAdminName" variant="appear-on-hover">
- <IconButton internal icon={SvgEdit} tooltip="Edit" />
+ <IconButton internal icon={SvgEdit} tooltip={t("chat.edit", "Edit")} />
</Hoverable.Item>
<SvgCheckCircle className="w-4 h-4 stroke-status-success-05" />
</div>
diff --git a/web/src/sections/onboarding/components/OnboardingHeader.tsx b/web/src/sections/onboarding/components/OnboardingHeader.tsx diff --git a/web/src/sections/onboarding/components/OnboardingHeader.tsx b/web/src/sections/onboarding/components/OnboardingHeader.tsx
index 6bf2691e..7a01ea51 100644 index 6bf2691e..7a01ea51 100644
--- a/web/src/sections/onboarding/components/OnboardingHeader.tsx --- a/web/src/sections/onboarding/components/OnboardingHeader.tsx
@ -13066,6 +13300,100 @@ index 139000c5..d4f82845 100644
</Button> </Button>
</Link> </Link>
} }
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")}
</Button>
}
/>
@@ -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")}
>
<div className="flex items-center gap-1">
<StackedProviderIcons
@@ -245,7 +247,7 @@ const LLMStep = memo(
{onboardingState.data.llmProviders?.length || 0}{" "}
{(onboardingState.data.llmProviders?.length || 0) === 1
? "model"
- : "models"}{" "}
+ : t("onboarding.llm.models", "models")}{" "}
connected
</Text>
</div>
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(
<InputHorizontal
responsive
icon={SvgUser}
- title="What should Onyx call you?"
+ title={t("onboarding.name_prompt", "What should Onyx call you?")}
description="We will display this name in the app."
>
<InputTypeIn
@@ -69,7 +71,7 @@ const NameStep = React.memo(
setButtonActive(true);
goToStep(OnboardingStep.Name);
}}
- aria-label="Edit display name"
+ aria-label={t("onboarding.edit_display_name", "Edit display name")}
role="button"
tabIndex={0}
>
@@ -93,7 +95,7 @@ const NameStep = React.memo(
<div className="p-1 flex items-center gap-1">
{/* TODO(@raunakab): migrate to opal Button once className/iconClassName is resolved */}
<Hoverable.Item group="nameStep" variant="appear-on-hover">
- <IconButton internal icon={SvgEdit} tooltip="Edit" />
+ <IconButton internal icon={SvgEdit} tooltip={t("chat.edit", "Edit")} />
</Hoverable.Item>
<SvgCheckCircle
className={cn(
diff --git a/web/src/sections/projects/ProjectContextPanel.tsx b/web/src/sections/projects/ProjectContextPanel.tsx diff --git a/web/src/sections/projects/ProjectContextPanel.tsx b/web/src/sections/projects/ProjectContextPanel.tsx
index 590bfbf9..28cfde96 100644 index 590bfbf9..28cfde96 100644
--- a/web/src/sections/projects/ProjectContextPanel.tsx --- a/web/src/sections/projects/ProjectContextPanel.tsx
@ -13827,6 +14155,35 @@ index c0ba4db2..ee97e896 100644
/> />
</> </>
)} )}
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) {
<Modal.Content>
<Modal.Header
icon={SvgFileText}
- title="Sources"
+ title={t("general.sources", "Sources")}
onClose={() => updateCurrentDocumentSidebarVisible(false)}
/>
<Modal.Body>
diff --git a/web/src/views/SettingsPage.tsx b/web/src/views/SettingsPage.tsx diff --git a/web/src/views/SettingsPage.tsx b/web/src/views/SettingsPage.tsx
index f1638662..de08d7ca 100644 index f1638662..de08d7ca 100644
--- a/web/src/views/SettingsPage.tsx --- a/web/src/views/SettingsPage.tsx