fix(search): replace languageTag() with getLocale(); sync KI→Smart in tests
All checks were successful
CI / Unit & Component Tests (pull_request) Successful in 3m24s
CI / OCR Service Tests (pull_request) Successful in 26s
CI / Backend Unit Tests (pull_request) Successful in 3m57s
CI / fail2ban Regex (pull_request) Successful in 46s
CI / Semgrep Security Scan (pull_request) Successful in 23s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m7s

Paraglide 2.5 runtime exports getLocale(), not languageTag(). The
8bed0cc6 commit introduced the wrong import when threading lang through
the NL search path.

Also updates two test assertions that still expected the old 'KI' button
label after 0b31a51e renamed it to 'Smart-Suche'.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-06-07 17:44:38 +02:00
parent 15dff2a7b9
commit f41acfb29e
3 changed files with 4 additions and 4 deletions

View File

@@ -209,7 +209,7 @@ describe('SearchFilterBar smart-mode chip lifecycle hooks', () => {
smartMode: true,
onModeToggle
});
await page.getByRole('button', { name: /KI/ }).click();
await page.getByRole('button', { name: /Smart/ }).click();
expect(onModeToggle).toHaveBeenCalledOnce();
});

View File

@@ -17,7 +17,7 @@ import { bulkSelectionStore } from '$lib/document/bulkSelection.svelte';
import { getErrorMessage, parseBackendError } from '$lib/shared/errors';
import { csrfFetch } from '$lib/shared/cookies';
import * as m from '$lib/paraglide/messages.js';
import { languageTag } from '$lib/paraglide/runtime';
import { getLocale } from '$lib/paraglide/runtime';
import type { components } from '$lib/generated/api';
type NlQueryInterpretation = components['schemas']['NlQueryInterpretation'];
@@ -225,7 +225,7 @@ async function runSmartSearch() {
const res = await csrfFetch('/api/search/nl', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ query, lang: languageTag() })
body: JSON.stringify({ query, lang: getLocale() })
});
if (!res.ok) {
const backend = await parseBackendError(res);

View File

@@ -22,7 +22,7 @@ describe('SmartModeToggle', () => {
it('shows the smart label when smartMode is true', async () => {
render(SmartModeToggle, { smartMode: true });
const btn = page.getByRole('button');
await expect.element(btn).toHaveTextContent('KI');
await expect.element(btn).toHaveTextContent('Smart');
});
it('shows the keyword label when smartMode is false', async () => {