fix(journeyinterlude): use i18n aria-label instead of hardcoded German
Replaces aria-label="Kuratorennotiz" with m.journey_interlude_aria_label() so screen readers get the correct label in all three supported locales. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { m } from '$lib/paraglide/messages.js';
|
||||
|
||||
interface Props {
|
||||
note: string;
|
||||
}
|
||||
@@ -7,7 +9,7 @@ let { note }: Props = $props();
|
||||
</script>
|
||||
|
||||
<div
|
||||
aria-label="Kuratorennotiz"
|
||||
aria-label={m.journey_interlude_aria_label()}
|
||||
class="my-2 border-l-4 border-journey-border bg-journey-tint px-4 py-3"
|
||||
>
|
||||
<p
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { describe, it, expect, afterEach } from 'vitest';
|
||||
import { cleanup, render } from 'vitest-browser-svelte';
|
||||
import { page } from 'vitest/browser';
|
||||
import { m } from '$lib/paraglide/messages.js';
|
||||
|
||||
const { default: JourneyInterlude } = await import('./JourneyInterlude.svelte');
|
||||
|
||||
@@ -19,10 +20,10 @@ describe('JourneyInterlude', () => {
|
||||
await expect.element(page.getByText('Eine kurze Pause auf der Reise.')).toBeVisible();
|
||||
});
|
||||
|
||||
it('has aria-label Kuratorennotiz', async () => {
|
||||
it('has aria-label from i18n (journey_interlude_aria_label)', async () => {
|
||||
render(JourneyInterlude, { props: { note: 'Notiz' } });
|
||||
|
||||
const el = document.querySelector('[aria-label="Kuratorennotiz"]');
|
||||
const el = document.querySelector(`[aria-label="${m.journey_interlude_aria_label()}"]`);
|
||||
expect(el).not.toBeNull();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user