Legg til TalkBack-støtte og nordindikator på kompasset

Tilgjengelegheit (Android + PWA):
- Semantiske landemerke (header, main, aside, role=dialog)
- aria-live-regionar for statusoppdateringar og lasteoverlegg
- Fokusindikatorar (:focus-visible) og prefers-reduced-motion
- Auka trykkmål til 48dp (infoknapp, oppdater, del, widget)
- contentDescription på kart, kompass og framdriftsindikator
- aria-current og role=listitem på tilfluktsromliste
- Fokusfangst og fokusgjenoppretting i lasteoverlegg
- Ikkje-farge-indikator (▶) for valt tilfluktsrom
- Dynamisk lang-attributt basert på oppdaga språk
- Lokaliserte aria-label (en/nb/nn)

Nordindikator:
- DirectionArrowView teiknar diskret «N»-markør på omkrinsen
- Roterer uavhengig av hovudpila for kompasskalibrering
- Berre på stor kompassvisning, ikkje minipila

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2026-03-23 14:02:32 +01:00
commit 6ba35add2f
17 changed files with 240 additions and 36 deletions

View file

@ -49,4 +49,8 @@ export const en: Record<string, string> = {
// Accessibility
direction_arrow_description: 'Direction to shelter, %s away',
a11y_map: 'Map',
a11y_compass: 'Compass',
a11y_shelter_info: 'Shelter info',
a11y_nearest_shelters: 'Nearest shelters',
};

View file

@ -11,21 +11,22 @@ const locales: Record<string, Record<string, string>> = { en, nb, nn };
let currentLocale = 'en';
/** Detect and set locale from browser preferences. */
/** Detect and set locale from browser preferences, update document lang. */
export function initLocale(): void {
const langs = navigator.languages ?? [navigator.language];
for (const lang of langs) {
const code = lang.toLowerCase().split('-')[0];
if (code in locales) {
currentLocale = code;
return;
break;
}
// nb and nn both start with "n" — also match "no" as Bokmål
if (code === 'no') {
currentLocale = 'nb';
return;
break;
}
}
document.documentElement.lang = currentLocale;
}
/** Get current locale code. */

View file

@ -44,4 +44,8 @@ export const nb: Record<string, string> = {
// Tilgjengelighet
direction_arrow_description: 'Retning til tilfluktsrom, %s unna',
a11y_map: 'Kart',
a11y_compass: 'Kompass',
a11y_shelter_info: 'Tilfluktsrominfo',
a11y_nearest_shelters: 'Nærmeste tilfluktsrom',
};

View file

@ -44,4 +44,8 @@ export const nn: Record<string, string> = {
// Tilgjenge
direction_arrow_description: 'Retning til tilfluktsrom, %s unna',
a11y_map: 'Kart',
a11y_compass: 'Kompass',
a11y_shelter_info: 'Tilfluktsrominfo',
a11y_nearest_shelters: 'Nærmaste tilfluktsrom',
};