-
Notifications
You must be signed in to change notification settings - Fork 171
feat(a11y): announce dynamic location in Santa tracker button #239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| let label = _msg`santasearch_character_santa`; | ||
| if (this.locationLabel) { | ||
| if (this.stop) { | ||
| label = label + ` is at ${this.locationLabel}`; | ||
| } else { | ||
| label = label + ` is heading to ${this.locationLabel}`; | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. I think this might end up being awkward for languages other than English. Might need to figure out how to dynamically generate this string in a way that works for multiple languages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. I think a better way would be to add translation entries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed it to use translation entries and replace {{location}} variable.


This PR fixes an accessibility issue where the "Santa image" button only announced "Santa Claus" without providing context about his current location or status. Screen reader users would land on the button but receive no useful information about where Santa currently is in the world.
Changes
SantaSantaElementto accept a locationLabel property and dynamically update the button text.ModvilTrackerElementto extract the city and region from the data manager and pass it correctly to thesanta-santacomponent.tracker_santa_is_atandtracker_santa_is_heading_towith{{location}}placeholders to ensure proper grammar and translation across languages.en,en-GB,zh-CN,zh-TW,zh-HK,ja, andko.Impacted UI components
modvil-tracker)santa-santa)