diff --git a/apps/web/src/composer.tsx b/apps/web/src/composer.tsx index 15775e3..191bafd 100644 --- a/apps/web/src/composer.tsx +++ b/apps/web/src/composer.tsx @@ -78,18 +78,19 @@ function EditorReferencePlugin({ onReady }: { onReady: (editor: LexicalEditor) = return null; } -function FormatToolbar({ editor }: { editor: LexicalEditor | null }) { +function FormatToolbar({ editor, locale }: { editor: LexicalEditor | null; locale: Locale }) { + const t = (key: Parameters[1]) => translate(locale, key); const format = (kind: "bold" | "italic" | "underline") => editor?.dispatchCommand(FORMAT_TEXT_COMMAND, kind); return ( -
- - -
@@ -534,7 +535,7 @@ export function ComposePanel({ > {t("send")} - + { resetTranslationCatalogForTests(); expect(translate("en", "inbox")).toBe("Inbox"); expect(translate("es", "inbox")).toBe("Recibidos"); + expect(translate("es", "accountMenu")).toBe("Menú de cuenta"); + expect(translate("es", "moreActions")).toBe("Más acciones"); + expect(translate("es", "trash")).toBe("Papelera"); + expect(translate("es", "formatting")).toBe("Formato"); expect(Object.keys(builtinTranslations.es).sort()).toEqual( Object.keys(builtinTranslations.en).sort(), ); diff --git a/apps/web/src/pages.tsx b/apps/web/src/pages.tsx index 08c687c..44e6a30 100644 --- a/apps/web/src/pages.tsx +++ b/apps/web/src/pages.tsx @@ -189,7 +189,7 @@ function Header({ return (
- @@ -265,7 +265,7 @@ function Header({ > -
@@ -311,7 +311,7 @@ function Header({
@@ -514,12 +517,12 @@ function Sidebar({ {t("compose")} -
@@ -735,6 +741,7 @@ function MessageRow({ onTrash, onReadToggle, onImportant, + locale, t, actionsEnabled, }: { @@ -748,6 +755,7 @@ function MessageRow({ onTrash: () => void; onReadToggle: () => void; onImportant: () => void; + locale: Locale; t: Translator; actionsEnabled: boolean; }) { @@ -835,7 +843,7 @@ function MessageRow({ {message.messageCount} @@ -961,6 +969,7 @@ function VirtualMessageList({ onStar, onOpen, onAction, + locale, t, actionsEnabled, }: { @@ -970,6 +979,7 @@ function VirtualMessageList({ onStar: (id: string, starred: boolean) => void; onOpen: (id: string) => void; onAction: (kind: MailActionKind, ids: string[]) => void; + locale: Locale; t: Translator; actionsEnabled: boolean; }) { @@ -1012,6 +1022,7 @@ function VirtualMessageList({ message.id, ]) } + locale={locale} t={t} actionsEnabled={actionsEnabled} /> @@ -1679,6 +1690,7 @@ export function MailPage({ initialLocale = "en" }: { initialLocale?: Locale }) { onSelect={toggleSelection} onOpen={setActiveThreadId} onAction={(kind, ids) => void runAction(kind, ids)} + locale={locale} t={t} onStar={(id, isStarred) => void runAction(isStarred ? "unstar" : "star", [id])} actionsEnabled={canActions} diff --git a/apps/web/tests/inbox.spec.ts b/apps/web/tests/inbox.spec.ts index fd77506..a5a8f9a 100644 --- a/apps/web/tests/inbox.spec.ts +++ b/apps/web/tests/inbox.spec.ts @@ -330,6 +330,14 @@ test("live inbox virtualizes large account-scoped pages and preserves selection" await expect(page.getByText("Sender 0", { exact: true })).toBeVisible({ timeout: 20_000 }); await expect.poll(() => Boolean(eventSocket)).toBe(true); expect(await page.locator(".message-row").count()).toBeLessThan(100); + const visualRegressionProjects = new Set(["desktop-large", "tablet-portrait", "mobile"]); + if (visualRegressionProjects.has(testInfo.project.name)) { + await expect(page).toHaveScreenshot(`inbox-${testInfo.project.name}-en.png`, { + animations: "disabled", + caret: "hide", + maxDiffPixelRatio: 0.05, + }); + } await page.getByRole("button", { name: "Account menu" }).click(); await expect(page.getByRole("menu", { name: "Accounts" })).toContainText("Personal"); @@ -343,6 +351,34 @@ test("live inbox virtualizes large account-scoped pages and preserves selection" ); await page.getByRole("menuitemradio", { name: "ES Spanish" }).click(); await expect(page.getByRole("button", { name: "ES", exact: true })).toBeVisible(); + await expect(page.getByRole("button", { name: "Alternar navegación" })).toBeVisible(); + await expect(page.getByRole("button", { name: "Notificaciones" })).toBeVisible(); + await expect(page.getByRole("button", { name: "Menú de cuenta" })).toBeVisible(); + await expect(page.getByRole("button", { name: "Más acciones" })).toBeVisible(); + await expect(page.locator("time").first()).toContainText("sept"); + if (visualRegressionProjects.has(testInfo.project.name)) { + await expect(page).toHaveScreenshot(`inbox-${testInfo.project.name}-es.png`, { + animations: "disabled", + caret: "hide", + maxDiffPixelRatio: 0.05, + }); + } + if ((page.viewportSize()?.width ?? 0) >= 1200) { + await expect(page.getByRole("navigation", { name: "Buzones" })).toBeVisible(); + await expect(page.getByRole("button", { name: "Recibidos", exact: true })).toBeVisible(); + await expect(page.getByRole("button", { name: "Developer" })).toBeHidden(); + await page.getByRole("button", { name: "Expandir Buzones" }).click(); + await expect(page.getByRole("button", { name: "Developer" })).toBeVisible(); + await page.getByRole("button", { name: "Contraer Buzones" }).click(); + await page.getByRole("button", { name: "Más", exact: true }).click(); + await expect(page.getByRole("button", { name: "Papelera", exact: true })).toBeVisible(); + await expect(page.getByRole("button", { name: "Spam", exact: true })).toBeVisible(); + await page.getByRole("button", { name: "Más", exact: true }).click(); + } + await page.locator(".message-row").first().click({ button: "right" }); + await expect(page.getByRole("menu", { name: /Acciones para Sender 0/ })).toBeVisible(); + await expect(page.getByRole("menuitem", { name: "Abrir", exact: true })).toBeVisible(); + await page.keyboard.press("Escape"); await page.getByRole("button", { name: "ES", exact: true }).click(); await page.getByRole("menuitemradio", { name: "EN Inglés" }).click(); diff --git a/apps/web/tests/inbox.spec.ts-snapshots/inbox-desktop-large-en-desktop-large-darwin.png b/apps/web/tests/inbox.spec.ts-snapshots/inbox-desktop-large-en-desktop-large-darwin.png new file mode 100644 index 0000000..c7870c3 Binary files /dev/null and b/apps/web/tests/inbox.spec.ts-snapshots/inbox-desktop-large-en-desktop-large-darwin.png differ diff --git a/apps/web/tests/inbox.spec.ts-snapshots/inbox-desktop-large-en-desktop-large-linux.png b/apps/web/tests/inbox.spec.ts-snapshots/inbox-desktop-large-en-desktop-large-linux.png new file mode 100644 index 0000000..776c191 Binary files /dev/null and b/apps/web/tests/inbox.spec.ts-snapshots/inbox-desktop-large-en-desktop-large-linux.png differ diff --git a/apps/web/tests/inbox.spec.ts-snapshots/inbox-desktop-large-es-desktop-large-darwin.png b/apps/web/tests/inbox.spec.ts-snapshots/inbox-desktop-large-es-desktop-large-darwin.png new file mode 100644 index 0000000..f0dcc4a Binary files /dev/null and b/apps/web/tests/inbox.spec.ts-snapshots/inbox-desktop-large-es-desktop-large-darwin.png differ diff --git a/apps/web/tests/inbox.spec.ts-snapshots/inbox-desktop-large-es-desktop-large-linux.png b/apps/web/tests/inbox.spec.ts-snapshots/inbox-desktop-large-es-desktop-large-linux.png new file mode 100644 index 0000000..a82da85 Binary files /dev/null and b/apps/web/tests/inbox.spec.ts-snapshots/inbox-desktop-large-es-desktop-large-linux.png differ diff --git a/apps/web/tests/inbox.spec.ts-snapshots/inbox-mobile-en-mobile-darwin.png b/apps/web/tests/inbox.spec.ts-snapshots/inbox-mobile-en-mobile-darwin.png new file mode 100644 index 0000000..a7a60c6 Binary files /dev/null and b/apps/web/tests/inbox.spec.ts-snapshots/inbox-mobile-en-mobile-darwin.png differ diff --git a/apps/web/tests/inbox.spec.ts-snapshots/inbox-mobile-en-mobile-linux.png b/apps/web/tests/inbox.spec.ts-snapshots/inbox-mobile-en-mobile-linux.png new file mode 100644 index 0000000..cc782cc Binary files /dev/null and b/apps/web/tests/inbox.spec.ts-snapshots/inbox-mobile-en-mobile-linux.png differ diff --git a/apps/web/tests/inbox.spec.ts-snapshots/inbox-mobile-es-mobile-darwin.png b/apps/web/tests/inbox.spec.ts-snapshots/inbox-mobile-es-mobile-darwin.png new file mode 100644 index 0000000..c91ed5c Binary files /dev/null and b/apps/web/tests/inbox.spec.ts-snapshots/inbox-mobile-es-mobile-darwin.png differ diff --git a/apps/web/tests/inbox.spec.ts-snapshots/inbox-mobile-es-mobile-linux.png b/apps/web/tests/inbox.spec.ts-snapshots/inbox-mobile-es-mobile-linux.png new file mode 100644 index 0000000..7aef0e2 Binary files /dev/null and b/apps/web/tests/inbox.spec.ts-snapshots/inbox-mobile-es-mobile-linux.png differ diff --git a/apps/web/tests/inbox.spec.ts-snapshots/inbox-tablet-portrait-en-tablet-portrait-darwin.png b/apps/web/tests/inbox.spec.ts-snapshots/inbox-tablet-portrait-en-tablet-portrait-darwin.png new file mode 100644 index 0000000..50c08d1 Binary files /dev/null and b/apps/web/tests/inbox.spec.ts-snapshots/inbox-tablet-portrait-en-tablet-portrait-darwin.png differ diff --git a/apps/web/tests/inbox.spec.ts-snapshots/inbox-tablet-portrait-en-tablet-portrait-linux.png b/apps/web/tests/inbox.spec.ts-snapshots/inbox-tablet-portrait-en-tablet-portrait-linux.png new file mode 100644 index 0000000..0de1b1e Binary files /dev/null and b/apps/web/tests/inbox.spec.ts-snapshots/inbox-tablet-portrait-en-tablet-portrait-linux.png differ diff --git a/apps/web/tests/inbox.spec.ts-snapshots/inbox-tablet-portrait-es-tablet-portrait-darwin.png b/apps/web/tests/inbox.spec.ts-snapshots/inbox-tablet-portrait-es-tablet-portrait-darwin.png new file mode 100644 index 0000000..32b6ab8 Binary files /dev/null and b/apps/web/tests/inbox.spec.ts-snapshots/inbox-tablet-portrait-es-tablet-portrait-darwin.png differ diff --git a/apps/web/tests/inbox.spec.ts-snapshots/inbox-tablet-portrait-es-tablet-portrait-linux.png b/apps/web/tests/inbox.spec.ts-snapshots/inbox-tablet-portrait-es-tablet-portrait-linux.png new file mode 100644 index 0000000..06fef91 Binary files /dev/null and b/apps/web/tests/inbox.spec.ts-snapshots/inbox-tablet-portrait-es-tablet-portrait-linux.png differ diff --git a/services/api/internal/modules/translations/catalogs.json b/services/api/internal/modules/translations/catalogs.json index ae73c6f..e7719cd 100644 --- a/services/api/internal/modules/translations/catalogs.json +++ b/services/api/internal/modules/translations/catalogs.json @@ -8,11 +8,20 @@ "allMail": "All mail", "drafts": "Drafts", "sent": "Sent", + "spam": "Spam", + "trash": "Trash", "more": "More", + "moreActions": "More actions", + "mailboxes": "Mailboxes", + "toggleNavigation": "Toggle navigation", + "notifications": "Notifications", + "accountMenu": "Account menu", "language": "Language", "languageEnglish": "English", "languageSpanish": "Spanish", "labels": "Labels", + "expandLabel": "Expand", + "collapseLabel": "Collapse", "accounts": "Accounts", "compose": "Compose", "search": "Search mail", @@ -99,6 +108,10 @@ "maximize": "Maximize", "close": "Close", "discardDraft": "Discard draft", + "formatting": "Formatting", + "bold": "Bold", + "italic": "Italic", + "underline": "Underline", "draft.editing": "Editing", "draft.saving": "Saving…", "draft.saved": "Saved", @@ -364,11 +377,20 @@ "allMail": "Todos", "drafts": "Borradores", "sent": "Enviados", + "spam": "Spam", + "trash": "Papelera", "more": "Más", + "moreActions": "Más acciones", + "mailboxes": "Buzones", + "toggleNavigation": "Alternar navegación", + "notifications": "Notificaciones", + "accountMenu": "Menú de cuenta", "language": "Idioma", "languageEnglish": "Inglés", "languageSpanish": "Español", "labels": "Etiquetas", + "expandLabel": "Expandir", + "collapseLabel": "Contraer", "accounts": "Cuentas", "compose": "Redactar", "search": "Buscar correo", @@ -455,6 +477,10 @@ "maximize": "Maximizar", "close": "Cerrar", "discardDraft": "Descartar borrador", + "formatting": "Formato", + "bold": "Negrita", + "italic": "Cursiva", + "underline": "Subrayado", "draft.editing": "Editando", "draft.saving": "Guardando…", "draft.saved": "Guardado",