From 1a72314e3060cf6ad238c62dfb95af061d1c8443 Mon Sep 17 00:00:00 2001 From: Ole-Morten Duesund Date: Mon, 9 Mar 2026 09:53:17 +0100 Subject: [PATCH] Legg til tilgjengelegheitsetiketter i PWA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Legg til role=img og aria-label på retningspil-canvas - Oppdater aria-label dynamisk med avstand ved val av tilfluktsrom - Legg til direction_arrow_description-streng i alle tre språk Co-Authored-By: Claude Opus 4.6 --- pwa/index.html | 2 +- pwa/src/app.ts | 2 ++ pwa/src/i18n/en.ts | 3 +++ pwa/src/i18n/nb.ts | 3 +++ pwa/src/i18n/nn.ts | 3 +++ 5 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pwa/index.html b/pwa/index.html index e5e890b..bfbd7e6 100644 --- a/pwa/index.html +++ b/pwa/index.html @@ -43,7 +43,7 @@
- +
diff --git a/pwa/src/app.ts b/pwa/src/app.ts index e1f1038..9f601c3 100644 --- a/pwa/src/app.ts +++ b/pwa/src/app.ts @@ -256,6 +256,8 @@ function updateSelectedShelter(isUserAction: boolean): void { ].join(' \u00B7 '); // Update mini arrow + const miniArrow = document.getElementById('mini-arrow')!; + miniArrow.setAttribute('aria-label', t('direction_arrow_description', dist)); updateMiniArrow(selected.bearingDegrees - deviceHeading); // Update compass view diff --git a/pwa/src/i18n/en.ts b/pwa/src/i18n/en.ts index 1a25dda..0f3fc1f 100644 --- a/pwa/src/i18n/en.ts +++ b/pwa/src/i18n/en.ts @@ -46,4 +46,7 @@ export const en: Record = { 'No cached data available. Connect to the internet to download shelter data.', update_success: 'Shelter data updated', update_failed: 'Update failed \u2014 using cached data', + + // Accessibility + direction_arrow_description: 'Direction to shelter, %s away', }; diff --git a/pwa/src/i18n/nb.ts b/pwa/src/i18n/nb.ts index 6aba9ae..9090128 100644 --- a/pwa/src/i18n/nb.ts +++ b/pwa/src/i18n/nb.ts @@ -41,4 +41,7 @@ export const nb: Record = { 'Ingen lagrede data tilgjengelig. Koble til internett for \u00e5 laste ned tilfluktsromdata.', update_success: 'Tilfluktsromdata oppdatert', update_failed: 'Oppdatering mislyktes \u2014 bruker lagrede data', + + // Tilgjengelighet + direction_arrow_description: 'Retning til tilfluktsrom, %s unna', }; diff --git a/pwa/src/i18n/nn.ts b/pwa/src/i18n/nn.ts index d66097d..39e0a5d 100644 --- a/pwa/src/i18n/nn.ts +++ b/pwa/src/i18n/nn.ts @@ -41,4 +41,7 @@ export const nn: Record = { 'Ingen lagra data tilgjengeleg. Kopla til internett for \u00e5 laste ned tilfluktsromdata.', update_success: 'Tilfluktsromdata oppdatert', update_failed: 'Oppdatering mislukkast \u2014 brukar lagra data', + + // Tilgjenge + direction_arrow_description: 'Retning til tilfluktsrom, %s unna', };