Skip to content

Email for professionals and teams

Translate remaining shell components

Hieu Nguyen (Jack)d9ff5c567786
diff --git a/src/components/agent/utils.ts b/src/components/agent/utils.ts
index 014761e..5637d33 100644
--- a/src/components/agent/utils.ts
+++ b/src/components/agent/utils.ts
@@ -1,4 +1,4 @@
-import { defaultTranslator, type Translator } from "@/lib/i18n/utils";
+import type { Translator } from "../../lib/i18n/utils";
import type { KeyboardEvent } from "react";
import type { AgentActionProposal, AgentDraftAction, AgentEmailReference, AgentEvent, AgentMessage, AgentTurn, QueuedAgentMessage } from "./types";
@@ -175,7 +175,7 @@ export function activeAgentTool(messages: AgentMessage[]): AgentMessage | null {
return null;
}
-export function activeAgentToolLabel(name: string | null | undefined, t: Translator = defaultTranslator): string {
+export function activeAgentToolLabel(name: string | null | undefined, t: Translator): string {
return agentToolText(name, "running", t) ?? t("agent.tool.using");
}
@@ -207,7 +207,7 @@ export function agentActionProposal(content: string): AgentActionProposal | null
return value && (value.action === "move_email" || value.action === "move_emails" || value.action === "mark_email_read" || value.action === "discard_draft") && (value.status === "pending_approval" || value.status === "processing" || value.status === "approved") ? value as AgentActionProposal : null;
}
-export function agentToolLabel(name: string | null | undefined, state: AgentMessage["toolState"], content: string, t: Translator = defaultTranslator): { label: string; description: string } {
+export function agentToolLabel(name: string | null | undefined, state: AgentMessage["toolState"], content: string, t: Translator): { label: string; description: string } {
const fallback = (name ?? "Tool").replace(/_/g, " ");
const description = agentToolText(name, "description", t);
if (description === null) return { label: fallback.charAt(0).toUpperCase() + fallback.slice(1), description: t("agent.tool.fallbackDescription") };
diff --git a/src/components/messages/email-html-renderer.tsx b/src/components/messages/email-html-renderer.tsx
index ea0ef4a..d5e0f89 100644
--- a/src/components/messages/email-html-renderer.tsx
+++ b/src/components/messages/email-html-renderer.tsx
@@ -1,5 +1,6 @@
"use client";
+import { useLanguage } from "@/components/language-provider";
import { useEffect, useRef, useState } from "react";
import { prepareEmailHtml } from "@/lib/email/html";
import { collapseQuotedEmailHtml } from "@/app/(dashboard)/inbox/[messageId]/quote-collapse-utils";
@@ -16,6 +17,7 @@ const BASE_STYLE = `
export function EmailHtmlRenderer({ html, className, preserveLeadingQuote = false }: {
html: string; className?: string; preserveLeadingQuote?: boolean;
}) {
+ const { t } = useLanguage();
const host = useRef<HTMLDivElement>(null);
const [allowedSource, setAllowedSource] = useState<string | null>(null);
const [hasRemote, setHasRemote] = useState(false);
@@ -54,7 +56,7 @@ export function EmailHtmlRenderer({ html, className, preserveLeadingQuote = fals
{hasRemote && <div className="mb-2 flex justify-end">
<button type="button" aria-pressed={allowRemote} className="rounded px-2 py-1 text-xs text-blue-600 hover:bg-blue-50"
onClick={() => setAllowedSource(allowRemote ? null : html)}>
- {allowRemote ? "Block remote content" : "Allow remote content"}
+ {allowRemote ? t("message.blockRemote") : t("message.allowRemote")}
</button>
</div>}
<div className="max-w-full overflow-x-auto" ref={host} />
diff --git a/src/components/route-loading-bar.tsx b/src/components/route-loading-bar.tsx
index bb6e3a5..39d43dc 100644
--- a/src/components/route-loading-bar.tsx
+++ b/src/components/route-loading-bar.tsx
@@ -1,6 +1,11 @@
+"use client";
+
+import { useLanguage } from "@/components/language-provider";
+
export function RouteLoadingBar() {
+ const { t } = useLanguage();
return (
- <div className="fixed inset-x-0 top-0 z-[120] h-1 overflow-hidden bg-blue-100" role="progressbar" aria-label="Loading page">
+ <div className="fixed inset-x-0 top-0 z-[120] h-1 overflow-hidden bg-blue-100" role="progressbar" aria-label={t("nav.loadingPage")}>
<div className="route-loading-bar h-full w-2/5 bg-blue-600" />
</div>
);
diff --git a/src/components/sidebar-resize-boundary.tsx b/src/components/sidebar-resize-boundary.tsx
index eb1377a..d0451e8 100644
--- a/src/components/sidebar-resize-boundary.tsx
+++ b/src/components/sidebar-resize-boundary.tsx
@@ -1,11 +1,13 @@
"use client";
import { useRef } from "react";
+import { useLanguage } from "@/components/language-provider";
import { ResizeHandle } from "./ui/resize-handle";
import { useSidebar } from "./sidebar-state";
import { saveColumnWidth } from "./column-width-preferences";
export function SidebarResizeBoundary() {
+ const { t } = useLanguage();
const { minimal, width, userId, setWidth } = useSidebar();
const startWidth = useRef(width);
const resizedWidth = useRef(width);
@@ -14,7 +16,7 @@ export function SidebarResizeBoundary() {
return (
<div className="hidden md:block">
<ResizeHandle
- label="Resize left menu"
+ label={t("layout.resizeMenu")}
onResizeStart={() => { startWidth.current = width; resizedWidth.current = width; }}
onResize={(delta) => {
if (minimal) return;
diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json
index b116b72..d2b0487 100644
--- a/src/lib/i18n/en.json
+++ b/src/lib/i18n/en.json
@@ -1858,5 +1858,10 @@
"importPage.importAll": "Import all messages (newest first, in batches)",
"importPage.useTls": "Use TLS",
"importPage.imapNote": "IMAP imports selected source sections automatically. Folders are discovered from the source account and imported into matching new or existing Mailflare folders.",
- "importPage.importSources": "Import selected sources"
+ "importPage.importSources": "Import selected sources",
+ "layout.resizeMenu": "Resize left menu",
+ "nav.loadingPage": "Loading page",
+ "message.blockRemote": "Block remote content",
+ "message.allowRemote": "Allow remote content",
+ "settingsPage.rules.title": "Rules"
}
diff --git a/src/lib/i18n/pt-BR.json b/src/lib/i18n/pt-BR.json
index cba552b..4d5cee0 100644
--- a/src/lib/i18n/pt-BR.json
+++ b/src/lib/i18n/pt-BR.json
@@ -1858,5 +1858,10 @@
"importPage.importAll": "Importar todas as mensagens (as mais recentes primeiro, em lotes)",
"importPage.useTls": "Usar TLS",
"importPage.imapNote": "O IMAP importa automaticamente as seções de origem selecionadas. As pastas são descobertas na conta de origem e importadas para pastas novas ou existentes do Mailflare.",
- "importPage.importSources": "Importar as origens selecionadas"
+ "importPage.importSources": "Importar as origens selecionadas",
+ "layout.resizeMenu": "Redimensionar menu lateral",
+ "nav.loadingPage": "Carregando página",
+ "message.blockRemote": "Bloquear conteúdo remoto",
+ "message.allowRemote": "Permitir conteúdo remoto",
+ "settingsPage.rules.title": "Regras"
}