fix(a11y): every sortable list speaks the user's language to a screen reader
dnd-kit's screen-reader text is hard-coded English and names an item by its id ("Draggable item
10357 was dropped", a role of "sortable"). Only the YouTube playlist replaced it; the Plex playlist,
the saved-views list and the side-panel groups read it out under a Hungarian UI — found while
checking the Plex playlist's keyboard reorder on localdev.
`ui/sortableA11y` is now the one place: `useSortableA11y` gives a DndContext its instructions and
announcements (HU/EN, `common.dnd.*`), `useSortableItem` announces the role. The YouTube playlist's
own announcements move onto it, which also fixes them: its lists reorder on drop, so reading the
dragged row's own index said "moved to position 1" at every step and "dropped at position 1"
wherever the row went. The place announced is now the slot the row would land in.
A `local/sortable-a11y` lint rule (with its contract test) refuses a DndContext without
`accessibility` and a direct `useSortable`.
This commit is contained in:
@@ -35,5 +35,13 @@
|
||||
"moreRefine": "{{count}} more — refine with search",
|
||||
"matchMode": "Match",
|
||||
"removeNamed": "Remove {{name}}",
|
||||
"resetNamed": "Reset {{name}}"
|
||||
"resetNamed": "Reset {{name}}",
|
||||
"dnd": {
|
||||
"instructions": "Press space to pick up an item, the arrow keys to move it, space again to drop it, or escape to cancel.",
|
||||
"roleDescription": "movable item",
|
||||
"pickedUp": "Picked up “{{title}}”, position {{pos}} of {{total}}.",
|
||||
"movedOver": "“{{title}}” moved to position {{pos}} of {{total}}.",
|
||||
"dropped": "“{{title}}” dropped at position {{pos}} of {{total}}.",
|
||||
"cancelled": "Move cancelled; “{{title}}” is back at position {{pos}}."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,11 +113,6 @@
|
||||
"confirmDeleteLinked": "Delete the playlist “{{name}}”? It is synced with YouTube — choose whether to delete it there as well. This can't be undone.",
|
||||
"dragBlockedBuiltin": "This list's order is fixed — it can't be reordered by hand.",
|
||||
"deleteBoth": "Delete here and on YouTube",
|
||||
"dndInstructions": "Press space to pick up a video, the arrow keys to move it, space again to drop it, or escape to cancel.",
|
||||
"dndPickedUp": "Picked up “{{title}}”, position {{pos}} of {{total}}.",
|
||||
"dndMovedOver": "“{{title}}” moved to position {{pos}} of {{total}}.",
|
||||
"dndDropped": "“{{title}}” dropped at position {{pos}} of {{total}}.",
|
||||
"dndCancelled": "Move cancelled; “{{title}}” is back at position {{pos}}.",
|
||||
"viewGrouped": "grouped by channel",
|
||||
"viewGroupedAnd": "grouped by channel, {{sort}}",
|
||||
"viewDiffers": "Temporary view ({{view}}) — the playlist's saved order is unchanged. Save it to keep this order.",
|
||||
|
||||
@@ -35,5 +35,13 @@
|
||||
"moreRefine": "még {{count}} — finomíts kereséssel",
|
||||
"matchMode": "Egyezés",
|
||||
"removeNamed": "{{name}}: eltávolítás",
|
||||
"resetNamed": "{{name}}: alaphelyzet"
|
||||
"resetNamed": "{{name}}: alaphelyzet",
|
||||
"dnd": {
|
||||
"instructions": "Szóközzel felveszed az elemet, a nyilakkal mozgatod, újabb szóközzel leteszed, Escape-pel megszakítod.",
|
||||
"roleDescription": "mozgatható elem",
|
||||
"pickedUp": "„{{title}}” felvéve, {{pos}}. a(z) {{total}} közül.",
|
||||
"movedOver": "„{{title}}” a(z) {{pos}}. helyre került a(z) {{total}} közül.",
|
||||
"dropped": "„{{title}}” letéve a(z) {{pos}}. helyre a(z) {{total}} közül.",
|
||||
"cancelled": "Mozgatás megszakítva; „{{title}}” visszakerült a(z) {{pos}}. helyre."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,11 +113,6 @@
|
||||
"confirmDeleteLinked": "Törlöd a(z) „{{name}}” listát? A YouTube-bal szinkronban van — válaszd ki, hogy ott is törlődjön-e. Nem vonható vissza.",
|
||||
"dragBlockedBuiltin": "Ennek a listának kötött a sorrendje — kézzel nem rendezhető át.",
|
||||
"deleteBoth": "Törlés itt és a YouTube-on",
|
||||
"dndInstructions": "Szóközzel felveszed a videót, a nyilakkal mozgatod, újabb szóközzel leteszed, Escape-pel megszakítod.",
|
||||
"dndPickedUp": "„{{title}}” felvéve, {{pos}}. a(z) {{total}} közül.",
|
||||
"dndMovedOver": "„{{title}}” a(z) {{pos}}. helyre került a(z) {{total}} közül.",
|
||||
"dndDropped": "„{{title}}” letéve a(z) {{pos}}. helyre a(z) {{total}} közül.",
|
||||
"dndCancelled": "Mozgatás megszakítva; „{{title}}” visszakerült a(z) {{pos}}. helyre.",
|
||||
"viewGrouped": "csatorna szerint csoportosítva",
|
||||
"viewGroupedAnd": "csatorna szerint csoportosítva, {{sort}}",
|
||||
"viewDiffers": "Ideiglenes nézet ({{view}}) — a lista mentett sorrendje változatlan. Mentsd, ha ez maradjon.",
|
||||
|
||||
Reference in New Issue
Block a user