Localization
Every string the canvas reads out or labels itself with comes from one BlowAriaLabels object, and the control bar and the minimap take theirs as parameters, so a flow can be translated without reimplementing its accessibility. Switch language and use the flow from the keyboard: the panel shows what a screen reader hears.
Announced
-
Press Tab to move between the nodes and edges of the diagram.
Press Enter or Space to select it, Shift with Enter to add it to the selection, the arrow keys to move the selected nodes, Delete to remove them and Escape to clear the selection. Press C to start a connection from it.
Press Enter or Space to select it, Delete to remove it and Escape to clear the selection. Press C to move its end to another node.
bit BlowTry it
- Pick English, Deutsch or فارسی. Persian also lays the text in the flow out right to left.
- Click the background, Tab to a node and press Enter: the panel shows the selection announced in that language. Move the node with the arrow keys and the move is announced too.
- On Start, press C to start a connection, then Tab on: on Review you hear why it cannot connect - the two are already joined - and on Publish that Enter would connect. Press Enter there.
- Tab to the edge and press C to pick up its end, Tab to another node and press Enter to move it there.
- Select something and press Delete: the deletion is announced with its counts.
- Hover the control bar's buttons for their translated tooltips, and press the lock button: dragging, connecting and selecting stop, and its tooltip offers to unlock.
- With a screen reader on, each node is also read with its translated role ("Knoten"), its state ("Nicht verbunden.") and the keys it answers to; the minimap and the control bar are read by their translated names.
How it works
AriaLabelstakes aBlowAriaLabels: role descriptions, names, states, every announcement and the keyboard instructions. A member left out keeps its English default (BlowAriaLabels.Default). The page builds a new set when the language changes rather than on every render, since the canvas redraws every node and edge whenever it is handed a different set.- The members are functions rather than format strings -
NodeSelected = name => $"{name} ausgewählt"- so a translation can reorder or drop the values it is handed. - The panel sees what the live region gets because
Recordwraps each announcement function to copy its result there.SelectionClearedand the two "cancelled" messages are plain strings, so they reach the live region without passing through the panel. - The canvas's own
AriaLabelis the app's to translate, and attributes it does not set itself -aria-roledescription,dir- pass straight through to its element. BlowControlstakesAriaLabel,ZoomInLabel,ZoomOutLabel,FitViewLabel,LockLabelandUnlockLabel. The lock button shows withShowInteractive, and@bind-InteractivedrivesNodesDraggable,NodesConnectableandElementsSelectable.BlowMiniMaptakesAriaLabel,RoleDescriptionandKeyboardInstructions; left null, the instructions describe its keys in English.DefaultViewportsets the pan and zoom the flow opens at, where other examples fit the graph instead.