i18n(briefwechsel): ThumbnailRow direction label via Paraglide
Adds row_direction_sent / row_direction_received keys across the three locale files (de: Gesendet/Empfangen, en: Sent/Received, es: Enviada/Recibida) and routes ThumbnailRow's directionLabel through Paraglide. An English or Spanish screen-reader user now hears "Sent:" / "Enviada:" in their language, matching the DistributionBar i18n pass. Refs #305 Fixes @leonievoss round-2 follow-up from PR review Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { describe, it, expect, afterEach } from 'vitest';
|
||||
import { cleanup, render } from 'vitest-browser-svelte';
|
||||
import * as m from '$lib/paraglide/messages.js';
|
||||
|
||||
import ThumbnailRow from './ThumbnailRow.svelte';
|
||||
|
||||
@@ -151,12 +152,14 @@ describe('ThumbnailRow', () => {
|
||||
|
||||
const link = document.querySelector('a[href="/documents/d1"]') as HTMLElement;
|
||||
const label = link.getAttribute('aria-label') ?? '';
|
||||
expect(label).toMatch(/^Gesendet:/);
|
||||
// Direction label routes through Paraglide so EN / ES users don't hear
|
||||
// "Gesendet" in their screen reader.
|
||||
expect(label.startsWith(`${m.row_direction_sent()}:`)).toBe(true);
|
||||
expect(label).toContain('Liebe Anna');
|
||||
expect(label).toMatch(/1950/);
|
||||
});
|
||||
|
||||
it('aria-label begins with "Empfangen:" for incoming letters', () => {
|
||||
it('aria-label leads with the received direction label for incoming letters', () => {
|
||||
render(ThumbnailRow, {
|
||||
doc: baseDoc,
|
||||
isOut: false,
|
||||
@@ -165,7 +168,8 @@ describe('ThumbnailRow', () => {
|
||||
});
|
||||
|
||||
const link = document.querySelector('a[href="/documents/d1"]') as HTMLElement;
|
||||
expect(link.getAttribute('aria-label') ?? '').toMatch(/^Empfangen:/);
|
||||
const label = link.getAttribute('aria-label') ?? '';
|
||||
expect(label.startsWith(`${m.row_direction_received()}:`)).toBe(true);
|
||||
});
|
||||
|
||||
it('does not inject raw HTML when summary contains markup (XSS regression)', () => {
|
||||
|
||||
Reference in New Issue
Block a user