A11y: various improvements
This commit is contained in:
parent
0d4f2c9c36
commit
5fa2ddd9c1
23 changed files with 327 additions and 98 deletions
|
@ -1,4 +1,5 @@
|
|||
import { Translation } from "../UI/i18n/Translation"
|
||||
import Locale from "../UI/i18n/Locale"
|
||||
|
||||
export function ariaLabel(htmlElement: Element, t: Translation) {
|
||||
if (!t) {
|
||||
|
@ -6,6 +7,19 @@ export function ariaLabel(htmlElement: Element, t: Translation) {
|
|||
}
|
||||
let destroy: () => void = undefined
|
||||
|
||||
Locale.language.map((language) => {
|
||||
if (!t.translations[language]) {
|
||||
console.log(
|
||||
"No aria label in",
|
||||
language,
|
||||
"for",
|
||||
t.context,
|
||||
"; en is",
|
||||
t.translations["en"]
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
t.current.map(
|
||||
(label) => {
|
||||
htmlElement.setAttribute("aria-label", label)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue