Skip to content

🙌 OpenHands: AI-Driven Development

Namespace library i18n resources (#62)

Graham Neubig8bfae719395b
diff --git a/AGENTS.md b/AGENTS.md
index 40a446d8fd..1182c6ba10 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -89,6 +89,8 @@
- Settings selectors no longer use the v2 `Autocomplete` APIs. `settings-dropdown-input.tsx` and `model-selector.tsx` now use HeroUI v3 `ComboBox` + `ListBox` patterns, and the model/provider comboboxes must keep their `name` attributes so `FormData` submission still populates settings diffs.
- Tooltip consumers that used the old monolithic `Tooltip` props should prefer the shared `StyledTooltip` wrapper so HeroUI v3 trigger/content typing stays centralized.
- Visual verification artifacts for the migration live under `.pr/issue-44/`; to reproduce the static screenshots, use `npm run build:mock`, serve `build/` (for example with `python -m http.server --directory build`), and navigate client-side before capturing screenshots because a plain static server will not provide SPA deep-link fallbacks.
+- Library i18n is now namespace-scoped under `openhands`: `src/i18n/index.ts` exports `OPENHANDS_I18N_NAMESPACE`, `translationResources`, and `waitForI18n()`, `scripts/make-i18n-translations.cjs` emits `public/locales/<lang>/openhands.json`, standalone `src/entry.client.tsx` explicitly awaits i18n init, and host apps can register bundles via the `@openhands/agent-server-gui/i18n` subpath export.
+
- Route decoupling note: `src/components/` should stay free of direct `react-router` imports. Route state now flows through `src/context/navigation-context.tsx`, the standalone app bridges router state with `src/routes/react-router-navigation-provider.tsx`, and link-like UI should use `src/components/shared/navigation-link.tsx`.
- Test helper note: `test-utils.tsx` now wraps renders with a default `NavigationProvider` (`currentPath: "/"`, `conversationId: "test-conversation-id"`). Navigation-sensitive tests can override that via `renderWithProviders(..., { navigation: { ... } })`.
diff --git a/__tests__/agent-server-ui-providers.test.tsx b/__tests__/agent-server-ui-providers.test.tsx
index 4ae940ddbf..1d05317446 100644
--- a/__tests__/agent-server-ui-providers.test.tsx
+++ b/__tests__/agent-server-ui-providers.test.tsx
@@ -13,6 +13,7 @@ import OptionService from "#/api/option-service/option-service.api";
import {
AgentServerUIProviders,
DEFAULT_AGENT_SERVER_ANALYTICS,
+ OPENHANDS_I18N_NAMESPACE,
getDefaultI18n,
getDefaultQueryClient,
getI18n,
@@ -21,6 +22,7 @@ import {
setI18n,
setQueryClient,
} from "#/index";
+import i18n from "#/i18n";
vi.mock("posthog-js/react", () => ({
PostHogProvider: ({ children }: { children: React.ReactNode }) => children,
@@ -39,7 +41,7 @@ const BaseProbe = ({ translation }: { translation?: string }) => {
</div>
{translation && <div data-testid="translation-value">{translation}</div>}
<div data-testid="imperative-translation-value">
- {getI18n().t("PROVIDER$LABEL")}
+ {i18n.t("PROVIDER$LABEL")}
</div>
</div>
);
@@ -48,7 +50,7 @@ const BaseProbe = ({ translation }: { translation?: string }) => {
const DefaultProbe = () => <BaseProbe />;
const CustomProbe = () => {
- const { t } = useTranslation();
+ const { t } = useTranslation(OPENHANDS_I18N_NAMESPACE);
return <BaseProbe translation={t("PROVIDER$LABEL")} />;
};
@@ -59,12 +61,15 @@ const createTestI18n = async (value: string) => {
await instance.use(initReactI18next).init({
lng: "en",
fallbackLng: "en",
- ns: ["translation"],
- defaultNS: "translation",
+ ns: ["host", OPENHANDS_I18N_NAMESPACE],
+ defaultNS: "host",
interpolation: { escapeValue: false },
resources: {
en: {
- translation: {
+ host: {
+ PROVIDER$LABEL: "Host provider",
+ },
+ [OPENHANDS_I18N_NAMESPACE]: {
PROVIDER$LABEL: value,
},
},
@@ -88,7 +93,7 @@ describe("AgentServerUIProviders", () => {
defaultI18n.addResourceBundle(
"en",
- "translation",
+ OPENHANDS_I18N_NAMESPACE,
{ PROVIDER$LABEL: "Default provider" },
true,
true,
diff --git a/__tests__/i18n/library-namespace.test.ts b/__tests__/i18n/library-namespace.test.ts
new file mode 100644
index 0000000000..8d538b0023
--- /dev/null
+++ b/__tests__/i18n/library-namespace.test.ts
@@ -0,0 +1,55 @@
+import { describe, expect, it, vi } from "vitest";
+
+describe("library i18n namespace scoping", () => {
+ it("exports raw translation resources for host-app registration", async () => {
+ const { OPENHANDS_I18N_NAMESPACE, translationResources } = await import(
+ "../../src/i18n"
+ );
+
+ expect(OPENHANDS_I18N_NAMESPACE).toBe("openhands");
+ expect(translationResources.en).toHaveProperty("ERROR$GENERIC");
+ expect(translationResources.en).not.toHaveProperty(
+ OPENHANDS_I18N_NAMESPACE,
+ );
+ });
+
+ it("configures standalone i18n to load the openhands namespace by default", async () => {
+ const { OPENHANDS_I18N_NAMESPACE, createAgentServerI18n } = await import(
+ "../../src/i18n"
+ );
+
+ const instance = createAgentServerI18n();
+
+ expect(instance.options.defaultNS).toBe(OPENHANDS_I18N_NAMESPACE);
+ expect(instance.options.fallbackNS).toContain(OPENHANDS_I18N_NAMESPACE);
+ expect(instance.options.ns).toContain(OPENHANDS_I18N_NAMESPACE);
+ });
+
+ it("does not initialize the global i18next singleton when importing the library entry", async () => {
+ vi.resetModules();
+
+ const { default: globalI18n } = await import("i18next");
+
+ await globalI18n.init({
+ lng: "en",
+ fallbackLng: "en",
+ ns: ["translation"],
+ defaultNS: "translation",
+ resources: {
+ en: {
+ translation: {
+ HOST_ONLY: "Host only",
+ },
+ },
+ },
+ });
+ globalI18n.removeResourceBundle("en", "openhands");
+
+ expect(globalI18n.hasResourceBundle("en", "openhands")).toBe(false);
+
+ await import("../../src/index");
+
+ expect(globalI18n.hasResourceBundle("en", "openhands")).toBe(false);
+ expect(globalI18n.t("HOST_ONLY")).toBe("Host only");
+ });
+});
diff --git a/__tests__/package-library.test.ts b/__tests__/package-library.test.ts
index b175416215..1e29aa2481 100644
--- a/__tests__/package-library.test.ts
+++ b/__tests__/package-library.test.ts
@@ -40,6 +40,11 @@ describe("package library metadata", () => {
import: "./dist/components/terminal/index.js",
require: "./dist/components/terminal/index.cjs",
},
+ "./i18n": {
+ types: "./dist/i18n/index.d.ts",
+ import: "./dist/i18n/index.js",
+ require: "./dist/i18n/index.cjs",
+ },
});
});
});
diff --git a/package.json b/package.json
index 8a931be14d..77fbf56566 100644
--- a/package.json
+++ b/package.json
@@ -182,6 +182,11 @@
"import": "./dist/components/terminal/index.js",
"require": "./dist/components/terminal/index.cjs"
},
+ "./i18n": {
+ "types": "./dist/i18n/index.d.ts",
+ "import": "./dist/i18n/index.js",
+ "require": "./dist/i18n/index.cjs"
+ },
"./package.json": "./package.json"
},
"peerDependencies": {
diff --git a/scripts/make-i18n-translations.cjs b/scripts/make-i18n-translations.cjs
index 948f2a0198..cefd1c9cb2 100644
--- a/scripts/make-i18n-translations.cjs
+++ b/scripts/make-i18n-translations.cjs
@@ -2,6 +2,8 @@ const fs = require("fs");
const path = require("path");
const i18n = require("../src/i18n/translation.json");
+const namespace = "openhands";
+
// { [lang]: { [key]: content } }
const translationMap = {};
@@ -11,7 +13,7 @@ Object.entries(i18n).forEach(([key, transMap]) => {
translationMap[lang] = {};
}
translationMap[lang][key] = content;
- })
+ });
});
// remove old locales directory
@@ -22,7 +24,10 @@ if (fs.existsSync(localesPath)) {
// write translation files
Object.entries(translationMap).forEach(([lang, transMap]) => {
- const filePath = path.join(__dirname, `../public/locales/${lang}/translation.json`);
+ const filePath = path.join(
+ __dirname,
+ `../public/locales/${lang}/${namespace}.json`,
+ );
if (!fs.existsSync(filePath)) {
fs.mkdirSync(path.dirname(filePath), { recursive: true });
}
@@ -31,12 +36,18 @@ Object.entries(translationMap).forEach(([lang, transMap]) => {
// write translation key enum
const transKeys = Object.keys(translationMap.en);
-const transKeyDeclareFilePath = path.join(__dirname, "../src/i18n/declaration.ts");
+const transKeyDeclareFilePath = path.join(
+ __dirname,
+ "../src/i18n/declaration.ts",
+);
if (!fs.existsSync(transKeyDeclareFilePath)) {
fs.mkdirSync(path.dirname(transKeyDeclareFilePath), { recursive: true });
}
-fs.writeFileSync(transKeyDeclareFilePath, `
+fs.writeFileSync(
+ transKeyDeclareFilePath,
+ `
// this file generate by script, don't modify it manually!!!
export enum I18nKey {
-${transKeys.map(key => ` ${key} = "${key}",`).join('\n')}
-}`.trim() + '\n');
+${transKeys.map((key) => ` ${key} = "${key}",`).join("\n")}
+}`.trim() + "\n",
+);
diff --git a/src/components/features/alerts/alert-banner.tsx b/src/components/features/alerts/alert-banner.tsx
index c3c74b71b2..56f7ef5502 100644
--- a/src/components/features/alerts/alert-banner.tsx
+++ b/src/components/features/alerts/alert-banner.tsx
@@ -21,7 +21,7 @@ export function AlertBanner({
errorMessage,
updatedAt,
}: AlertBannerProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const [dismissedAt, setDismissedAt] = useLocalStorage<string | null>(
"alert_banner_dismissed_at",
null,
diff --git a/src/components/features/analytics/analytics-consent-form-modal.tsx b/src/components/features/analytics/analytics-consent-form-modal.tsx
index cc2f293235..ecea90f83c 100644
--- a/src/components/features/analytics/analytics-consent-form-modal.tsx
+++ b/src/components/features/analytics/analytics-consent-form-modal.tsx
@@ -19,7 +19,7 @@ export function AnalyticsConsentFormModal({
onClose,
}: AnalyticsConsentFormModalProps) {
const posthog = usePostHog();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { mutate: saveUserSettings } = useSaveSettings();
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
diff --git a/src/components/features/browser/browser-snapshot.tsx b/src/components/features/browser/browser-snapshot.tsx
index 1f9e3670bb..07546cf671 100644
--- a/src/components/features/browser/browser-snapshot.tsx
+++ b/src/components/features/browser/browser-snapshot.tsx
@@ -6,7 +6,7 @@ interface BrowserSnaphsotProps {
}
export function BrowserSnapshot({ src }: BrowserSnaphsotProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<img
diff --git a/src/components/features/browser/empty-browser-message.tsx b/src/components/features/browser/empty-browser-message.tsx
index 7a2d0f82df..66d9333e8c 100644
--- a/src/components/features/browser/empty-browser-message.tsx
+++ b/src/components/features/browser/empty-browser-message.tsx
@@ -3,7 +3,7 @@ import { IoIosGlobe } from "react-icons/io";
import { I18nKey } from "#/i18n/declaration";
export function EmptyBrowserMessage() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="flex flex-col items-center justify-center w-full h-full p-10 gap-4">
diff --git a/src/components/features/chat/change-agent-button.tsx b/src/components/features/chat/change-agent-button.tsx
index 70d63abe04..9f4ec3022d 100644
--- a/src/components/features/chat/change-agent-button.tsx
+++ b/src/components/features/chat/change-agent-button.tsx
@@ -28,7 +28,7 @@ export function ChangeAgentButton() {
const { curAgentState } = useAgentState();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const isAgentRunning = curAgentState === AgentState.RUNNING;
diff --git a/src/components/features/chat/change-agent-context-menu.tsx b/src/components/features/chat/change-agent-context-menu.tsx
index 69961deae8..cc6d87783b 100644
--- a/src/components/features/chat/change-agent-context-menu.tsx
+++ b/src/components/features/chat/change-agent-context-menu.tsx
@@ -24,7 +24,7 @@ export function ChangeAgentContextMenu({
onCodeClick,
onPlanClick,
}: ChangeAgentContextMenuProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const menuRef = useClickOutsideElement<HTMLUListElement>(onClose);
const handleCodeClick = (event: React.MouseEvent<HTMLButtonElement>) => {
diff --git a/src/components/features/chat/chat-interface.tsx b/src/components/features/chat/chat-interface.tsx
index a8a038dc26..de329ed175 100644
--- a/src/components/features/chat/chat-interface.tsx
+++ b/src/components/features/chat/chat-interface.tsx
@@ -63,7 +63,7 @@ export function ChatInterface() {
} = useFilteredEvents();
const { setOptimisticUserMessage, getOptimisticUserMessage } =
useOptimisticUserMessageStore();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const scrollRef = React.useRef<HTMLDivElement>(null);
const {
scrollDomToBottom,
diff --git a/src/components/features/chat/chat-suggestions.tsx b/src/components/features/chat/chat-suggestions.tsx
index 1f9a9345ad..75909a8b3b 100644
--- a/src/components/features/chat/chat-suggestions.tsx
+++ b/src/components/features/chat/chat-suggestions.tsx
@@ -11,7 +11,7 @@ interface ChatSuggestionsProps {
}
export function ChatSuggestions({ onSuggestionsClick }: ChatSuggestionsProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { shouldHideSuggestions } = useConversationStore();
return (
diff --git a/src/components/features/chat/components/chat-input-field.tsx b/src/components/features/chat/components/chat-input-field.tsx
index 5c8f23dabd..43310b5c1d 100644
--- a/src/components/features/chat/components/chat-input-field.tsx
+++ b/src/components/features/chat/components/chat-input-field.tsx
@@ -23,7 +23,7 @@ export function ChatInputField({
onFocus,
onBlur,
}: ChatInputFieldProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const conversationMode = useConversationStore(
(state) => state.conversationMode,
diff --git a/src/components/features/chat/components/slash-command-menu.tsx b/src/components/features/chat/components/slash-command-menu.tsx
index 327bfb634b..d2f9a16182 100644
--- a/src/components/features/chat/components/slash-command-menu.tsx
+++ b/src/components/features/chat/components/slash-command-menu.tsx
@@ -126,7 +126,7 @@ export function SlashCommandMenu({
selectedIndex,
onSelect,
}: SlashCommandMenuProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const itemRefs = useRef<(HTMLButtonElement | null)[]>([]);
// Keep refs array in sync with items length
diff --git a/src/components/features/chat/confirmation-mode-enabled.tsx b/src/components/features/chat/confirmation-mode-enabled.tsx
index f413440ea4..baa14c5f8d 100644
--- a/src/components/features/chat/confirmation-mode-enabled.tsx
+++ b/src/components/features/chat/confirmation-mode-enabled.tsx
@@ -5,7 +5,7 @@ import { useSettings } from "#/hooks/query/use-settings";
import { StyledTooltip } from "#/components/shared/buttons/styled-tooltip";
function ConfirmationModeEnabled() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { data: settings } = useSettings();
diff --git a/src/components/features/chat/drag-over.tsx b/src/components/features/chat/drag-over.tsx
index 190e433c74..60695ad2cf 100644
--- a/src/components/features/chat/drag-over.tsx
+++ b/src/components/features/chat/drag-over.tsx
@@ -4,7 +4,7 @@ import ArrowDownCurveIcon from "#/icons/arrow-down-curve.svg?react";
import { I18nKey } from "#/i18n/declaration";
export function DragOver() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="drag-over">
diff --git a/src/components/features/chat/error-message-banner.tsx b/src/components/features/chat/error-message-banner.tsx
index 740053c2d5..e9b7caaa0e 100644
--- a/src/components/features/chat/error-message-banner.tsx
+++ b/src/components/features/chat/error-message-banner.tsx
@@ -16,10 +16,10 @@ export function ErrorMessageBanner({
message,
onDismiss,
}: ErrorMessageBannerProps) {
- const { t, i18n } = useTranslation();
+ const { t, i18n } = useTranslation("openhands");
const [isExpanded, setIsExpanded] = React.useState(false);
- const isI18nKey = i18n.exists(message);
+ const isI18nKey = i18n.exists(message, { ns: "openhands" });
const displayTextForLength = isI18nKey ? String(t(message)) : message;
const shouldShowToggle =
displayTextForLength.length > DEFAULT_MAX_COLLAPSED_CHARS;
@@ -41,6 +41,7 @@ export function ErrorMessageBanner({
>
{isI18nKey ? (
<Trans
+ ns="openhands"
i18nKey={message}
components={{
a: (
diff --git a/src/components/features/chat/error-message.tsx b/src/components/features/chat/error-message.tsx
index da40b3786e..283a9fa523 100644
--- a/src/components/features/chat/error-message.tsx
+++ b/src/components/features/chat/error-message.tsx
@@ -11,7 +11,7 @@ interface ErrorMessageProps {
}
export function ErrorMessage({ errorId, defaultMessage }: ErrorMessageProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const [showDetails, setShowDetails] = React.useState(false);
const hasValidTranslationId = !!errorId && i18n.exists(errorId);
diff --git a/src/components/features/chat/event-content-helpers/get-event-content.tsx b/src/components/features/chat/event-content-helpers/get-event-content.tsx
index da9fa3d3da..faaa076ab5 100644
--- a/src/components/features/chat/event-content-helpers/get-event-content.tsx
+++ b/src/components/features/chat/event-content-helpers/get-event-content.tsx
@@ -34,6 +34,7 @@ export const getEventContent = (
if (i18n.exists(actionKey)) {
title = (
<Trans
+ ns="openhands"
i18nKey={actionKey}
values={{
path: hasPathProperty(event.args) && event.args.path,
@@ -62,6 +63,7 @@ export const getEventContent = (
if (i18n.exists(observationKey)) {
title = (
<Trans
+ ns="openhands"
i18nKey={observationKey}
values={{
path: hasPathProperty(event.extras) && event.extras.path,
diff --git a/src/components/features/chat/expandable-message.tsx b/src/components/features/chat/expandable-message.tsx
index ef087537ed..7299b01f91 100644
--- a/src/components/features/chat/expandable-message.tsx
+++ b/src/components/features/chat/expandable-message.tsx
@@ -36,7 +36,7 @@ export function ExpandableMessage({
action,
}: ExpandableMessageProps) {
const { data: config } = useConfig();
- const { t, i18n } = useTranslation();
+ const { t, i18n } = useTranslation("openhands");
const [showDetails, setShowDetails] = useState(true);
const [details, setDetails] = useState(message);
const [translationId, setTranslationId] = useState<string | undefined>(id);
@@ -49,7 +49,7 @@ export function ExpandableMessage({
useEffect(() => {
// If we have a translation ID, process it
- if (id && i18n.exists(id)) {
+ if (id && i18n.exists(id, { ns: "openhands" })) {
let processedObservation = observation;
let processedAction = action;
@@ -133,8 +133,10 @@ export function ExpandableMessage({
type === "error" ? "text-danger" : "text-neutral-300",
)}
>
- {translationId && i18n.exists(translationId) ? (
+ {translationId &&
+ i18n.exists(translationId, { ns: "openhands" }) ? (
<Trans
+ ns="openhands"
i18nKey={translationId}
values={translationParams}
components={{
diff --git a/src/components/features/chat/git-control-bar-branch-button.tsx b/src/components/features/chat/git-control-bar-branch-button.tsx
index e873da3735..4c843729f2 100644
--- a/src/components/features/chat/git-control-bar-branch-button.tsx
+++ b/src/components/features/chat/git-control-bar-branch-button.tsx
@@ -17,7 +17,7 @@ export function GitControlBarBranchButton({
selectedRepository,
gitProvider,
}: GitControlBarBranchButtonProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { data: settings } = useSettings();
const providerHost = gitProvider
diff --git a/src/components/features/chat/git-control-bar-pr-button.tsx b/src/components/features/chat/git-control-bar-pr-button.tsx
index 3beb7628dd..0ee71b1fe7 100644
--- a/src/components/features/chat/git-control-bar-pr-button.tsx
+++ b/src/components/features/chat/git-control-bar-pr-button.tsx
@@ -19,7 +19,7 @@ export function GitControlBarPrButton({
currentGitProvider,
isConversationReady = true,
}: GitControlBarPrButtonProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { trackCreatePrButtonClick } = useTracking();
const { providers } = useUserProviders();
diff --git a/src/components/features/chat/git-control-bar-pull-button.tsx b/src/components/features/chat/git-control-bar-pull-button.tsx
index d0a1374098..a9a7b8f6c3 100644
--- a/src/components/features/chat/git-control-bar-pull-button.tsx
+++ b/src/components/features/chat/git-control-bar-pull-button.tsx
@@ -15,7 +15,7 @@ export function GitControlBarPullButton({
onSuggestionsClick,
isConversationReady = true,
}: GitControlBarPullButtonProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { trackPullButtonClick } = useTracking();
const { data: conversation } = useActiveConversation();
diff --git a/src/components/features/chat/git-control-bar-push-button.tsx b/src/components/features/chat/git-control-bar-push-button.tsx
index dec4e97bed..cf6caa991e 100644
--- a/src/components/features/chat/git-control-bar-push-button.tsx
+++ b/src/components/features/chat/git-control-bar-push-button.tsx
@@ -19,7 +19,7 @@ export function GitControlBarPushButton({
currentGitProvider,
isConversationReady = true,
}: GitControlBarPushButtonProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { trackPushButtonClick } = useTracking();
const { providers } = useUserProviders();
diff --git a/src/components/features/chat/git-control-bar-repo-button.tsx b/src/components/features/chat/git-control-bar-repo-button.tsx
index fcc2f7fb5f..7e889d22a9 100644
--- a/src/components/features/chat/git-control-bar-repo-button.tsx
+++ b/src/components/features/chat/git-control-bar-repo-button.tsx
@@ -20,7 +20,7 @@ export function GitControlBarRepoButton({
onClick,
disabled,
}: GitControlBarRepoButtonProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { data: settings } = useSettings();
const hasRepository = selectedRepository && gitProvider;
diff --git a/src/components/features/chat/git-control-bar.tsx b/src/components/features/chat/git-control-bar.tsx
index 5ddd1f0fed..10078fd74d 100644
--- a/src/components/features/chat/git-control-bar.tsx
+++ b/src/components/features/chat/git-control-bar.tsx
@@ -25,7 +25,7 @@ interface GitControlBarProps {
}
export function GitControlBar({ onSuggestionsClick }: GitControlBarProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { conversationId } = useConversationId();
const [isOpenRepoModalOpen, setIsOpenRepoModalOpen] = useState(false);
const { addRecentRepository } = useHomeStore();
diff --git a/src/components/features/chat/mcp-observation-content.tsx b/src/components/features/chat/mcp-observation-content.tsx
index 0eef3b2132..92f58ea5ce 100644
--- a/src/components/features/chat/mcp-observation-content.tsx
+++ b/src/components/features/chat/mcp-observation-content.tsx
@@ -9,7 +9,7 @@ interface MCPObservationContentProps {
}
export function MCPObservationContent({ event }: MCPObservationContentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
// Parse the content as JSON if possible
let outputData: unknown;
diff --git a/src/components/features/chat/open-repository-modal.tsx b/src/components/features/chat/open-repository-modal.tsx
index e2806811b7..3a4def718c 100644
--- a/src/components/features/chat/open-repository-modal.tsx
+++ b/src/components/features/chat/open-repository-modal.tsx
@@ -26,7 +26,7 @@ export function OpenRepositoryModal({
onLaunch,
defaultProvider = "github",
}: OpenRepositoryModalProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { providers } = useUserProviders();
const [selectedProvider, setSelectedProvider] = useState<Provider | null>(
diff --git a/src/components/features/chat/plan-preview.tsx b/src/components/features/chat/plan-preview.tsx
index 15111cbcc4..18d38562e1 100644
--- a/src/components/features/chat/plan-preview.tsx
+++ b/src/components/features/chat/plan-preview.tsx
@@ -37,7 +37,7 @@ export function PlanPreview({
isStreaming,
isBuildDisabled,
}: PlanPreviewProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { navigateToTab } = useSelectConversationTab();
const { handleBuildPlanClick } = useHandleBuildPlanClick();
const { scrollDomToBottom } = useScrollContext();
diff --git a/src/components/features/chat/task-tracking/task-item.tsx b/src/components/features/chat/task-tracking/task-item.tsx
index d101884260..9c30800f94 100644
--- a/src/components/features/chat/task-tracking/task-item.tsx
+++ b/src/components/features/chat/task-tracking/task-item.tsx
@@ -17,7 +17,7 @@ interface TaskItemProps {
}
export function TaskItem({ task }: TaskItemProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const icon = useMemo(() => {
switch (task.status) {
diff --git a/src/components/features/chat/task-tracking/task-list-section.tsx b/src/components/features/chat/task-tracking/task-list-section.tsx
index 075517aacd..8dc48ad30c 100644
--- a/src/components/features/chat/task-tracking/task-list-section.tsx
+++ b/src/components/features/chat/task-tracking/task-list-section.tsx
@@ -14,7 +14,7 @@ interface TaskListSectionProps {
}
export function TaskListSection({ taskList }: TaskListSectionProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="flex flex-col overflow-clip bg-[#25272d] border border-[#525252] rounded-[12px] w-full">
diff --git a/src/components/features/chat/waiting-for-runtime-message.tsx b/src/components/features/chat/waiting-for-runtime-message.tsx
index fecd143665..0977fc01b4 100644
--- a/src/components/features/chat/waiting-for-runtime-message.tsx
+++ b/src/components/features/chat/waiting-for-runtime-message.tsx
@@ -10,7 +10,7 @@ export function WaitingForRuntimeMessage({
className,
testId,
}: WaitingForRuntimeMessageProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div
diff --git a/src/components/features/context-menu/context-menu-nav-link.tsx b/src/components/features/context-menu/context-menu-nav-link.tsx
index 4bec0b87b6..32b870f0f0 100644
--- a/src/components/features/context-menu/context-menu-nav-link.tsx
+++ b/src/components/features/context-menu/context-menu-nav-link.tsx
@@ -10,7 +10,7 @@ interface ContextMenuNavLinkProps {
}
export function ContextMenuNavLink({ item, onClick }: ContextMenuNavLinkProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { to, icon, text } = item;
return (
diff --git a/src/components/features/controls/agent-status.tsx b/src/components/features/controls/agent-status.tsx
index 176bffea23..cf02287ae5 100644
--- a/src/components/features/controls/agent-status.tsx
+++ b/src/components/features/controls/agent-status.tsx
@@ -31,7 +31,7 @@ export function AgentStatus({
disabled = false,
isPausing = false,
}: AgentStatusProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { setShouldShownAgentLoading } = useConversationStore();
const { curAgentState, executionStatus } = useAgentState();
diff --git a/src/components/features/controls/git-tools-submenu.tsx b/src/components/features/controls/git-tools-submenu.tsx
index 97db554aba..34002865bd 100644
--- a/src/components/features/controls/git-tools-submenu.tsx
+++ b/src/components/features/controls/git-tools-submenu.tsx
@@ -26,7 +26,7 @@ interface GitToolsSubmenuProps {
}
export function GitToolsSubmenu({ onClose }: GitToolsSubmenuProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { setMessageToSend } = useConversationStore();
const { data: conversation } = useActiveConversation();
diff --git a/src/components/features/controls/macros-submenu.tsx b/src/components/features/controls/macros-submenu.tsx
index b167501d0b..be89ffe313 100644
--- a/src/components/features/controls/macros-submenu.tsx
+++ b/src/components/features/controls/macros-submenu.tsx
@@ -20,7 +20,7 @@ interface MacrosSubmenuProps {
}
export function MacrosSubmenu({ onClose }: MacrosSubmenuProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { setMessageToSend } = useConversationStore();
const onIncreaseTestCoverage = () => {
diff --git a/src/components/features/controls/security-lock.tsx b/src/components/features/controls/security-lock.tsx
index 4bd209d574..1826806371 100644
--- a/src/components/features/controls/security-lock.tsx
+++ b/src/components/features/controls/security-lock.tsx
@@ -5,7 +5,7 @@ import { I18nKey } from "#/i18n/declaration";
import { StyledTooltip } from "#/components/shared/buttons/styled-tooltip";
export function SecurityLock() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<StyledTooltip
diff --git a/src/components/features/controls/server-status-context-menu.tsx b/src/components/features/controls/server-status-context-menu.tsx
index 4ece72b5d4..ae51826097 100644
--- a/src/components/features/controls/server-status-context-menu.tsx
+++ b/src/components/features/controls/server-status-context-menu.tsx
@@ -29,7 +29,7 @@ export function ServerStatusContextMenu({
className = "",
isPausing = false,
}: ServerStatusContextMenuProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const ref = useClickOutsideElement<HTMLUListElement>(onClose);
const shouldActionShown =
diff --git a/src/components/features/controls/server-status.tsx b/src/components/features/controls/server-status.tsx
index e161806da7..da2ba0fa35 100644
--- a/src/components/features/controls/server-status.tsx
+++ b/src/components/features/controls/server-status.tsx
@@ -20,7 +20,7 @@ export function ServerStatus({
}: ServerStatusProps) {
const { curAgentState } = useAgentState();
const { isTask, taskStatus, taskDetail } = useTaskPolling();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { errorMessage } = useErrorMessageStore();
const isStartingStatus =
diff --git a/src/components/features/controls/tools-context-menu.tsx b/src/components/features/controls/tools-context-menu.tsx
index 5726e2f2a5..531ef3ec3d 100644
--- a/src/components/features/controls/tools-context-menu.tsx
+++ b/src/components/features/controls/tools-context-menu.tsx
@@ -41,7 +41,7 @@ export function ToolsContextMenu({
shouldShowAgentTools = true,
shouldShowHooks = false,
}: ToolsContextMenuProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { data: conversation } = useActiveConversation();
const { providers } = useUserProviders();
diff --git a/src/components/features/controls/tools.tsx b/src/components/features/controls/tools.tsx
index 372f3d4f14..c261f20d65 100644
--- a/src/components/features/controls/tools.tsx
+++ b/src/components/features/controls/tools.tsx
@@ -11,7 +11,7 @@ import { SkillsModal } from "../conversation-panel/skills-modal";
import { HooksModal } from "../conversation-panel/hooks-modal";
export function Tools() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { conversationId } = useConversationId();
const { data: conversation } = useActiveConversation();
const [contextMenuOpen, setContextMenuOpen] = React.useState(false);
diff --git a/src/components/features/conversation-panel/budget-display.tsx b/src/components/features/conversation-panel/budget-display.tsx
index 249aeacc51..5b909c3413 100644
--- a/src/components/features/conversation-panel/budget-display.tsx
+++ b/src/components/features/conversation-panel/budget-display.tsx
@@ -10,7 +10,7 @@ interface BudgetDisplayProps {
}
export function BudgetDisplay({ cost, maxBudgetPerTask }: BudgetDisplayProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
// Don't render anything if cost is not available
if (cost === null) {
diff --git a/src/components/features/conversation-panel/budget-usage-text.tsx b/src/components/features/conversation-panel/budget-usage-text.tsx
index 09aa57c7cc..9f23c11795 100644
--- a/src/components/features/conversation-panel/budget-usage-text.tsx
+++ b/src/components/features/conversation-panel/budget-usage-text.tsx
@@ -11,7 +11,7 @@ export function BudgetUsageText({
currentCost,
maxBudget,
}: BudgetUsageTextProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const usagePercentage = (currentCost / maxBudget) * 100;
return (
diff --git a/src/components/features/conversation-panel/confirm-delete-modal.tsx b/src/components/features/conversation-panel/confirm-delete-modal.tsx
index df0af7d7d8..8845b0fb93 100644
--- a/src/components/features/conversation-panel/confirm-delete-modal.tsx
+++ b/src/components/features/conversation-panel/confirm-delete-modal.tsx
@@ -19,10 +19,11 @@ export function ConfirmDeleteModal({
onCancel,
conversationTitle,
}: ConfirmDeleteModalProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const confirmationMessage = conversationTitle ? (
<Trans
+ ns="openhands"
i18nKey={I18nKey.CONVERSATION$DELETE_WARNING_WITH_TITLE}
values={{ title: conversationTitle }}
components={{ title: <span className="text-white" /> }}
diff --git a/src/components/features/conversation-panel/confirm-stop-modal.tsx b/src/components/features/conversation-panel/confirm-stop-modal.tsx
index acf30f4b09..87e8ec5b99 100644
--- a/src/components/features/conversation-panel/confirm-stop-modal.tsx
+++ b/src/components/features/conversation-panel/confirm-stop-modal.tsx
@@ -66,7 +66,7 @@ export function ConfirmStopModal({
onCancel,
sandboxId,
}: ConfirmStopModalProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const {
data: conversations,
isLoading,
diff --git a/src/components/features/conversation-panel/conversation-card/conversation-card-context-menu.tsx b/src/components/features/conversation-panel/conversation-card/conversation-card-context-menu.tsx
index 34ce98b490..e41440e252 100644
--- a/src/components/features/conversation-panel/conversation-card/conversation-card-context-menu.tsx
+++ b/src/components/features/conversation-panel/conversation-card/conversation-card-context-menu.tsx
@@ -43,7 +43,7 @@ export function ConversationCardContextMenu({
onDownloadConversation,
position = "bottom",
}: ConversationCardContextMenuProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const ref = useClickOutsideElement<HTMLUListElement>(onClose);
const generateSection = useCallback(
diff --git a/src/components/features/conversation-panel/conversation-card/conversation-card-footer.tsx b/src/components/features/conversation-panel/conversation-card/conversation-card-footer.tsx
index 2ab5a861fa..e0a1470e87 100644
--- a/src/components/features/conversation-panel/conversation-card/conversation-card-footer.tsx
+++ b/src/components/features/conversation-panel/conversation-card/conversation-card-footer.tsx
@@ -23,7 +23,7 @@ export function ConversationCardFooter({
sandboxStatus,
llmModel,
}: ConversationCardFooterProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const isConversationArchived = sandboxStatus === "MISSING";
diff --git a/src/components/features/conversation-panel/conversation-card/conversation-status-badges.tsx b/src/components/features/conversation-panel/conversation-card/conversation-status-badges.tsx
index c6e5522430..e0bbe71a0f 100644
--- a/src/components/features/conversation-panel/conversation-card/conversation-status-badges.tsx
+++ b/src/components/features/conversation-panel/conversation-card/conversation-status-badges.tsx
@@ -11,7 +11,7 @@ interface ConversationStatusBadgesProps {
export function ConversationStatusBadges({
conversationStatus,
}: ConversationStatusBadgesProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
if (conversationStatus === "ARCHIVED") {
return (
diff --git a/src/components/features/conversation-panel/conversation-card/no-repository.tsx b/src/components/features/conversation-panel/conversation-card/no-repository.tsx
index 1c08e5fb09..be20018de4 100644
--- a/src/components/features/conversation-panel/conversation-card/no-repository.tsx
+++ b/src/components/features/conversation-panel/conversation-card/no-repository.tsx
@@ -3,7 +3,7 @@ import { I18nKey } from "#/i18n/declaration";
import RepoForkedIcon from "#/icons/repo-forked.svg?react";
export function NoRepository() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="flex items-center gap-1 text-xs text-[#A3A3A3]">
diff --git a/src/components/features/conversation-panel/conversation-card/sandbox-status-badges.tsx b/src/components/features/conversation-panel/conversation-card/sandbox-status-badges.tsx
index b68ed4fe0c..5f6a7e6d5b 100644
--- a/src/components/features/conversation-panel/conversation-card/sandbox-status-badges.tsx
+++ b/src/components/features/conversation-panel/conversation-card/sandbox-status-badges.tsx
@@ -10,7 +10,7 @@ interface SandboxStatusBadgesProps {
export function SandboxStatusBadges({
sandboxStatus,
}: SandboxStatusBadgesProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
// Only show badge for MISSING (archived) status
if (sandboxStatus !== "MISSING") {
diff --git a/src/components/features/conversation-panel/conversation-panel.tsx b/src/components/features/conversation-panel/conversation-panel.tsx
index 04692c45f2..a16f338fa5 100644
--- a/src/components/features/conversation-panel/conversation-panel.tsx
+++ b/src/components/features/conversation-panel/conversation-panel.tsx
@@ -25,7 +25,7 @@ interface ConversationPanelProps {
}
export function ConversationPanel({ onClose }: ConversationPanelProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { conversationId: currentConversationId, navigate } = useNavigation();
const ref = useClickOutsideElement<HTMLDivElement>(onClose);
diff --git a/src/components/features/conversation-panel/exit-conversation-modal.tsx b/src/components/features/conversation-panel/exit-conversation-modal.tsx
index 067ab4d18d..8bc6349327 100644
--- a/src/components/features/conversation-panel/exit-conversation-modal.tsx
+++ b/src/components/features/conversation-panel/exit-conversation-modal.tsx
@@ -16,7 +16,7 @@ export function ExitConversationModal({
onClose,
onCancel,
}: ExitConversationModalProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<ModalBackdrop onClose={onCancel}>
diff --git a/src/components/features/conversation-panel/hook-event-item.tsx b/src/components/features/conversation-panel/hook-event-item.tsx
index 7adc7e0c3c..ff5f1f1756 100644
--- a/src/components/features/conversation-panel/hook-event-item.tsx
+++ b/src/components/features/conversation-panel/hook-event-item.tsx
@@ -25,7 +25,7 @@ export function HookEventItem({
isExpanded,
onToggle,
}: HookEventItemProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const i18nKey = EVENT_TYPE_I18N_KEYS[hookEvent.event_type];
const eventTypeLabel = i18nKey ? t(i18nKey) : hookEvent.event_type;
diff --git a/src/components/features/conversation-panel/hook-matcher-content.tsx b/src/components/features/conversation-panel/hook-matcher-content.tsx
index acd288f7ad..fd6dd992d5 100644
--- a/src/components/features/conversation-panel/hook-matcher-content.tsx
+++ b/src/components/features/conversation-panel/hook-matcher-content.tsx
@@ -9,7 +9,7 @@ interface HookMatcherContentProps {
}
export function HookMatcherContent({ matcher }: HookMatcherContentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="mb-4 p-3 bg-gray-800 rounded-md">
diff --git a/src/components/features/conversation-panel/hooks-empty-state.tsx b/src/components/features/conversation-panel/hooks-empty-state.tsx
index 626561b52f..0ca64a0fc8 100644
--- a/src/components/features/conversation-panel/hooks-empty-state.tsx
+++ b/src/components/features/conversation-panel/hooks-empty-state.tsx
@@ -7,7 +7,7 @@ interface HooksEmptyStateProps {
}
export function HooksEmptyState({ isError }: HooksEmptyStateProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="flex items-center justify-center h-full p-4">
diff --git a/src/components/features/conversation-panel/hooks-modal-header.tsx b/src/components/features/conversation-panel/hooks-modal-header.tsx
index ab65fa7386..2c29fa7eed 100644
--- a/src/components/features/conversation-panel/hooks-modal-header.tsx
+++ b/src/components/features/conversation-panel/hooks-modal-header.tsx
@@ -17,7 +17,7 @@ export function HooksModalHeader({
isRefetching,
onRefresh,
}: HooksModalHeaderProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="flex flex-col gap-6 w-full">
diff --git a/src/components/features/conversation-panel/hooks-modal.tsx b/src/components/features/conversation-panel/hooks-modal.tsx
index 6f2677ffb1..a80b069cc6 100644
--- a/src/components/features/conversation-panel/hooks-modal.tsx
+++ b/src/components/features/conversation-panel/hooks-modal.tsx
@@ -17,7 +17,7 @@ interface HooksModalProps {
}
export function HooksModal({ onClose }: HooksModalProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { curAgentState } = useAgentState();
const [expandedEvents, setExpandedEvents] = useState<Record<string, boolean>>(
{},
diff --git a/src/components/features/conversation-panel/skill-content.tsx b/src/components/features/conversation-panel/skill-content.tsx
index 9303047e3a..4043f6fe3d 100644
--- a/src/components/features/conversation-panel/skill-content.tsx
+++ b/src/components/features/conversation-panel/skill-content.tsx
@@ -8,7 +8,7 @@ interface SkillContentProps {
}
export function SkillContent({ content }: SkillContentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="mt-2">
diff --git a/src/components/features/conversation-panel/skill-triggers.tsx b/src/components/features/conversation-panel/skill-triggers.tsx
index f2fa51d3a2..24ec43531b 100644
--- a/src/components/features/conversation-panel/skill-triggers.tsx
+++ b/src/components/features/conversation-panel/skill-triggers.tsx
@@ -7,7 +7,7 @@ interface SkillTriggersProps {
}
export function SkillTriggers({ triggers }: SkillTriggersProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
if (!triggers || triggers.length === 0) {
return null;
diff --git a/src/components/features/conversation-panel/skills-empty-state.tsx b/src/components/features/conversation-panel/skills-empty-state.tsx
index 5a148568a4..d9d0aff5e9 100644
--- a/src/components/features/conversation-panel/skills-empty-state.tsx
+++ b/src/components/features/conversation-panel/skills-empty-state.tsx
@@ -7,7 +7,7 @@ interface SkillsEmptyStateProps {
}
export function SkillsEmptyState({ isError }: SkillsEmptyStateProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="flex items-center justify-center h-full p-4">
diff --git a/src/components/features/conversation-panel/skills-modal-header.tsx b/src/components/features/conversation-panel/skills-modal-header.tsx
index 0a0a93fee4..b5d8393973 100644
--- a/src/components/features/conversation-panel/skills-modal-header.tsx
+++ b/src/components/features/conversation-panel/skills-modal-header.tsx
@@ -17,7 +17,7 @@ export function SkillsModalHeader({
isRefetching,
onRefresh,
}: SkillsModalHeaderProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="flex flex-col gap-6 w-full">
diff --git a/src/components/features/conversation-panel/skills-modal.tsx b/src/components/features/conversation-panel/skills-modal.tsx
index 3836c3e031..f60db596a8 100644
--- a/src/components/features/conversation-panel/skills-modal.tsx
+++ b/src/components/features/conversation-panel/skills-modal.tsx
@@ -17,7 +17,7 @@ interface SkillsModalProps {
}
export function SkillsModal({ onClose }: SkillsModalProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { curAgentState } = useAgentState();
const [expandedAgents, setExpandedAgents] = useState<Record<string, boolean>>(
{},
diff --git a/src/components/features/conversation-panel/start-task-card/start-task-card-footer.tsx b/src/components/features/conversation-panel/start-task-card/start-task-card-footer.tsx
index c5339183d5..3b1f8c3806 100644
--- a/src/components/features/conversation-panel/start-task-card/start-task-card-footer.tsx
+++ b/src/components/features/conversation-panel/start-task-card/start-task-card-footer.tsx
@@ -17,7 +17,7 @@ export function StartTaskCardFooter({
createdAt,
detail,
}: StartTaskCardFooterProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className={cn("flex flex-col gap-1 mt-1")}>
diff --git a/src/components/features/conversation-panel/start-task-card/start-task-card.tsx b/src/components/features/conversation-panel/start-task-card/start-task-card.tsx
index f99050bd6b..68982f93bf 100644
--- a/src/components/features/conversation-panel/start-task-card/start-task-card.tsx
+++ b/src/components/features/conversation-panel/start-task-card/start-task-card.tsx
@@ -11,7 +11,7 @@ interface StartTaskCardProps {
}
export function StartTaskCard({ task, onClick }: StartTaskCardProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const title =
task.request.title ||
task.detail ||
diff --git a/src/components/features/conversation-panel/system-message-modal/empty-tools-state.tsx b/src/components/features/conversation-panel/system-message-modal/empty-tools-state.tsx
index 6ea60711cc..adddc544f8 100644
--- a/src/components/features/conversation-panel/system-message-modal/empty-tools-state.tsx
+++ b/src/components/features/conversation-panel/system-message-modal/empty-tools-state.tsx
@@ -2,7 +2,7 @@ import { useTranslation } from "react-i18next";
import { Typography } from "#/ui/typography";
export function EmptyToolsState() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="flex items-center justify-center h-full p-4">
diff --git a/src/components/features/conversation-panel/system-message-modal/system-message-header.tsx b/src/components/features/conversation-panel/system-message-modal/system-message-header.tsx
index f974f9c055..9199383134 100644
--- a/src/components/features/conversation-panel/system-message-modal/system-message-header.tsx
+++ b/src/components/features/conversation-panel/system-message-modal/system-message-header.tsx
@@ -12,7 +12,7 @@ export function SystemMessageHeader({
agentClass,
openhandsVersion,
}: SystemMessageHeaderProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div
diff --git a/src/components/features/conversation-panel/system-message-modal/tab-navigation.tsx b/src/components/features/conversation-panel/system-message-modal/tab-navigation.tsx
index aa4cd7abb1..85a5f0519f 100644
--- a/src/components/features/conversation-panel/system-message-modal/tab-navigation.tsx
+++ b/src/components/features/conversation-panel/system-message-modal/tab-navigation.tsx
@@ -12,7 +12,7 @@ export function TabNavigation({
onTabChange,
hasTools,
}: TabNavigationProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="flex border-b mb-2" role="tablist">
diff --git a/src/components/features/conversation-panel/system-message-modal/tool-parameters.tsx b/src/components/features/conversation-panel/system-message-modal/tool-parameters.tsx
index a0e0f54bbb..8352e6c3d4 100644
--- a/src/components/features/conversation-panel/system-message-modal/tool-parameters.tsx
+++ b/src/components/features/conversation-panel/system-message-modal/tool-parameters.tsx
@@ -8,7 +8,7 @@ interface ToolParametersProps {
}
export function ToolParameters({ parameters }: ToolParametersProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="mt-2" data-testid="tool-parameters">
diff --git a/src/components/features/conversation/conversation-loading.tsx b/src/components/features/conversation/conversation-loading.tsx
index cae7c2246a..d63efd7bf3 100644
--- a/src/components/features/conversation/conversation-loading.tsx
+++ b/src/components/features/conversation/conversation-loading.tsx
@@ -8,7 +8,7 @@ type ConversationLoadingProps = {
};
export function ConversationLoading({ className }: ConversationLoadingProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div
diff --git a/src/components/features/conversation/conversation-name-context-menu.tsx b/src/components/features/conversation/conversation-name-context-menu.tsx
index b8cf852cfc..6a6cc2d85c 100644
--- a/src/components/features/conversation/conversation-name-context-menu.tsx
+++ b/src/components/features/conversation/conversation-name-context-menu.tsx
@@ -59,7 +59,7 @@ export function ConversationNameContextMenu({
}: ConversationNameContextMenuProps) {
const isMobile = useBreakpoint();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const ref = useClickOutsideElement<HTMLUListElement>(onClose);
const { data: conversation } = useActiveConversation();
const { data: config } = useConfig();
diff --git a/src/components/features/conversation/conversation-name.tsx b/src/components/features/conversation/conversation-name.tsx
index ceadb0a965..606d34e439 100644
--- a/src/components/features/conversation/conversation-name.tsx
+++ b/src/components/features/conversation/conversation-name.tsx
@@ -17,7 +17,7 @@ import { MetricsModal } from "./metrics-modal/metrics-modal";
import CircuitIcon from "#/icons/u-circuit.svg?react";
export function ConversationName() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { conversationId } = useConversationId();
const { data: conversation } = useActiveConversation();
const { mutate: updateConversation } = useUpdateConversation();
diff --git a/src/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.tsx b/src/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.tsx
index fa37243a43..2db612bceb 100644
--- a/src/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.tsx
+++ b/src/components/features/conversation/conversation-tabs/conversation-tab-content/conversation-tab-content.tsx
@@ -52,7 +52,7 @@ const TAB_CONFIG = {
export function ConversationTabContent() {
const { selectedTab, shouldShownAgentLoading } = useConversationStore();
const { conversationId } = useConversationId();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const activeTab = useMemo(
() => TAB_CONFIG[selectedTab ?? "editor"],
diff --git a/src/components/features/conversation/conversation-tabs/conversation-tab-title.tsx b/src/components/features/conversation/conversation-tabs/conversation-tab-title.tsx
index ad3bc98c41..92da927918 100644
--- a/src/components/features/conversation/conversation-tabs/conversation-tab-title.tsx
+++ b/src/components/features/conversation/conversation-tabs/conversation-tab-title.tsx
@@ -19,7 +19,7 @@ export function ConversationTabTitle({
title,
conversationKey,
}: ConversationTabTitleProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { refetch, isFetching } = useUnifiedGetGitChanges();
const { handleBuildPlanClick } = useHandleBuildPlanClick();
const { curAgentState } = useAgentState();
diff --git a/src/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.tsx b/src/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.tsx
index 58ceae666a..3f4b465f3b 100644
--- a/src/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.tsx
+++ b/src/components/features/conversation/conversation-tabs/conversation-tabs-context-menu.tsx
@@ -27,7 +27,7 @@ export function ConversationTabsContextMenu({
onClose,
}: ConversationTabsContextMenuProps) {
const ref = useClickOutsideElement<HTMLUListElement>(onClose);
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { conversationId } = useConversationId();
const { state, setUnpinnedTabs, setRightPanelShown } =
useConversationLocalStorageState(conversationId);
diff --git a/src/components/features/conversation/conversation-tabs/conversation-tabs.tsx b/src/components/features/conversation/conversation-tabs/conversation-tabs.tsx
index 5d3a8526d6..685563241d 100644
--- a/src/components/features/conversation/conversation-tabs/conversation-tabs.tsx
+++ b/src/components/features/conversation/conversation-tabs/conversation-tabs.tsx
@@ -64,7 +64,7 @@ export function ConversationTabs() {
handlePanelVisibilityChange();
}, [isRightPanelShown, selectedTab, onTabChange]);
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const tabs = [
{
diff --git a/src/components/features/conversation/conversation-tabs/vscode-tooltip-content.tsx b/src/components/features/conversation/conversation-tabs/vscode-tooltip-content.tsx
index 08e7879fad..bbb832d56c 100644
--- a/src/components/features/conversation/conversation-tabs/vscode-tooltip-content.tsx
+++ b/src/components/features/conversation/conversation-tabs/vscode-tooltip-content.tsx
@@ -7,7 +7,7 @@ import { RUNTIME_STARTING_STATES } from "#/types/agent-state";
export function VSCodeTooltipContent() {
const { curAgentState } = useAgentState();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { data, refetch } = useUnifiedVSCodeUrl();
const isRuntimeStarting = RUNTIME_STARTING_STATES.includes(curAgentState);
diff --git a/src/components/features/conversation/metrics-modal/context-window-section.tsx b/src/components/features/conversation/metrics-modal/context-window-section.tsx
index 2fbfd1bc2d..2d3845844f 100644
--- a/src/components/features/conversation/metrics-modal/context-window-section.tsx
+++ b/src/components/features/conversation/metrics-modal/context-window-section.tsx
@@ -10,7 +10,7 @@ export function ContextWindowSection({
perTurnToken,
contextWindow,
}: ContextWindowSectionProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const usagePercentage =
contextWindow > 0 ? (perTurnToken / contextWindow) * 100 : 0;
diff --git a/src/components/features/conversation/metrics-modal/cost-section.tsx b/src/components/features/conversation/metrics-modal/cost-section.tsx
index 9ada973354..beb2d33d54 100644
--- a/src/components/features/conversation/metrics-modal/cost-section.tsx
+++ b/src/components/features/conversation/metrics-modal/cost-section.tsx
@@ -8,7 +8,7 @@ interface CostSectionProps {
}
export function CostSection({ cost, maxBudgetPerTask }: CostSectionProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
if (cost === null) {
return null;
diff --git a/src/components/features/conversation/metrics-modal/empty-state.tsx b/src/components/features/conversation/metrics-modal/empty-state.tsx
index d82b2047ba..20edbb894a 100644
--- a/src/components/features/conversation/metrics-modal/empty-state.tsx
+++ b/src/components/features/conversation/metrics-modal/empty-state.tsx
@@ -2,7 +2,7 @@ import { useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
export function EmptyState() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="rounded-md p-4 text-center">
diff --git a/src/components/features/conversation/metrics-modal/metrics-modal.tsx b/src/components/features/conversation/metrics-modal/metrics-modal.tsx
index 850327f58f..08db4a1419 100644
--- a/src/components/features/conversation/metrics-modal/metrics-modal.tsx
+++ b/src/components/features/conversation/metrics-modal/metrics-modal.tsx
@@ -18,7 +18,7 @@ interface MetricsModalProps {
}
export function MetricsModal({ isOpen, onOpenChange }: MetricsModalProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const storeMetrics = useMetricsStore();
const { data: conversation } = useActiveConversation();
diff --git a/src/components/features/conversation/metrics-modal/usage-section.tsx b/src/components/features/conversation/metrics-modal/usage-section.tsx
index efd71d2b29..d10f3e0341 100644
--- a/src/components/features/conversation/metrics-modal/usage-section.tsx
+++ b/src/components/features/conversation/metrics-modal/usage-section.tsx
@@ -12,7 +12,7 @@ interface UsageSectionProps {
}
export function UsageSection({ usage }: UsageSectionProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<>
diff --git a/src/components/features/diff-viewer/empty-changes-message.tsx b/src/components/features/diff-viewer/empty-changes-message.tsx
index 6196d2b324..8706ba19e3 100644
--- a/src/components/features/diff-viewer/empty-changes-message.tsx
+++ b/src/components/features/diff-viewer/empty-changes-message.tsx
@@ -3,7 +3,7 @@ import { FaCodeCompare } from "react-icons/fa6";
import { I18nKey } from "#/i18n/declaration";
export function EmptyChangesMessage() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="flex flex-col items-center justify-center w-full h-full p-10 gap-4">
diff --git a/src/components/features/home/connect-to-provider-message.tsx b/src/components/features/home/connect-to-provider-message.tsx
index a6b6fa2f8c..fa77ecabd1 100644
--- a/src/components/features/home/connect-to-provider-message.tsx
+++ b/src/components/features/home/connect-to-provider-message.tsx
@@ -7,7 +7,7 @@ import { I18nKey } from "#/i18n/declaration";
export function ConnectToProviderMessage() {
const { isLoading } = useSettings();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="flex flex-col gap-4 justify-between h-full">
diff --git a/src/components/features/home/git-repo-dropdown/git-repo-dropdown.tsx b/src/components/features/home/git-repo-dropdown/git-repo-dropdown.tsx
index 570c71ab4e..5d9b4c840b 100644
--- a/src/components/features/home/git-repo-dropdown/git-repo-dropdown.tsx
+++ b/src/components/features/home/git-repo-dropdown/git-repo-dropdown.tsx
@@ -45,7 +45,7 @@ export function GitRepoDropdown({
disabled = false,
onChange,
}: GitRepoDropdownProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { data: config } = useConfig();
const { recentRepositories: storedRecentRepositories } = useHomeStore();
const [inputValue, setInputValue] = useState("");
diff --git a/src/components/features/home/home-header/guide-message.tsx b/src/components/features/home/home-header/guide-message.tsx
index e8001d8aa8..d643048dd7 100644
--- a/src/components/features/home/home-header/guide-message.tsx
+++ b/src/components/features/home/home-header/guide-message.tsx
@@ -1,7 +1,7 @@
import { useTranslation } from "react-i18next";
export function GuideMessage() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="w-fit flex flex-col md:flex-row items-start md:items-center justify-center gap-1 rounded-[12px] bg-[#454545] leading-5 text-white text-[15px] font-normal m-1 md:h-9.5 px-4 pb-1 md:px-[15px] md:py-0">
diff --git a/src/components/features/home/home-header/home-header-title.tsx b/src/components/features/home/home-header/home-header-title.tsx
index c95ca97de1..c5240d72b7 100644
--- a/src/components/features/home/home-header/home-header-title.tsx
+++ b/src/components/features/home/home-header/home-header-title.tsx
@@ -2,7 +2,7 @@ import { useTranslation } from "react-i18next";
import { Typography } from "#/ui/typography";
export function HomeHeaderTitle() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="h-[80px] flex items-center">
diff --git a/src/components/features/home/homepage-cta.tsx b/src/components/features/home/homepage-cta.tsx
index e1438507be..66499c94ef 100644
--- a/src/components/features/home/homepage-cta.tsx
+++ b/src/components/features/home/homepage-cta.tsx
@@ -14,7 +14,7 @@ interface HomepageCTAProps {
}
export function HomepageCTA({ setShouldShowCTA }: HomepageCTAProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { trackSaasSelfhostedInquiry } = useTracking();
const handleClose = () => {
diff --git a/src/components/features/home/new-conversation.tsx b/src/components/features/home/new-conversation.tsx
index c0a6d2d8de..3673d9d6e5 100644
--- a/src/components/features/home/new-conversation.tsx
+++ b/src/components/features/home/new-conversation.tsx
@@ -7,7 +7,7 @@ import { useIsCreatingConversation } from "#/hooks/use-is-creating-conversation"
import PlusIcon from "#/icons/u-plus.svg?react";
export function NewConversation() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { navigate } = useNavigation();
const {
diff --git a/src/components/features/home/new-conversation/create-conversation-button.tsx b/src/components/features/home/new-conversation/create-conversation-button.tsx
index 79fa56e7f0..e417a90e27 100644
--- a/src/components/features/home/new-conversation/create-conversation-button.tsx
+++ b/src/components/features/home/new-conversation/create-conversation-button.tsx
@@ -5,7 +5,7 @@ import { useCreateConversation } from "#/hooks/mutation/use-create-conversation"
import { useIsCreatingConversation } from "#/hooks/use-is-creating-conversation";
export function CreateConversationButton() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { navigate } = useNavigation();
const {
diff --git a/src/components/features/home/new-conversation/new-conversation.tsx b/src/components/features/home/new-conversation/new-conversation.tsx
index 75263f0687..0b511d7d5d 100644
--- a/src/components/features/home/new-conversation/new-conversation.tsx
+++ b/src/components/features/home/new-conversation/new-conversation.tsx
@@ -7,7 +7,7 @@ import { CreateConversationButton } from "./create-conversation-button";
import { Card } from "#/ui/card";
export function NewConversation() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<Card className="flex-col p-5 gap-2.5 min-h-[286px] md:min-h-auto w-full">
diff --git a/src/components/features/home/recent-conversations/conversation-status-indicator.tsx b/src/components/features/home/recent-conversations/conversation-status-indicator.tsx
index aa4f0e9bb1..89ad878df4 100644
--- a/src/components/features/home/recent-conversations/conversation-status-indicator.tsx
+++ b/src/components/features/home/recent-conversations/conversation-status-indicator.tsx
@@ -12,7 +12,7 @@ interface ConversationStatusIndicatorProps {
export function ConversationStatusIndicator({
conversationStatus,
}: ConversationStatusIndicatorProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const conversationStatusBackgroundColor = useMemo(() => {
switch (conversationStatus) {
diff --git a/src/components/features/home/recent-conversations/recent-conversation.tsx b/src/components/features/home/recent-conversations/recent-conversation.tsx
index 6b0a740e2e..b8ea7e6cbd 100644
--- a/src/components/features/home/recent-conversations/recent-conversation.tsx
+++ b/src/components/features/home/recent-conversations/recent-conversation.tsx
@@ -15,7 +15,7 @@ interface RecentConversationProps {
}
export function RecentConversation({ conversation }: RecentConversationProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const hasRepository =
conversation.selected_repository && conversation.selected_branch;
diff --git a/src/components/features/home/recent-conversations/recent-conversations.tsx b/src/components/features/home/recent-conversations/recent-conversations.tsx
index 2b862cf5cb..93277ffc68 100644
--- a/src/components/features/home/recent-conversations/recent-conversations.tsx
+++ b/src/components/features/home/recent-conversations/recent-conversations.tsx
@@ -8,7 +8,7 @@ import { useInfiniteScroll } from "#/hooks/use-infinite-scroll";
import { cn } from "#/utils/utils";
export function RecentConversations() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const [isExpanded, setIsExpanded] = useState(false);
const {
diff --git a/src/components/features/home/recent-conversations/sandbox-status-indicator.tsx b/src/components/features/home/recent-conversations/sandbox-status-indicator.tsx
index 76235da2cc..8f0029ced5 100644
--- a/src/components/features/home/recent-conversations/sandbox-status-indicator.tsx
+++ b/src/components/features/home/recent-conversations/sandbox-status-indicator.tsx
@@ -27,7 +27,7 @@ const getSandboxStatusLabel = (status: V1SandboxStatus): string => {
export function SandboxStatusIndicator({
sandboxStatus,
}: SandboxStatusIndicatorProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const sandboxStatusBackgroundColor = useMemo(() => {
switch (sandboxStatus) {
diff --git a/src/components/features/home/repo-selection-form.tsx b/src/components/features/home/repo-selection-form.tsx
index 39d469e99f..f476533dbd 100644
--- a/src/components/features/home/repo-selection-form.tsx
+++ b/src/components/features/home/repo-selection-form.tsx
@@ -48,7 +48,7 @@ export function RepositorySelectionForm({
const isCreatingConversationElsewhere = useIsCreatingConversation();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
// Auto-select provider logic
React.useEffect(() => {
diff --git a/src/components/features/home/repository-selection/branch-dropdown.tsx b/src/components/features/home/repository-selection/branch-dropdown.tsx
index bcfacb85e0..cd30f702a4 100644
--- a/src/components/features/home/repository-selection/branch-dropdown.tsx
+++ b/src/components/features/home/repository-selection/branch-dropdown.tsx
@@ -23,7 +23,7 @@ export function BranchDropdown({
wrapperClassName,
label,
}: BranchDropdownProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<SettingsDropdownInput
diff --git a/src/components/features/home/repository-selection/branch-error-state.tsx b/src/components/features/home/repository-selection/branch-error-state.tsx
index e198860d75..96ba4164ba 100644
--- a/src/components/features/home/repository-selection/branch-error-state.tsx
+++ b/src/components/features/home/repository-selection/branch-error-state.tsx
@@ -6,7 +6,7 @@ interface BranchErrorStateProps {
}
export function BranchErrorState({ wrapperClassName }: BranchErrorStateProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div
data-testid="branch-dropdown-error"
diff --git a/src/components/features/home/repository-selection/branch-loading-state.tsx b/src/components/features/home/repository-selection/branch-loading-state.tsx
index 1ae9fe0991..24b2cc29e9 100644
--- a/src/components/features/home/repository-selection/branch-loading-state.tsx
+++ b/src/components/features/home/repository-selection/branch-loading-state.tsx
@@ -9,7 +9,7 @@ interface BranchLoadingStateProps {
export function BranchLoadingState({
wrapperClassName,
}: BranchLoadingStateProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div
data-testid="branch-dropdown-loading"
diff --git a/src/components/features/home/repository-selection/git-provider-dropdown.tsx b/src/components/features/home/repository-selection/git-provider-dropdown.tsx
index 1b821187fa..5f5d41624f 100644
--- a/src/components/features/home/repository-selection/git-provider-dropdown.tsx
+++ b/src/components/features/home/repository-selection/git-provider-dropdown.tsx
@@ -31,7 +31,7 @@ export function GitProviderDropdown({
isClearable,
isDisabled,
}: GitProviderDropdownProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<SettingsDropdownInput
diff --git a/src/components/features/home/repository-selection/repository-dropdown.tsx b/src/components/features/home/repository-selection/repository-dropdown.tsx
index 9cc64259b6..0d5d7510e0 100644
--- a/src/components/features/home/repository-selection/repository-dropdown.tsx
+++ b/src/components/features/home/repository-selection/repository-dropdown.tsx
@@ -23,7 +23,7 @@ export function RepositoryDropdown({
defaultSelectedKey,
selectedKey,
}: RepositoryDropdownProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<SettingsDropdownInput
diff --git a/src/components/features/home/repository-selection/repository-error-state.tsx b/src/components/features/home/repository-selection/repository-error-state.tsx
index ba79297b29..f6b9e294a1 100644
--- a/src/components/features/home/repository-selection/repository-error-state.tsx
+++ b/src/components/features/home/repository-selection/repository-error-state.tsx
@@ -8,7 +8,7 @@ export interface RepositoryErrorStateProps {
export function RepositoryErrorState({
wrapperClassName,
}: RepositoryErrorStateProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div
data-testid="repo-dropdown-error"
diff --git a/src/components/features/home/repository-selection/repository-loading-state.tsx b/src/components/features/home/repository-selection/repository-loading-state.tsx
index 579077d96e..4e1069d5be 100644
--- a/src/components/features/home/repository-selection/repository-loading-state.tsx
+++ b/src/components/features/home/repository-selection/repository-loading-state.tsx
@@ -9,7 +9,7 @@ export interface RepositoryLoadingStateProps {
export function RepositoryLoadingState({
wrapperClassName,
}: RepositoryLoadingStateProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div
data-testid="repo-dropdown-loading"
diff --git a/src/components/features/home/tasks/task-card.tsx b/src/components/features/home/tasks/task-card.tsx
index ae713773e2..37d257fe72 100644
--- a/src/components/features/home/tasks/task-card.tsx
+++ b/src/components/features/home/tasks/task-card.tsx
@@ -24,7 +24,7 @@ export function TaskCard({ task }: TaskCardProps) {
const { setOptimisticUserMessage } = useOptimisticUserMessageStore();
const { mutate: createConversation } = useCreateConversation();
const isCreatingConversation = useIsCreatingConversation();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { navigate } = useNavigation();
const handleLaunchConversation = () => {
diff --git a/src/components/features/home/tasks/task-suggestions.tsx b/src/components/features/home/tasks/task-suggestions.tsx
index a2992ab622..aa0465df00 100644
--- a/src/components/features/home/tasks/task-suggestions.tsx
+++ b/src/components/features/home/tasks/task-suggestions.tsx
@@ -16,7 +16,7 @@ interface TaskSuggestionsProps {
}
export function TaskSuggestions({ filterFor }: TaskSuggestionsProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const [isExpanded, setIsExpanded] = useState(false);
const { data: config } = useConfig();
diff --git a/src/components/features/launch/plugin-launch-modal.tsx b/src/components/features/launch/plugin-launch-modal.tsx
index 80b1c889cc..6294e42003 100644
--- a/src/components/features/launch/plugin-launch-modal.tsx
+++ b/src/components/features/launch/plugin-launch-modal.tsx
@@ -28,7 +28,7 @@ export function PluginLaunchModal({
onStartConversation,
onClose,
}: PluginLaunchModalProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const [pluginConfigs, setPluginConfigs] =
React.useState<PluginSpec[]>(plugins);
const [expandedSections, setExpandedSections] = React.useState<ExpandedState>(
diff --git a/src/components/features/launch/plugin-launch-plugin-section.tsx b/src/components/features/launch/plugin-launch-plugin-section.tsx
index b0b83d67f6..c03694a58d 100644
--- a/src/components/features/launch/plugin-launch-plugin-section.tsx
+++ b/src/components/features/launch/plugin-launch-plugin-section.tsx
@@ -26,7 +26,7 @@ export function PluginLaunchPluginSection({
getPluginDisplayName,
onParameterChange,
}: PluginLaunchPluginSectionProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const hasParams =
plugin.parameters && Object.keys(plugin.parameters).length > 0;
diff --git a/src/components/features/settings/agent-server-onboarding.tsx b/src/components/features/settings/agent-server-onboarding.tsx
index 4331e55794..99983d1b1b 100644
--- a/src/components/features/settings/agent-server-onboarding.tsx
+++ b/src/components/features/settings/agent-server-onboarding.tsx
@@ -31,7 +31,7 @@ export function AgentServerConnectionForm({
variant = "onboarding",
showSectionHeader,
}: AgentServerConnectionFormProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const defaults = React.useMemo(() => getAgentServerFormDefaults(), []);
const [baseUrl, setBaseUrl] = React.useState(defaults.baseUrl);
const [sessionApiKey, setSessionApiKey] = React.useState(
@@ -138,7 +138,7 @@ export function AgentServerChecklist({
className,
variant = "connect",
}: AgentServerChecklistProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const steps =
variant === "upgrade"
diff --git a/src/components/features/settings/app-settings/language-input.tsx b/src/components/features/settings/app-settings/language-input.tsx
index 4e41c71f62..06cfb134dc 100644
--- a/src/components/features/settings/app-settings/language-input.tsx
+++ b/src/components/features/settings/app-settings/language-input.tsx
@@ -14,7 +14,7 @@ export function LanguageInput({
onChange,
name,
}: LanguageInputProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<SettingsDropdownInput
diff --git a/src/components/features/settings/git-settings/azure-devops-token-help-anchor.tsx b/src/components/features/settings/git-settings/azure-devops-token-help-anchor.tsx
index b48ccf88b0..edee1335ea 100644
--- a/src/components/features/settings/git-settings/azure-devops-token-help-anchor.tsx
+++ b/src/components/features/settings/git-settings/azure-devops-token-help-anchor.tsx
@@ -2,7 +2,7 @@ import { useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
export function AzureDevOpsTokenHelpAnchor() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<p data-testid="azure-devops-token-help-anchor" className="text-xs">
diff --git a/src/components/features/settings/git-settings/azure-devops-token-input.tsx b/src/components/features/settings/git-settings/azure-devops-token-input.tsx
index 5f8d34094a..df451e7854 100644
--- a/src/components/features/settings/git-settings/azure-devops-token-input.tsx
+++ b/src/components/features/settings/git-settings/azure-devops-token-input.tsx
@@ -19,7 +19,7 @@ export function AzureDevOpsTokenInput({
name,
azureDevOpsHostSet,
}: AzureDevOpsTokenInputProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="flex flex-col gap-6">
diff --git a/src/components/features/settings/git-settings/bitbucket-dc-token-help-anchor.tsx b/src/components/features/settings/git-settings/bitbucket-dc-token-help-anchor.tsx
index 1d74b94b58..46935f9d71 100644
--- a/src/components/features/settings/git-settings/bitbucket-dc-token-help-anchor.tsx
+++ b/src/components/features/settings/git-settings/bitbucket-dc-token-help-anchor.tsx
@@ -2,7 +2,7 @@ import { Trans, useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
export function BitbucketDCTokenHelpAnchor() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<p
@@ -10,6 +10,7 @@ export function BitbucketDCTokenHelpAnchor() {
className="text-xs max-w-[680px]"
>
<Trans
+ ns="openhands"
i18nKey={I18nKey.BITBUCKET_DATA_CENTER$TOKEN_HELP_TEXT}
components={[
<a
diff --git a/src/components/features/settings/git-settings/bitbucket-dc-token-help-input.tsx b/src/components/features/settings/git-settings/bitbucket-dc-token-help-input.tsx
index 3cb87c1b2f..c0043bd494 100644
--- a/src/components/features/settings/git-settings/bitbucket-dc-token-help-input.tsx
+++ b/src/components/features/settings/git-settings/bitbucket-dc-token-help-input.tsx
@@ -22,7 +22,7 @@ export function BitbucketDCTokenInput({
bitbucketDCHostSet,
className,
}: BitbucketDCTokenInputProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className={cn("flex flex-col gap-6", className)}>
diff --git a/src/components/features/settings/git-settings/bitbucket-token-help-anchor.tsx b/src/components/features/settings/git-settings/bitbucket-token-help-anchor.tsx
index 2e2d83351a..9c70f3874d 100644
--- a/src/components/features/settings/git-settings/bitbucket-token-help-anchor.tsx
+++ b/src/components/features/settings/git-settings/bitbucket-token-help-anchor.tsx
@@ -2,11 +2,12 @@ import { Trans, useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
export function BitbucketTokenHelpAnchor() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<p data-testid="bitbucket-token-help-anchor" className="text-xs">
<Trans
+ ns="openhands"
i18nKey={I18nKey.BITBUCKET$TOKEN_HELP_TEXT}
components={[
<a
diff --git a/src/components/features/settings/git-settings/bitbucket-token-input.tsx b/src/components/features/settings/git-settings/bitbucket-token-input.tsx
index f205ba2ded..121022fe3a 100644
--- a/src/components/features/settings/git-settings/bitbucket-token-input.tsx
+++ b/src/components/features/settings/git-settings/bitbucket-token-input.tsx
@@ -22,7 +22,7 @@ export function BitbucketTokenInput({
bitbucketHostSet,
className,
}: BitbucketTokenInputProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className={cn("flex flex-col gap-6", className)}>
diff --git a/src/components/features/settings/git-settings/configure-azure-devops-anchor.tsx b/src/components/features/settings/git-settings/configure-azure-devops-anchor.tsx
index d487e0c21d..4bdb41c332 100644
--- a/src/components/features/settings/git-settings/configure-azure-devops-anchor.tsx
+++ b/src/components/features/settings/git-settings/configure-azure-devops-anchor.tsx
@@ -5,7 +5,7 @@ import { useAuthUrl } from "#/hooks/use-auth-url";
import { BrandButton } from "../brand-button";
export function ConfigureAzureDevOpsAnchor() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { data: config } = useConfig();
const authUrl = useAuthUrl({
diff --git a/src/components/features/settings/git-settings/configure-github-repositories-anchor.tsx b/src/components/features/settings/git-settings/configure-github-repositories-anchor.tsx
index 161db78013..14e0b383c2 100644
--- a/src/components/features/settings/git-settings/configure-github-repositories-anchor.tsx
+++ b/src/components/features/settings/git-settings/configure-github-repositories-anchor.tsx
@@ -9,7 +9,7 @@ interface ConfigureGitHubRepositoriesAnchorProps {
export function ConfigureGitHubRepositoriesAnchor({
slug,
}: ConfigureGitHubRepositoriesAnchorProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div data-testid="configure-github-repositories-button" className="py-9">
diff --git a/src/components/features/settings/git-settings/forgejo-token-input.tsx b/src/components/features/settings/git-settings/forgejo-token-input.tsx
index c85fd93c1f..d9df2059dd 100644
--- a/src/components/features/settings/git-settings/forgejo-token-input.tsx
+++ b/src/components/features/settings/git-settings/forgejo-token-input.tsx
@@ -21,7 +21,7 @@ export function ForgejoTokenInput({
forgejoHostSet,
className,
}: ForgejoTokenInputProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className={cn("flex flex-col gap-6", className)}>
diff --git a/src/components/features/settings/git-settings/github-token-help-anchor.tsx b/src/components/features/settings/git-settings/github-token-help-anchor.tsx
index 1f9f1f1cce..3566cd32a0 100644
--- a/src/components/features/settings/git-settings/github-token-help-anchor.tsx
+++ b/src/components/features/settings/git-settings/github-token-help-anchor.tsx
@@ -2,11 +2,12 @@ import { Trans, useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
export function GitHubTokenHelpAnchor() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<p data-testid="github-token-help-anchor" className="text-xs">
<Trans
+ ns="openhands"
i18nKey={I18nKey.GITHUB$TOKEN_HELP_TEXT}
components={[
<a
diff --git a/src/components/features/settings/git-settings/github-token-input.tsx b/src/components/features/settings/git-settings/github-token-input.tsx
index 805c60ebd3..d6d0fa3b1b 100644
--- a/src/components/features/settings/git-settings/github-token-input.tsx
+++ b/src/components/features/settings/git-settings/github-token-input.tsx
@@ -22,7 +22,7 @@ export function GitHubTokenInput({
githubHostSet,
className,
}: GitHubTokenInputProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className={cn("flex flex-col gap-6", className)}>
diff --git a/src/components/features/settings/git-settings/gitlab-token-help-anchor.tsx b/src/components/features/settings/git-settings/gitlab-token-help-anchor.tsx
index 966860bb42..a871d8ee30 100644
--- a/src/components/features/settings/git-settings/gitlab-token-help-anchor.tsx
+++ b/src/components/features/settings/git-settings/gitlab-token-help-anchor.tsx
@@ -2,11 +2,12 @@ import { Trans, useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
export function GitLabTokenHelpAnchor() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<p data-testid="gitlab-token-help-anchor" className="text-xs">
<Trans
+ ns="openhands"
i18nKey={I18nKey.GITLAB$TOKEN_HELP_TEXT}
components={[
<a
diff --git a/src/components/features/settings/git-settings/gitlab-token-input.tsx b/src/components/features/settings/git-settings/gitlab-token-input.tsx
index 18fbb4eded..cd9ce6c256 100644
--- a/src/components/features/settings/git-settings/gitlab-token-input.tsx
+++ b/src/components/features/settings/git-settings/gitlab-token-input.tsx
@@ -22,7 +22,7 @@ export function GitLabTokenInput({
gitlabHostSet,
className,
}: GitLabTokenInputProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className={cn("flex flex-col gap-6", className)}>
diff --git a/src/components/features/settings/git-settings/install-slack-app-anchor.tsx b/src/components/features/settings/git-settings/install-slack-app-anchor.tsx
index 2e1ab30400..2edc452b9b 100644
--- a/src/components/features/settings/git-settings/install-slack-app-anchor.tsx
+++ b/src/components/features/settings/git-settings/install-slack-app-anchor.tsx
@@ -3,7 +3,7 @@ import { I18nKey } from "#/i18n/declaration";
import { BrandButton } from "../brand-button";
export function InstallSlackAppAnchor() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div data-testid="install-slack-app-button" className="py-9">
diff --git a/src/components/features/settings/git-settings/webhook-status-badge.tsx b/src/components/features/settings/git-settings/webhook-status-badge.tsx
index 7855408d71..159a0c6275 100644
--- a/src/components/features/settings/git-settings/webhook-status-badge.tsx
+++ b/src/components/features/settings/git-settings/webhook-status-badge.tsx
@@ -11,7 +11,7 @@ export function WebhookStatusBadge({
webhookInstalled,
installationResult,
}: WebhookStatusBadgeProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
if (installationResult) {
if (installationResult.success) {
diff --git a/src/components/features/settings/mcp-settings/mcp-server-form.tsx b/src/components/features/settings/mcp-settings/mcp-server-form.tsx
index 2e6367896a..6836fb97ba 100644
--- a/src/components/features/settings/mcp-settings/mcp-server-form.tsx
+++ b/src/components/features/settings/mcp-settings/mcp-server-form.tsx
@@ -36,7 +36,7 @@ export function MCPServerForm({
onSubmit,
onCancel,
}: MCPServerFormProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const [serverType, setServerType] = React.useState<MCPServerType>(
server?.type || "sse",
);
diff --git a/src/components/features/settings/mcp-settings/mcp-server-list-item.tsx b/src/components/features/settings/mcp-settings/mcp-server-list-item.tsx
index d86e835129..b0a0d4afe9 100644
--- a/src/components/features/settings/mcp-settings/mcp-server-list-item.tsx
+++ b/src/components/features/settings/mcp-settings/mcp-server-list-item.tsx
@@ -23,7 +23,7 @@ export function MCPServerListItem({
onEdit: () => void;
onDelete: () => void;
}) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const getServerTypeLabel = (type: string) => {
switch (type) {
diff --git a/src/components/features/settings/mcp-settings/mcp-server-list.tsx b/src/components/features/settings/mcp-settings/mcp-server-list.tsx
index 85ce5747d4..40e13a3a72 100644
--- a/src/components/features/settings/mcp-settings/mcp-server-list.tsx
+++ b/src/components/features/settings/mcp-settings/mcp-server-list.tsx
@@ -25,7 +25,7 @@ export function MCPServerList({
onEdit,
onDelete,
}: MCPServerListProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
if (servers.length === 0) {
return (
diff --git a/src/components/features/settings/mobile-header.tsx b/src/components/features/settings/mobile-header.tsx
index fbcc412deb..98628067e2 100644
--- a/src/components/features/settings/mobile-header.tsx
+++ b/src/components/features/settings/mobile-header.tsx
@@ -12,7 +12,7 @@ export function MobileHeader({
isMobileMenuOpen,
onToggleMenu,
}: MobileHeaderProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="flex items-center justify-between mb-4 md:hidden">
diff --git a/src/components/features/settings/new-api-key-modal.tsx b/src/components/features/settings/new-api-key-modal.tsx
index 2457f6a46e..d3e527a6ff 100644
--- a/src/components/features/settings/new-api-key-modal.tsx
+++ b/src/components/features/settings/new-api-key-modal.tsx
@@ -17,7 +17,7 @@ export function NewApiKeyModal({
newlyCreatedKey,
onClose,
}: NewApiKeyModalProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const handleCopyToClipboard = () => {
if (newlyCreatedKey) {
diff --git a/src/components/features/settings/optional-tag.tsx b/src/components/features/settings/optional-tag.tsx
index 643a87e2b8..5534f1d0ed 100644
--- a/src/components/features/settings/optional-tag.tsx
+++ b/src/components/features/settings/optional-tag.tsx
@@ -2,7 +2,7 @@ import { useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
export function OptionalTag() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<span className="text-xs text-tertiary-alt">
{t(I18nKey.COMMON$OPTIONAL)}
diff --git a/src/components/features/settings/org-defaults-banner.tsx b/src/components/features/settings/org-defaults-banner.tsx
index ccf9c35796..b79f3e532c 100644
--- a/src/components/features/settings/org-defaults-banner.tsx
+++ b/src/components/features/settings/org-defaults-banner.tsx
@@ -2,7 +2,7 @@ import { useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
export function OrgDefaultsBanner() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="flex flex-col gap-3">
diff --git a/src/components/features/settings/org-wide-settings-badge.tsx b/src/components/features/settings/org-wide-settings-badge.tsx
index 17b7545bc4..0bbca00236 100644
--- a/src/components/features/settings/org-wide-settings-badge.tsx
+++ b/src/components/features/settings/org-wide-settings-badge.tsx
@@ -12,7 +12,7 @@ interface OrgWideSettingsBadgeProps {
export function OrgWideSettingsBadge({
variant = "org-wide",
}: OrgWideSettingsBadgeProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const i18nKey =
variant === "managed-by-admin"
diff --git a/src/components/features/settings/pro-pill.tsx b/src/components/features/settings/pro-pill.tsx
index 6cb26c3009..500e342a15 100644
--- a/src/components/features/settings/pro-pill.tsx
+++ b/src/components/features/settings/pro-pill.tsx
@@ -7,7 +7,7 @@ interface ProPillProps {
}
export function ProPill({ className }: ProPillProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<span
diff --git a/src/components/features/settings/project-management/configure-modal.tsx b/src/components/features/settings/project-management/configure-modal.tsx
index 15606922fc..f4a99ad39b 100644
--- a/src/components/features/settings/project-management/configure-modal.tsx
+++ b/src/components/features/settings/project-management/configure-modal.tsx
@@ -25,7 +25,7 @@ export function ConfigureButton({
text,
"data-testid": dataTestId,
}: ConfigureButtonProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<BrandButton
data-testid={dataTestId}
@@ -77,7 +77,7 @@ export function ConfigureModal({
platform,
integrationData,
}: ConfigureModalProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const [workspace, setWorkspace] = useState("");
const [webhookSecret, setWebhookSecret] = useState("");
const [serviceAccountEmail, setServiceAccountEmail] = useState("");
@@ -279,6 +279,7 @@ export function ConfigureModal({
<BaseModalDescription>
{showConfigurationFields ? (
<Trans
+ ns="openhands"
i18nKey={
I18nKey.PROJECT_MANAGEMENT$CONFIGURE_MODAL_DESCRIPTION_STAGE_2
}
@@ -298,6 +299,7 @@ export function ConfigureModal({
/>
) : (
<Trans
+ ns="openhands"
i18nKey={
I18nKey.PROJECT_MANAGEMENT$CONFIGURE_MODAL_DESCRIPTION_STAGE_1
}
diff --git a/src/components/features/settings/project-management/integration-row.tsx b/src/components/features/settings/project-management/integration-row.tsx
index 1fd3d8dc61..5060a9d004 100644
--- a/src/components/features/settings/project-management/integration-row.tsx
+++ b/src/components/features/settings/project-management/integration-row.tsx
@@ -23,7 +23,7 @@ export function IntegrationRow({
"data-testid": dataTestId,
}: IntegrationRowProps) {
const [isConfigureModalOpen, setConfigureModalOpen] = React.useState(false);
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { data: integrationData, isLoading: isStatusLoading } =
useIntegrationStatus(platform);
diff --git a/src/components/features/settings/project-management/project-management-integration.tsx b/src/components/features/settings/project-management/project-management-integration.tsx
index 0ae49ce0de..d05bdbf1ea 100644
--- a/src/components/features/settings/project-management/project-management-integration.tsx
+++ b/src/components/features/settings/project-management/project-management-integration.tsx
@@ -5,7 +5,7 @@ import { IntegrationRow } from "./integration-row";
import { useConfig } from "#/hooks/query/use-config";
export function ProjectManagementIntegration() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { data: config } = useConfig();
return (
diff --git a/src/components/features/settings/sdk-settings/schema-field.tsx b/src/components/features/settings/sdk-settings/schema-field.tsx
index e0f32299aa..52d39a3f82 100644
--- a/src/components/features/settings/sdk-settings/schema-field.tsx
+++ b/src/components/features/settings/sdk-settings/schema-field.tsx
@@ -31,7 +31,7 @@ export const FIELD_HELP_LINKS: Record<
};
function FieldHelp({ field }: { field: SettingsFieldSchema }) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const helpLink = FIELD_HELP_LINKS[field.key];
const description = resolveSchemaFieldDescription(
t,
@@ -102,7 +102,7 @@ export function SchemaField({
isDisabled: boolean;
onChange: (value: string | boolean) => void;
}) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const label = resolveSchemaFieldLabel(t, field.key, field.label);
const constraints = getSettingsFieldConstraints(field.key);
diff --git a/src/components/features/settings/sdk-settings/sdk-section-page.tsx b/src/components/features/settings/sdk-settings/sdk-section-page.tsx
index 46785b76b9..9ec9b14365 100644
--- a/src/components/features/settings/sdk-settings/sdk-section-page.tsx
+++ b/src/components/features/settings/sdk-settings/sdk-section-page.tsx
@@ -148,7 +148,7 @@ export function SdkSectionPage({
allowAllView?: boolean;
testId?: string;
}) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { mutate: saveSettings, isPending } = useSaveSettings(scope);
const { data: settings, isLoading, isFetching } = useSettings(scope);
const agentSchemaQuery = useAgentSettingsSchema(
diff --git a/src/components/features/settings/sdk-settings/view-toggle.tsx b/src/components/features/settings/sdk-settings/view-toggle.tsx
index c07342bc0a..c72401b753 100644
--- a/src/components/features/settings/sdk-settings/view-toggle.tsx
+++ b/src/components/features/settings/sdk-settings/view-toggle.tsx
@@ -18,7 +18,7 @@ export function ViewToggle({
showAll,
isDisabled = false,
}: ViewToggleProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
if (!showAdvanced && !showAll) return null;
diff --git a/src/components/features/settings/secrets-settings/secret-form.tsx b/src/components/features/settings/secrets-settings/secret-form.tsx
index 351ce27026..007d874649 100644
--- a/src/components/features/settings/secrets-settings/secret-form.tsx
+++ b/src/components/features/settings/secrets-settings/secret-form.tsx
@@ -22,7 +22,7 @@ export function SecretForm({
onCancel,
}: SecretFormProps) {
const queryClient = useQueryClient();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { data: secrets } = useSearchSecrets();
const { mutate: createSecret } = useCreateSecret();
diff --git a/src/components/features/settings/settings-dropdown-input.tsx b/src/components/features/settings/settings-dropdown-input.tsx
index d2cf2a6a58..97300262e4 100644
--- a/src/components/features/settings/settings-dropdown-input.tsx
+++ b/src/components/features/settings/settings-dropdown-input.tsx
@@ -1,9 +1,4 @@
-import {
- ComboBox,
- Input,
- ListBox,
- type Key,
-} from "@heroui/react";
+import { ComboBox, Input, ListBox, type Key } from "@heroui/react";
import React, { ReactNode } from "react";
import { useTranslation } from "react-i18next";
import { OptionalTag } from "./optional-tag";
@@ -41,7 +36,8 @@ const LIST_BOX_ITEM_CLASS =
"px-3 py-2 text-sm text-content hover:bg-white/5 cursor-pointer rounded-md mx-1";
const CLEAR_BUTTON_CLASS =
"text-tertiary-light/80 hover:text-content transition-colors text-lg leading-none";
-const TRIGGER_CLASS = "text-tertiary-light/80 hover:text-content transition-colors";
+const TRIGGER_CLASS =
+ "text-tertiary-light/80 hover:text-content transition-colors";
const normalizeKey = (key: React.Key | null | undefined) =>
key === null || key === undefined ? null : String(key);
@@ -83,11 +79,10 @@ export function SettingsDropdownInput({
inputWrapperClassName,
inputClassName,
}: SettingsDropdownInputProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const isControlled = selectedKey !== undefined;
- const [internalSelectedKey, setInternalSelectedKey] = React.useState<Key | null>(
- defaultSelectedKey ?? null,
- );
+ const [internalSelectedKey, setInternalSelectedKey] =
+ React.useState<Key | null>(defaultSelectedKey ?? null);
const [inputValue, setInputValue] = React.useState(() =>
getItemLabel(items, defaultSelectedKey),
);
diff --git a/src/components/features/settings/settings-nav-header.tsx b/src/components/features/settings/settings-nav-header.tsx
index a8e42546a4..ebd0d70e1a 100644
--- a/src/components/features/settings/settings-nav-header.tsx
+++ b/src/components/features/settings/settings-nav-header.tsx
@@ -9,7 +9,7 @@ interface SettingsNavHeaderProps {
}
export function SettingsNavHeader({ text, className }: SettingsNavHeaderProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className={cn("px-3.5", className)}>
diff --git a/src/components/features/settings/settings-nav-link.tsx b/src/components/features/settings/settings-nav-link.tsx
index b33a454a20..fe29209e93 100644
--- a/src/components/features/settings/settings-nav-link.tsx
+++ b/src/components/features/settings/settings-nav-link.tsx
@@ -11,7 +11,7 @@ interface SettingsNavLinkProps {
}
export function SettingsNavLink({ item, onClick }: SettingsNavLinkProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { to, icon, text } = item;
return (
diff --git a/src/components/features/settings/settings-navigation.tsx b/src/components/features/settings/settings-navigation.tsx
index 7256ac6e70..3d05bed5af 100644
--- a/src/components/features/settings/settings-navigation.tsx
+++ b/src/components/features/settings/settings-navigation.tsx
@@ -20,7 +20,7 @@ export function SettingsNavigation({
onCloseMobileMenu,
navigationItems,
}: SettingsNavigationProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<>
diff --git a/src/components/features/settings/settings-switch.tsx b/src/components/features/settings/settings-switch.tsx
index 8df764bbb7..c967c163e5 100644
--- a/src/components/features/settings/settings-switch.tsx
+++ b/src/components/features/settings/settings-switch.tsx
@@ -24,7 +24,7 @@ export function SettingsSwitch({
isBeta,
isDisabled,
}: React.PropsWithChildren<SettingsSwitchProps>) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const [isToggled, setIsToggled] = React.useState(defaultIsToggled ?? false);
const handleToggle = (value: boolean) => {
diff --git a/src/components/features/settings/upgrade-banner-with-backdrop.tsx b/src/components/features/settings/upgrade-banner-with-backdrop.tsx
index 506bb71ec2..1e3c78bba7 100644
--- a/src/components/features/settings/upgrade-banner-with-backdrop.tsx
+++ b/src/components/features/settings/upgrade-banner-with-backdrop.tsx
@@ -10,7 +10,7 @@ export function UpgradeBannerWithBackdrop({
onUpgradeClick,
isDisabled,
}: UpgradeBannerWithBackdropProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<>
diff --git a/src/components/features/settings/upgrade-button.tsx b/src/components/features/settings/upgrade-button.tsx
index 82e632f3f3..936e7ab732 100644
--- a/src/components/features/settings/upgrade-button.tsx
+++ b/src/components/features/settings/upgrade-button.tsx
@@ -12,7 +12,7 @@ export function UpgradeButton({
className,
isDisabled,
}: UpgradeButtonProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<button
diff --git a/src/components/features/sidebar/avatar.tsx b/src/components/features/sidebar/avatar.tsx
index bd601fcaa3..b79d7c75d7 100644
--- a/src/components/features/sidebar/avatar.tsx
+++ b/src/components/features/sidebar/avatar.tsx
@@ -6,7 +6,7 @@ interface AvatarProps {
}
export function Avatar({ src }: AvatarProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<img
src={src}
diff --git a/src/components/features/sidebar/sidebar.tsx b/src/components/features/sidebar/sidebar.tsx
index 819ca1b908..a2600b0dac 100644
--- a/src/components/features/sidebar/sidebar.tsx
+++ b/src/components/features/sidebar/sidebar.tsx
@@ -18,7 +18,7 @@ import { cn } from "#/utils/utils";
import { ENABLE_AUTOMATIONS } from "#/utils/feature-flags";
export function Sidebar() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { currentPath } = useNavigation();
const user = useGitUser();
const { data: config } = useConfig();
diff --git a/src/components/features/sidebar/user-avatar.tsx b/src/components/features/sidebar/user-avatar.tsx
index 52e0ecc2e9..b9224f12fd 100644
--- a/src/components/features/sidebar/user-avatar.tsx
+++ b/src/components/features/sidebar/user-avatar.tsx
@@ -11,7 +11,7 @@ interface UserAvatarProps {
}
export function UserAvatar({ avatarUrl, isLoading }: UserAvatarProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<button
diff --git a/src/components/features/suggestions/suggestion-item.tsx b/src/components/features/suggestions/suggestion-item.tsx
index ab15ed324f..10c4732059 100644
--- a/src/components/features/suggestions/suggestion-item.tsx
+++ b/src/components/features/suggestions/suggestion-item.tsx
@@ -14,7 +14,7 @@ interface SuggestionItemProps {
}
export function SuggestionItem({ suggestion, onClick }: SuggestionItemProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const itemIcon = useMemo(() => {
switch (suggestion.label) {
diff --git a/src/components/features/tips/random-tip.tsx b/src/components/features/tips/random-tip.tsx
index d3e9a495e4..34e65fec2f 100644
--- a/src/components/features/tips/random-tip.tsx
+++ b/src/components/features/tips/random-tip.tsx
@@ -4,7 +4,7 @@ import { I18nKey } from "#/i18n/declaration";
import { getRandomTip } from "#/utils/tips";
export function RandomTip() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const [randomTip, setRandomTip] = React.useState(getRandomTip());
// Update the random tip when the component mounts
diff --git a/src/components/features/user/user-context-menu.tsx b/src/components/features/user/user-context-menu.tsx
index e67ac85e5a..670e0fca21 100644
--- a/src/components/features/user/user-context-menu.tsx
+++ b/src/components/features/user/user-context-menu.tsx
@@ -18,7 +18,7 @@ interface UserContextMenuProps {
}
export function UserContextMenu({ onClose }: UserContextMenuProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const settingsNavItems = useSettingsNavItems();
return (
diff --git a/src/components/providers/agent-server-ui-providers.tsx b/src/components/providers/agent-server-ui-providers.tsx
index 782f8ed341..76a5acb778 100644
--- a/src/components/providers/agent-server-ui-providers.tsx
+++ b/src/components/providers/agent-server-ui-providers.tsx
@@ -7,7 +7,12 @@ import {
getQueryClient,
setQueryClient,
} from "#/query-client-config";
-import { getDefaultI18n, getI18n, setI18n } from "#/i18n";
+import {
+ OPENHANDS_I18N_NAMESPACE,
+ getDefaultI18n,
+ getI18n,
+ setI18n,
+} from "#/i18n";
import { PostHogWrapper } from "./posthog-wrapper";
export type AgentServerUIAnalyticsConfig =
@@ -72,7 +77,7 @@ export function AgentServerUIProviders({
);
return (
- <I18nextProvider i18n={resolvedI18n} defaultNS="translation">
+ <I18nextProvider i18n={resolvedI18n} defaultNS={OPENHANDS_I18N_NAMESPACE}>
<QueryClientProvider client={resolvedQueryClient}>
{content}
</QueryClientProvider>
diff --git a/src/components/shared/action-tooltip.tsx b/src/components/shared/action-tooltip.tsx
index aa44107d68..9059cab271 100644
--- a/src/components/shared/action-tooltip.tsx
+++ b/src/components/shared/action-tooltip.tsx
@@ -9,7 +9,7 @@ interface ActionTooltipProps {
}
export function ActionTooltip({ type, onClick }: ActionTooltipProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const isConfirm = type === "confirm";
diff --git a/src/components/shared/buttons/automations-button.tsx b/src/components/shared/buttons/automations-button.tsx
index e1f7bfc975..a20246ca3e 100644
--- a/src/components/shared/buttons/automations-button.tsx
+++ b/src/components/shared/buttons/automations-button.tsx
@@ -11,7 +11,7 @@ interface AutomationsButtonProps {
export function AutomationsButton({
disabled = false,
}: AutomationsButtonProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const label = t(I18nKey.SIDEBAR$AUTOMATIONS);
diff --git a/src/components/shared/buttons/confirmation-buttons.tsx b/src/components/shared/buttons/confirmation-buttons.tsx
index 170269736a..73dee47aaf 100644
--- a/src/components/shared/buttons/confirmation-buttons.tsx
+++ b/src/components/shared/buttons/confirmation-buttons.tsx
@@ -21,7 +21,7 @@ export function ConfirmationButtons() {
(state) => state.addSubmittedEventId,
);
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { send } = useSendMessage();
const events = useEventStore((state) => state.events);
diff --git a/src/components/shared/buttons/conversation-panel-button.tsx b/src/components/shared/buttons/conversation-panel-button.tsx
index a6d753006c..57781776fc 100644
--- a/src/components/shared/buttons/conversation-panel-button.tsx
+++ b/src/components/shared/buttons/conversation-panel-button.tsx
@@ -15,7 +15,7 @@ export function ConversationPanelButton({
onClick,
disabled = false,
}: ConversationPanelButtonProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const label = t(I18nKey.SIDEBAR$CONVERSATIONS);
diff --git a/src/components/shared/buttons/copy-to-clipboard-button.tsx b/src/components/shared/buttons/copy-to-clipboard-button.tsx
index dedadb34b9..06e4c370d1 100644
--- a/src/components/shared/buttons/copy-to-clipboard-button.tsx
+++ b/src/components/shared/buttons/copy-to-clipboard-button.tsx
@@ -16,7 +16,7 @@ export function CopyToClipboardButton({
onClick,
mode,
}: CopyToClipboardButtonProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<button
hidden={isHidden}
diff --git a/src/components/shared/buttons/new-project-button.tsx b/src/components/shared/buttons/new-project-button.tsx
index 754d786ee0..7acbe24e10 100644
--- a/src/components/shared/buttons/new-project-button.tsx
+++ b/src/components/shared/buttons/new-project-button.tsx
@@ -10,7 +10,7 @@ interface NewProjectButtonProps {
}
export function NewProjectButton({ disabled = false }: NewProjectButtonProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const startNewProject = t(I18nKey.CONVERSATION$START_NEW);
diff --git a/src/components/shared/buttons/openhands-logo-button.tsx b/src/components/shared/buttons/openhands-logo-button.tsx
index be4aaac873..e6c52900e0 100644
--- a/src/components/shared/buttons/openhands-logo-button.tsx
+++ b/src/components/shared/buttons/openhands-logo-button.tsx
@@ -5,7 +5,7 @@ import { I18nKey } from "#/i18n/declaration";
import { StyledTooltip } from "#/components/shared/buttons/styled-tooltip";
export function OpenHandsLogoButton() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const tooltipText = t(I18nKey.BRANDING$OPENHANDS);
const ariaLabel = t(I18nKey.BRANDING$OPENHANDS_LOGO);
diff --git a/src/components/shared/buttons/v1-confirmation-buttons.tsx b/src/components/shared/buttons/v1-confirmation-buttons.tsx
index 817f71cc0e..390fae31e8 100644
--- a/src/components/shared/buttons/v1-confirmation-buttons.tsx
+++ b/src/components/shared/buttons/v1-confirmation-buttons.tsx
@@ -21,7 +21,7 @@ export function V1ConfirmationButtons() {
(state) => state.addV1SubmittedEventId,
);
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { data: conversation } = useActiveConversation();
const { curAgentState } = useAgentState();
const { mutate: respondToConfirmation } = useRespondToConfirmation();
diff --git a/src/components/shared/hook-execution-event-message.tsx b/src/components/shared/hook-execution-event-message.tsx
index 5ce4d04580..63f68f41c3 100644
--- a/src/components/shared/hook-execution-event-message.tsx
+++ b/src/components/shared/hook-execution-event-message.tsx
@@ -54,7 +54,7 @@ function getStatusClassName(blocked: boolean, success: boolean): string {
export function HookExecutionEventMessage({
event,
}: HookExecutionEventMessageProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
if (!isHookExecutionEvent(event)) {
return null;
diff --git a/src/components/shared/modals/confirmation-modal.tsx b/src/components/shared/modals/confirmation-modal.tsx
index 249bba7d6a..7f23b18dd4 100644
--- a/src/components/shared/modals/confirmation-modal.tsx
+++ b/src/components/shared/modals/confirmation-modal.tsx
@@ -14,7 +14,7 @@ export function ConfirmationModal({
onConfirm,
onCancel,
}: ConfirmationModalProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<ModalBackdrop onClose={onCancel}>
<div
diff --git a/src/components/shared/modals/modal-button-group.tsx b/src/components/shared/modals/modal-button-group.tsx
index c9f73bcf72..d0a1dfec79 100644
--- a/src/components/shared/modals/modal-button-group.tsx
+++ b/src/components/shared/modals/modal-button-group.tsx
@@ -28,7 +28,7 @@ export function ModalButtonGroup({
secondaryTestId,
fullWidth = false,
}: ModalButtonGroupProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const closeText = secondaryText ?? t(I18nKey.BUTTON$CLOSE);
return (
diff --git a/src/components/shared/modals/settings/model-selector.tsx b/src/components/shared/modals/settings/model-selector.tsx
index baf2ff7e54..ab53a0465f 100644
--- a/src/components/shared/modals/settings/model-selector.tsx
+++ b/src/components/shared/modals/settings/model-selector.tsx
@@ -43,8 +43,10 @@ const POPOVER_CLASS =
"bg-tertiary rounded-xl border border-[#717888] overflow-hidden";
const LIST_BOX_ITEM_CLASS =
"px-3 py-2 text-sm text-content hover:bg-white/5 cursor-pointer rounded-md mx-1";
-const TRIGGER_CLASS = "text-tertiary-light/80 hover:text-content transition-colors";
-const SECTION_HEADER_CLASS = "px-3 pt-2 pb-1 text-xs uppercase text-tertiary-light";
+const TRIGGER_CLASS =
+ "text-tertiary-light/80 hover:text-content transition-colors";
+const SECTION_HEADER_CLASS =
+ "px-3 pt-2 pb-1 text-xs uppercase text-tertiary-light";
const SECTION_SEPARATOR_CLASS = "my-1 h-px bg-[#717888]/50";
function SectionedComboBox({
@@ -317,7 +319,7 @@ export function ModelSelector({
setLitellmId(null);
};
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div
diff --git a/src/components/shared/modals/settings/settings-form.tsx b/src/components/shared/modals/settings/settings-form.tsx
index 7e69b5513b..51c3030ca5 100644
--- a/src/components/shared/modals/settings/settings-form.tsx
+++ b/src/components/shared/modals/settings/settings-form.tsx
@@ -24,7 +24,7 @@ export function SettingsForm({ settings, onClose }: SettingsFormProps) {
const posthog = usePostHog();
const { mutate: saveUserSettings } = useSaveSettings();
const { currentPath } = useNavigation();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const formRef = React.useRef<HTMLFormElement>(null);
diff --git a/src/components/shared/modals/settings/settings-modal.tsx b/src/components/shared/modals/settings/settings-modal.tsx
index 4ce1fa3879..3a9a1411fd 100644
--- a/src/components/shared/modals/settings/settings-modal.tsx
+++ b/src/components/shared/modals/settings/settings-modal.tsx
@@ -12,7 +12,7 @@ interface SettingsModalProps {
}
export function SettingsModal({ onClose, settings }: SettingsModalProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<ModalBackdrop>
diff --git a/src/components/shared/terms-and-privacy-notice.tsx b/src/components/shared/terms-and-privacy-notice.tsx
index 4e9f8b5463..ae6f27f105 100644
--- a/src/components/shared/terms-and-privacy-notice.tsx
+++ b/src/components/shared/terms-and-privacy-notice.tsx
@@ -10,7 +10,7 @@ interface TermsAndPrivacyNoticeProps {
export function TermsAndPrivacyNotice({
className,
}: TermsAndPrivacyNoticeProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<p
diff --git a/src/components/v1/chat/event-content-helpers/get-event-content.tsx b/src/components/v1/chat/event-content-helpers/get-event-content.tsx
index 76de6950dd..4595e15e9a 100644
--- a/src/components/v1/chat/event-content-helpers/get-event-content.tsx
+++ b/src/components/v1/chat/event-content-helpers/get-event-content.tsx
@@ -27,6 +27,7 @@ const createTitleFromKey = (
return (
<Trans
+ ns="openhands"
i18nKey={key}
values={values}
components={{
diff --git a/src/components/v1/chat/event-message-components/skill-item-expanded.tsx b/src/components/v1/chat/event-message-components/skill-item-expanded.tsx
index 9cb22d9235..720d2b649b 100644
--- a/src/components/v1/chat/event-message-components/skill-item-expanded.tsx
+++ b/src/components/v1/chat/event-message-components/skill-item-expanded.tsx
@@ -64,7 +64,7 @@ interface SkillItemExpandedProps {
}
export function SkillItemExpanded({ content }: SkillItemExpandedProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { matchInfo, filePath, body } = parseSkillContent(content);
const hasMetadata = matchInfo || filePath;
diff --git a/src/components/v1/chat/event-message-components/skill-ready-content-list.tsx b/src/components/v1/chat/event-message-components/skill-ready-content-list.tsx
index 46e2d2ba04..0268aaa78e 100644
--- a/src/components/v1/chat/event-message-components/skill-ready-content-list.tsx
+++ b/src/components/v1/chat/event-message-components/skill-ready-content-list.tsx
@@ -11,7 +11,7 @@ interface SkillReadyContentListProps {
}
export function SkillReadyContentList({ items }: SkillReadyContentListProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const [expandedSkills, setExpandedSkills] = React.useState<
Record<string, boolean>
>({});
diff --git a/src/components/v1/chat/task-tracking/task-item.tsx b/src/components/v1/chat/task-tracking/task-item.tsx
index 1b4b386fb3..b324e53e12 100644
--- a/src/components/v1/chat/task-tracking/task-item.tsx
+++ b/src/components/v1/chat/task-tracking/task-item.tsx
@@ -13,7 +13,7 @@ interface TaskItemProps {
}
export function TaskItem({ task }: TaskItemProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const icon = useMemo(() => {
switch (task.status) {
diff --git a/src/components/v1/chat/task-tracking/task-list-section.tsx b/src/components/v1/chat/task-tracking/task-list-section.tsx
index aa3821036f..e1ba1d3af3 100644
--- a/src/components/v1/chat/task-tracking/task-list-section.tsx
+++ b/src/components/v1/chat/task-tracking/task-list-section.tsx
@@ -10,7 +10,7 @@ interface TaskListSectionProps {
}
export function TaskListSection({ taskList }: TaskListSectionProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="flex flex-col overflow-clip bg-[#25272d] border border-[#525252] rounded-[12px] w-full">
diff --git a/src/entry.client.tsx b/src/entry.client.tsx
index 4597ac12d8..0f157278a6 100644
--- a/src/entry.client.tsx
+++ b/src/entry.client.tsx
@@ -12,9 +12,12 @@ import {
AgentServerUIProviders,
DEFAULT_AGENT_SERVER_ANALYTICS,
} from "./components/providers";
+import { waitForI18n } from "./i18n";
import { shouldStartMockWorker } from "./mocks/should-start-mock-worker";
async function prepareApp() {
+ await waitForI18n();
+
if (shouldStartMockWorker()) {
const { worker } = await import("./mocks/browser");
diff --git a/src/hooks/mutation/use-configure-integration.ts b/src/hooks/mutation/use-configure-integration.ts
index 8181f926c9..8f628bac27 100644
--- a/src/hooks/mutation/use-configure-integration.ts
+++ b/src/hooks/mutation/use-configure-integration.ts
@@ -23,7 +23,7 @@ export function useConfigureIntegration(
},
) {
const queryClient = useQueryClient();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return useMutation({
mutationFn: async (data: ConfigureIntegrationData) => {
diff --git a/src/hooks/mutation/use-link-integration.ts b/src/hooks/mutation/use-link-integration.ts
index 6752d8de8b..c9098c92d0 100644
--- a/src/hooks/mutation/use-link-integration.ts
+++ b/src/hooks/mutation/use-link-integration.ts
@@ -15,7 +15,7 @@ export function useLinkIntegration(
},
) {
const queryClient = useQueryClient();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return useMutation({
mutationFn: async (workspace: string) => {
diff --git a/src/hooks/mutation/use-new-conversation-command.ts b/src/hooks/mutation/use-new-conversation-command.ts
index eaf0b467ca..2188c7b965 100644
--- a/src/hooks/mutation/use-new-conversation-command.ts
+++ b/src/hooks/mutation/use-new-conversation-command.ts
@@ -14,7 +14,7 @@ import { useActiveConversation } from "#/hooks/query/use-active-conversation";
export const useNewConversationCommand = () => {
const queryClient = useQueryClient();
const { navigate } = useNavigation();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { data: conversation } = useActiveConversation();
const mutation = useMutation({
diff --git a/src/hooks/mutation/use-unified-stop-conversation.ts b/src/hooks/mutation/use-unified-stop-conversation.ts
index 4731860137..9184d5d6f5 100644
--- a/src/hooks/mutation/use-unified-stop-conversation.ts
+++ b/src/hooks/mutation/use-unified-stop-conversation.ts
@@ -17,7 +17,7 @@ import {
* stopConversation({ conversationId: "some-id" });
*/
export const useUnifiedPauseConversationSandbox = () => {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const queryClient = useQueryClient();
const { conversationId: currentConversationId, navigate } = useNavigation();
diff --git a/src/hooks/mutation/use-unlink-integration.ts b/src/hooks/mutation/use-unlink-integration.ts
index 606b65be5f..c2dc2bb99b 100644
--- a/src/hooks/mutation/use-unlink-integration.ts
+++ b/src/hooks/mutation/use-unlink-integration.ts
@@ -18,7 +18,7 @@ export function useUnlinkIntegration(
},
) {
const queryClient = useQueryClient();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return useMutation({
mutationFn: () =>
diff --git a/src/hooks/mutation/use-update-conversation-public-flag.ts b/src/hooks/mutation/use-update-conversation-public-flag.ts
index 92b4086dc6..405d78ac30 100644
--- a/src/hooks/mutation/use-update-conversation-public-flag.ts
+++ b/src/hooks/mutation/use-update-conversation-public-flag.ts
@@ -9,7 +9,7 @@ import {
export const useUpdateConversationPublicFlag = () => {
const queryClient = useQueryClient();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return useMutation({
mutationFn: (variables: { conversationId: string; isPublic: boolean }) =>
diff --git a/src/hooks/mutation/use-update-conversation-repository.ts b/src/hooks/mutation/use-update-conversation-repository.ts
index 47bbed1515..cd8229a683 100644
--- a/src/hooks/mutation/use-update-conversation-repository.ts
+++ b/src/hooks/mutation/use-update-conversation-repository.ts
@@ -17,7 +17,7 @@ interface UpdateRepositoryVariables {
export const useUpdateConversationRepository = () => {
const queryClient = useQueryClient();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return useMutation({
mutationFn: (variables: UpdateRepositoryVariables) =>
diff --git a/src/hooks/mutation/use-validate-integration.ts b/src/hooks/mutation/use-validate-integration.ts
index 29ee1e5a48..f8dc3c2544 100644
--- a/src/hooks/mutation/use-validate-integration.ts
+++ b/src/hooks/mutation/use-validate-integration.ts
@@ -18,7 +18,7 @@ export function useValidateIntegration(
onError: (error: any) => void;
},
) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return useMutation({
mutationFn: (workspace?: string) => {
diff --git a/src/hooks/query/use-unified-vscode-url.ts b/src/hooks/query/use-unified-vscode-url.ts
index 2f84cbf0d7..0eb6a8f81d 100644
--- a/src/hooks/query/use-unified-vscode-url.ts
+++ b/src/hooks/query/use-unified-vscode-url.ts
@@ -20,7 +20,7 @@ interface VSCodeUrlResult {
* clients expose VSCode as a dedicated API.
*/
export const useUnifiedVSCodeUrl = () => {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { conversationId } = useConversationId();
const runtimeIsReady = useRuntimeIsReady({ allowAgentError: true });
@@ -37,9 +37,7 @@ export const useUnifiedVSCodeUrl = () => {
return {
url: transformVSCodeUrl(response.vscode_url),
- error: response.vscode_url
- ? null
- : t(I18nKey.VSCODE$URL_NOT_AVAILABLE),
+ error: response.vscode_url ? null : t(I18nKey.VSCODE$URL_NOT_AVAILABLE),
};
},
enabled: runtimeIsReady && !!conversationId,
diff --git a/src/hooks/use-agent-notification.ts b/src/hooks/use-agent-notification.ts
index bef6190811..38ea1fd2f7 100644
--- a/src/hooks/use-agent-notification.ts
+++ b/src/hooks/use-agent-notification.ts
@@ -22,7 +22,7 @@ const NOTIFICATION_STATES: AgentState[] = [
*/
export function useAgentNotification(curAgentState: AgentState) {
const { data: settings } = useSettings();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const audioRef = useRef<HTMLAudioElement | undefined>(undefined);
const prevStateRef = useRef<AgentState | undefined>(undefined);
diff --git a/src/hooks/use-conversation-name-context-menu.ts b/src/hooks/use-conversation-name-context-menu.ts
index 564e85cc8a..0f330a1502 100644
--- a/src/hooks/use-conversation-name-context-menu.ts
+++ b/src/hooks/use-conversation-name-context-menu.ts
@@ -30,7 +30,7 @@ export function useConversationNameContextMenu({
showOptions = false,
onContextMenuToggle,
}: UseConversationNameContextMenuProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { conversationId: currentConversationId, navigate } = useNavigation();
const events = useEventStore((state) => state.events);
const { mutate: deleteConversation } = useDeleteConversation();
diff --git a/src/hooks/use-download-conversation.ts b/src/hooks/use-download-conversation.ts
index ae2f4c507c..baa05e6bbd 100644
--- a/src/hooks/use-download-conversation.ts
+++ b/src/hooks/use-download-conversation.ts
@@ -8,7 +8,7 @@ import { I18nKey } from "#/i18n/declaration";
export const useDownloadConversation = () => {
const posthog = usePostHog();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return useMutation({
mutationKey: ["conversations", "download"],
diff --git a/src/hooks/use-handle-plan-click.ts b/src/hooks/use-handle-plan-click.ts
index 9ceba6fc29..5c344eb3ec 100644
--- a/src/hooks/use-handle-plan-click.ts
+++ b/src/hooks/use-handle-plan-click.ts
@@ -18,7 +18,7 @@ import {
* @returns An object containing handlePlanClick function and isCreatingConversation boolean
*/
export const useHandlePlanClick = () => {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const {
setConversationMode,
setSubConversationTaskId,
diff --git a/src/hooks/use-sandbox-recovery.ts b/src/hooks/use-sandbox-recovery.ts
index 55458df524..df621ebda9 100644
--- a/src/hooks/use-sandbox-recovery.ts
+++ b/src/hooks/use-sandbox-recovery.ts
@@ -45,7 +45,7 @@ export function useSandboxRecovery({
onSuccess,
onError,
}: UseSandboxRecoveryOptions) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { providers } = useUserProviders();
const { mutate: resumeSandbox, isPending: isResuming } =
useUnifiedResumeConversationSandbox();
diff --git a/src/i18n/index.ts b/src/i18n/index.ts
index 21b5222fd3..822fd8ac9e 100644
--- a/src/i18n/index.ts
+++ b/src/i18n/index.ts
@@ -2,6 +2,9 @@ import { createInstance, type i18n as I18nInstance } from "i18next";
import Backend from "i18next-http-backend";
import LanguageDetector from "i18next-browser-languagedetector";
import { initReactI18next } from "react-i18next";
+import translationDefinitions from "./translation.json";
+
+export const OPENHANDS_I18N_NAMESPACE = "openhands";
export const AvailableLanguages = [
{ label: "English", value: "en" },
@@ -19,20 +22,60 @@ export const AvailableLanguages = [
{ label: "Català", value: "ca" },
{ label: "Türkçe", value: "tr" },
{ label: "Українська", value: "uk" },
-];
+] as const;
-const initializeI18n = (instance: I18nInstance) => {
- instance
- .use(Backend)
- .use(LanguageDetector)
- .use(initReactI18next)
- .init({
- fallbackLng: "en",
- debug: import.meta.env.NODE_ENV === "development",
-
- supportedLngs: AvailableLanguages.map((lang) => lang.value),
- nonExplicitSupportedLngs: false,
+type TranslationDefinitionMap = Record<string, Partial<Record<string, string>>>;
+export type TranslationResources = Record<string, Record<string, string>>;
+
+const buildTranslationResources = (
+ definitions: TranslationDefinitionMap,
+): TranslationResources => {
+ const resources: TranslationResources = {};
+
+ Object.entries(definitions).forEach(([key, translations]) => {
+ Object.entries(translations).forEach(([language, value]) => {
+ if (typeof value !== "string") {
+ return;
+ }
+
+ if (!resources[language]) {
+ resources[language] = {};
+ }
+
+ resources[language][key] = value;
});
+ });
+
+ return resources;
+};
+
+export const translationResources = buildTranslationResources(
+ translationDefinitions as TranslationDefinitionMap,
+);
+
+const initializationPromises = new WeakMap<I18nInstance, Promise<unknown>>();
+
+const initializeI18n = (instance: I18nInstance) => {
+ if (!initializationPromises.has(instance)) {
+ const initPromise = instance
+ .use(Backend)
+ .use(LanguageDetector)
+ .use(initReactI18next)
+ .init({
+ fallbackLng: "en",
+ debug: import.meta.env.NODE_ENV === "development",
+ supportedLngs: AvailableLanguages.map((lang) => lang.value),
+ nonExplicitSupportedLngs: false,
+ ns: [OPENHANDS_I18N_NAMESPACE],
+ defaultNS: OPENHANDS_I18N_NAMESPACE,
+ fallbackNS: OPENHANDS_I18N_NAMESPACE,
+ backend: {
+ loadPath: "/locales/{{lng}}/{{ns}}.json",
+ },
+ });
+
+ initializationPromises.set(instance, initPromise);
+ }
return instance;
};
@@ -57,9 +100,40 @@ export const setI18n = (instance?: I18nInstance | null) => {
return activeI18n;
};
+export const waitForI18n = async (instance = getDefaultI18n()) => {
+ await initializationPromises.get(instance);
+ return instance;
+};
+
+const withNamespace = (options?: unknown) => {
+ if (!options) {
+ return { ns: OPENHANDS_I18N_NAMESPACE };
+ }
+
+ if (typeof options === "object" && !Array.isArray(options)) {
+ return {
+ ns: OPENHANDS_I18N_NAMESPACE,
+ ...(options as Record<string, unknown>),
+ };
+ }
+
+ return options;
+};
+
const i18n = new Proxy({} as I18nInstance, {
get: (_target, prop) => {
const instance = getI18n();
+
+ if (prop === "t") {
+ return (key: string, options?: unknown) =>
+ instance.t(key, withNamespace(options) as never);
+ }
+
+ if (prop === "exists") {
+ return (key: string, options?: unknown) =>
+ instance.exists(key, withNamespace(options) as never);
+ }
+
const value = Reflect.get(instance, prop, instance);
return typeof value === "function" ? value.bind(instance) : value;
},
diff --git a/src/lib/index.ts b/src/lib/index.ts
index ff2a909811..c462d82ccb 100644
--- a/src/lib/index.ts
+++ b/src/lib/index.ts
@@ -19,8 +19,11 @@ export {
} from "../query-client-config";
export {
AvailableLanguages,
+ OPENHANDS_I18N_NAMESPACE,
createAgentServerI18n,
getDefaultI18n,
getI18n,
setI18n,
+ translationResources,
+ waitForI18n,
} from "../i18n";
diff --git a/src/root.tsx b/src/root.tsx
index 5e95e7bf8e..e23738b87a 100644
--- a/src/root.tsx
+++ b/src/root.tsx
@@ -54,7 +54,7 @@ function AgentServerStatusCard({
details?: string | null;
version?: string | null;
}) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div className="mt-6 rounded-2xl border border-primary/20 bg-primary/10 p-4">
@@ -86,7 +86,6 @@ function AgentServerBootstrapLoading() {
);
}
-
function AgentServerOnboardingLayout({
testId,
eyebrow,
@@ -106,7 +105,7 @@ function AgentServerOnboardingLayout({
statusDetails?: string | null;
version?: string | null;
}) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<main className="min-h-screen bg-base px-6 py-10 text-white">
@@ -161,7 +160,7 @@ function UnsupportedAgentServerNotice({
}: {
error: AgentServerIncompatibilityError;
}) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<AgentServerOnboardingLayout
@@ -181,7 +180,7 @@ function UnsupportedAgentServerNotice({
}
function UnknownAgentServerNotice() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<AgentServerOnboardingLayout
@@ -204,7 +203,7 @@ function MissingAgentServerNotice({
}: {
error: AgentServerUnavailableError;
}) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<AgentServerOnboardingLayout
diff --git a/src/routes/agent-server-settings.tsx b/src/routes/agent-server-settings.tsx
index 1711ecdcbb..5d844c2e0f 100644
--- a/src/routes/agent-server-settings.tsx
+++ b/src/routes/agent-server-settings.tsx
@@ -7,7 +7,7 @@ export const clientLoader = async () => null;
export const handle = { hideTitle: true };
export function AgentServerSettingsScreen() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<div
@@ -24,7 +24,10 @@ export function AgentServerSettingsScreen() {
</div>
<div className="max-w-2xl">
- <AgentServerConnectionForm variant="settings" showSectionHeader={false} />
+ <AgentServerConnectionForm
+ variant="settings"
+ showSectionHeader={false}
+ />
</div>
</div>
);
diff --git a/src/routes/app-settings.tsx b/src/routes/app-settings.tsx
index ab620a9dc4..cd32e7f67c 100644
--- a/src/routes/app-settings.tsx
+++ b/src/routes/app-settings.tsx
@@ -33,7 +33,7 @@ export const clientLoader = createPermissionGuard(
export function AppSettingsScreen() {
const posthog = usePostHog();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { mutate: saveSettings, isPending } = useSaveSettings();
const { data: settings, isLoading } = useSettings();
diff --git a/src/routes/changes-tab.tsx b/src/routes/changes-tab.tsx
index 08d1e345bb..9b2eda0198 100644
--- a/src/routes/changes-tab.tsx
+++ b/src/routes/changes-tab.tsx
@@ -21,7 +21,7 @@ function StatusMessage({ children }: React.PropsWithChildren) {
}
function GitChanges() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const {
data: gitChanges,
isSuccess,
diff --git a/src/routes/conversation.tsx b/src/routes/conversation.tsx
index a0539cf5e8..854b384dcb 100644
--- a/src/routes/conversation.tsx
+++ b/src/routes/conversation.tsx
@@ -28,7 +28,7 @@ import { I18nKey } from "#/i18n/declaration";
import { useEventStore } from "#/stores/use-event-store";
function AppContent() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { conversationId } = useConversationId();
const clearEvents = useEventStore((state) => state.clearEvents);
diff --git a/src/routes/device-verify.tsx b/src/routes/device-verify.tsx
index 84210739cf..990f642c0d 100644
--- a/src/routes/device-verify.tsx
+++ b/src/routes/device-verify.tsx
@@ -6,7 +6,7 @@ import { I18nKey } from "#/i18n/declaration";
import { H1 } from "#/ui/typography";
export default function DeviceVerify() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const [searchParams] = useSearchParams();
const { data: isAuthed, isLoading: isAuthLoading } = useIsAuthed();
const [verificationResult, setVerificationResult] = useState<{
diff --git a/src/routes/git-settings.tsx b/src/routes/git-settings.tsx
index b62b4b77a5..af9d22214f 100644
--- a/src/routes/git-settings.tsx
+++ b/src/routes/git-settings.tsx
@@ -26,7 +26,7 @@ import { Provider, ProviderToken } from "#/types/settings";
export const clientLoader = createPermissionGuard("manage_integrations");
export function GitSettingsScreen() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { mutate: saveGitProviders, isPending } = useAddGitProviders();
const { mutate: disconnectGitTokens, isPending: isDisconnecting } =
diff --git a/src/routes/launch.tsx b/src/routes/launch.tsx
index c05ba0c152..cd813b380c 100644
--- a/src/routes/launch.tsx
+++ b/src/routes/launch.tsx
@@ -91,7 +91,7 @@ function ErrorDisplay({
onGoHome: () => void;
onTryAgain?: () => void;
}) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const errorMessages: Record<ErrorType, string> = {
no_plugins: t(I18nKey.LAUNCH$ERROR_NO_PLUGINS),
@@ -137,7 +137,7 @@ function ErrorDisplay({
export default function LaunchRoute() {
const [searchParams] = useSearchParams();
const navigate = useNavigate();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const createConversation = useCreateConversation();
const [creationError, setCreationError] = React.useState<string | null>(null);
diff --git a/src/routes/llm-settings.tsx b/src/routes/llm-settings.tsx
index cd76c1e1a1..bcce05e9da 100644
--- a/src/routes/llm-settings.tsx
+++ b/src/routes/llm-settings.tsx
@@ -84,7 +84,7 @@ interface OpenHandsApiKeyHelpProps {
}
function OpenHandsApiKeyHelp({ testId }: OpenHandsApiKeyHelpProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
return (
<>
@@ -115,7 +115,7 @@ export function LlmSettingsScreen({
}: {
scope?: SettingsScope;
}) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const [searchParams, setSearchParams] = useSearchParams();
const { data: settings } = useSettings(scope);
diff --git a/src/routes/mcp-settings.tsx b/src/routes/mcp-settings.tsx
index 7c5bc403c4..8bdf16a2f7 100644
--- a/src/routes/mcp-settings.tsx
+++ b/src/routes/mcp-settings.tsx
@@ -44,7 +44,7 @@ interface MCPServerConfig {
}
export function MCPSettingsScreen() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { data: settings, isLoading } = useSettings();
const { data: config } = useConfig();
const { mutate: saveSettings, isPending: isSavingSearchApiKey } =
diff --git a/src/routes/planner-tab.tsx b/src/routes/planner-tab.tsx
index 3355971136..388d71e6e5 100644
--- a/src/routes/planner-tab.tsx
+++ b/src/routes/planner-tab.tsx
@@ -10,7 +10,7 @@ import { useHandlePlanClick } from "#/hooks/use-handle-plan-click";
import { cn } from "#/utils/utils";
function PlannerTab() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const scrollRef = React.useRef<HTMLDivElement>(null);
const {
scrollRef: scrollContainerRef,
diff --git a/src/routes/root-layout.tsx b/src/routes/root-layout.tsx
index 3f9cefd072..c31afd0dbf 100644
--- a/src/routes/root-layout.tsx
+++ b/src/routes/root-layout.tsx
@@ -22,7 +22,7 @@ import { ReactRouterNavigationProvider } from "./react-router-navigation-provide
export function ErrorBoundary() {
const error = useRouteError();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
if (isRouteErrorResponse(error)) {
return (
diff --git a/src/routes/secrets-settings.tsx b/src/routes/secrets-settings.tsx
index c9272a7e20..6d12291a82 100644
--- a/src/routes/secrets-settings.tsx
+++ b/src/routes/secrets-settings.tsx
@@ -18,7 +18,7 @@ export const clientLoader = createPermissionGuard("manage_secrets");
export function SecretsSettingsScreen() {
const queryClient = useQueryClient();
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const tableContainerRef = useRef<HTMLDivElement>(null);
const {
diff --git a/src/routes/served-tab.tsx b/src/routes/served-tab.tsx
index b6abb5b3d3..621cf1859b 100644
--- a/src/routes/served-tab.tsx
+++ b/src/routes/served-tab.tsx
@@ -8,7 +8,7 @@ import { I18nKey } from "#/i18n/declaration";
import ServerProcessIcon from "#/icons/server-process.svg?react";
function ServedApp() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { activeHost } = useUnifiedActiveHost();
const [refreshKey, setRefreshKey] = React.useState(0);
const [currentActiveHost, setCurrentActiveHost] = React.useState<
diff --git a/src/routes/settings.tsx b/src/routes/settings.tsx
index b6850cc040..8074a898a7 100644
--- a/src/routes/settings.tsx
+++ b/src/routes/settings.tsx
@@ -41,7 +41,7 @@ export const clientLoader = async ({ request }: Route.ClientLoaderArgs) => {
};
function SettingsScreen() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const location = useLocation();
const matches = useMatches();
const navItems = useSettingsNavItems();
diff --git a/src/routes/shared-conversation.tsx b/src/routes/shared-conversation.tsx
index eaa7477f1e..fe3d58ad14 100644
--- a/src/routes/shared-conversation.tsx
+++ b/src/routes/shared-conversation.tsx
@@ -13,7 +13,7 @@ import OpenHandsLogo from "#/assets/branding/openhands-logo.svg?react";
import { useInfiniteScroll } from "#/hooks/use-infinite-scroll";
export default function SharedConversation() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { conversationId } = useParams<{ conversationId: string }>();
const {
diff --git a/src/routes/skills-settings.tsx b/src/routes/skills-settings.tsx
index 6504cb0438..56c41b2d46 100644
--- a/src/routes/skills-settings.tsx
+++ b/src/routes/skills-settings.tsx
@@ -13,7 +13,7 @@ import {
import { retrieveAxiosErrorMessage } from "#/utils/retrieve-axios-error-message";
function SkillsSettingsScreen() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { mutate: saveSettings, isPending } = useSaveSettings();
const { data: settings, isLoading: settingsLoading } = useSettings();
diff --git a/src/routes/task-list-tab.tsx b/src/routes/task-list-tab.tsx
index 43280e3abb..644f58136f 100644
--- a/src/routes/task-list-tab.tsx
+++ b/src/routes/task-list-tab.tsx
@@ -7,7 +7,7 @@ import { Text } from "#/ui/typography";
import { cn } from "#/utils/utils";
function TaskListTab() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { taskList } = useTaskList();
if (taskList.length === 0) {
diff --git a/src/routes/verification-settings.tsx b/src/routes/verification-settings.tsx
index bad5e104b8..9eb228b590 100644
--- a/src/routes/verification-settings.tsx
+++ b/src/routes/verification-settings.tsx
@@ -32,7 +32,7 @@ function VerificationSettingsHeader({
onSecurityAnalyzerChange: (value: string | null) => void;
renderTopContent?: () => React.ReactNode;
}) {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const securityAnalyzerItems = React.useMemo(
() => [
diff --git a/src/routes/vscode-tab.tsx b/src/routes/vscode-tab.tsx
index fe60a52dac..8c89965e1b 100644
--- a/src/routes/vscode-tab.tsx
+++ b/src/routes/vscode-tab.tsx
@@ -8,7 +8,7 @@ import { VSCODE_IN_NEW_TAB } from "#/utils/feature-flags";
import { WaitingForRuntimeMessage } from "#/components/features/chat/waiting-for-runtime-message";
function VSCodeTab() {
- const { t } = useTranslation();
+ const { t } = useTranslation("openhands");
const { data, isLoading, error } = useUnifiedVSCodeUrl();
const { curAgentState } = useAgentState();
const isRuntimeStarting = RUNTIME_STARTING_STATES.includes(curAgentState);
diff --git a/src/utils/mutate-with-toast.ts b/src/utils/mutate-with-toast.ts
index c0fba2a1c0..edd46f349b 100644
--- a/src/utils/mutate-with-toast.ts
+++ b/src/utils/mutate-with-toast.ts
@@ -1,5 +1,5 @@
import toast from "react-hot-toast";
-import i18next from "i18next";
+import i18n from "#/i18n";
import { UseMutationResult } from "@tanstack/react-query";
import {
TOAST_OPTIONS,
@@ -48,7 +48,7 @@ export async function mutateWithToast<TData, TVariables>(
} else if (err instanceof Error) {
message = err.message;
} else {
- message = i18next.t("ERROR$GENERIC");
+ message = i18n.t("ERROR$GENERIC");
}
displayErrorToast(message);
}