From 89cb00cc834cbd6070983bf58270f41a2030d78d Mon Sep 17 00:00:00 2001 From: "Louis Wicket (wil)" Date: Thu, 3 Apr 2025 18:13:06 +0200 Subject: [PATCH] [IMP] compiler: make human-readable ARIA attributes translatable ARIA attributes containing human-readable text should be translated. This commit adds human-readable ARIA attributes to the list of the attributes translated by OWL. --- src/compiler/code_generator.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/compiler/code_generator.ts b/src/compiler/code_generator.ts index 407d5cc8..11839c88 100644 --- a/src/compiler/code_generator.ts +++ b/src/compiler/code_generator.ts @@ -254,7 +254,16 @@ class CodeTarget { } } -const TRANSLATABLE_ATTRS = ["label", "title", "placeholder", "alt"]; +const TRANSLATABLE_ATTRS = [ + "alt", + "aria-label", + "aria-placeholder", + "aria-roledescription", + "aria-valuetext", + "label", + "placeholder", + "title", +]; const translationRE = /^(\s*)([\s\S]+?)(\s*)$/; export class CodeGenerator {