Skip to content

Commit 9c68c38

Browse files
committed
Change the close button to have the assistive text in the same language as the toast based on accessibility specialist feedback
1 parent 3af7dea commit 9c68c38

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

hdbt.theme

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,14 +708,17 @@ function hdbt_preprocess_links__language_block(&$variables): void {
708708
'en' => [
709709
'toast_text' => "This page is not available in English. Go to the homepage to access the website's English-language content.",
710710
'toast_link_title' => 'Return to the front page',
711+
'toast_close_button' => 'Close the popup',
711712
],
712713
'fi' => [
713714
'toast_text' => 'Tätä sivua ei ole suomeksi. Löydät muuta suomenkielistä sisältöä etusivun kautta.',
714715
'toast_link_title' => 'Siirry etusivulle',
716+
'toast_close_button' => 'Sulje ponnahdusikkuna',
715717
],
716718
'sv' => [
717719
'toast_text' => 'Denna sida finns inte på svenska. Gå till startsidan för att se annat material på svenska.',
718720
'toast_link_title' => 'Gå till startsidan',
721+
'toast_close_button' => 'Stäng popup-fönstret',
719722
],
720723
];
721724

templates/navigation/links--language-block.html.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@
6262
{% set language_toast_close_labelled_by = "language-toast__close__aria-label--" ~ random() %}
6363
<div class="language-toast__close-wrapper">
6464
<a href="#" class="nav-toggle__anchor language-toast__close">
65-
<span class="is-hidden" lang="{{ language.id }}">{{ 'Close the popup'|t({}, {'context': 'Language toast'}) }}</span>
65+
<span class="is-hidden">{{ toast_languages[lang].toast_close_button }}</span>
6666
</a>
67-
<button class="nav-toggle__button language-toast__close js-language-toast--{{ lang }}-button" aria-labelledby="{{ language_toast_close_labelled_by }}" aria-expanded="false" aria-controls="{{ dropdown_id }}" lang="{{ language.id }}">
68-
<span id="{{language_toast_close_labelled_by}}" class="is-hidden">{{ 'Close the popup'|t({}, {'context': 'Language toast'}) }}</span>
67+
<button class="nav-toggle__button language-toast__close js-language-toast--{{ lang }}-button" aria-labelledby="{{ language_toast_close_labelled_by }}" aria-expanded="false" aria-controls="{{ dropdown_id }}">
68+
<span id="{{language_toast_close_labelled_by}}" class="is-hidden">{{ toast_languages[lang].toast_close_button }}</span>
6969
</button>
7070
</div>
7171
<div class="language-toast__content" lang="{{ lang }}">

0 commit comments

Comments
 (0)