mirror of
https://github.com/google/blockly.git
synced 2026-06-01 17:00:07 +02:00
fix: dont show workspace count on apple devices (#9939)
* fix: dont show workspace count on apple devices * chore: format msg
This commit is contained in:
@@ -745,6 +745,17 @@ export class WorkspaceSvg
|
||||
* Updates the label on the workspace to reflect the number of top-level stacks in the workspace.
|
||||
*/
|
||||
private updateAriaLabel() {
|
||||
if (userAgent.APPLE) {
|
||||
// VoiceOver is reading this label inappropriately, so don't show the
|
||||
// stack count because it might be inaccurate.
|
||||
// https://github.com/RaspberryPiFoundation/blockly/issues/9885
|
||||
aria.setState(
|
||||
this.svgGroup_,
|
||||
aria.State.LABEL,
|
||||
Msg['WORKSPACE_LABEL_PLAIN'],
|
||||
);
|
||||
return;
|
||||
}
|
||||
const numStacks = this.getTopBlocks(false).length;
|
||||
if (numStacks == 1) {
|
||||
aria.setState(
|
||||
|
||||
+617
-616
File diff suppressed because it is too large
Load Diff
@@ -486,6 +486,7 @@
|
||||
"KEYBOARD_NAV_CONSTRAINED_MOVE_HINT": "Message shown to inform users how to move blocks with the keyboard.",
|
||||
"KEYBOARD_NAV_COPIED_HINT": "Message shown when an item is copied in keyboard navigation mode.",
|
||||
"KEYBOARD_NAV_CUT_HINT": "Message shown when an item is cut in keyboard navigation mode.",
|
||||
"WORKSPACE_LABEL_PLAIN": "Aria label for a workspace. Avoid using the name 'Blockly' as this could appear in branded products.",
|
||||
"WORKSPACE_LABEL_1_STACK": "Aria label for a workspace with one stack of blocks.",
|
||||
"WORKSPACE_LABEL_MANY_STACKS": "Aria label for a workspace with 0 or >1 stacks of blocks. \n\nParameters:\n* %1 - the number of stacks of blocks. A stack of blocks is a group of connected blocks that are not connected to any other blocks. 0 stacks means there are no blocks on the workspace.",
|
||||
"WORKSPACE_LABEL_MUTATOR_WORKSPACE": "Aria label for a mutator workspace, which is a secondary workspace used for editing a block's structure. This type of workspace appears when a user clicks on the gear icon of a block that has a mutator, and allows the user to add, remove, or rearrange inputs to that block.",
|
||||
|
||||
@@ -1912,6 +1912,9 @@ Blockly.Msg.KEYBOARD_NAV_COPIED_HINT = 'Copied. Press %1 to paste.';
|
||||
/// Message shown when an item is cut in keyboard navigation mode.
|
||||
Blockly.Msg.KEYBOARD_NAV_CUT_HINT = 'Cut. Press %1 to paste.';
|
||||
/** @type {string} */
|
||||
/// Aria label for a workspace. Avoid using the name "Blockly" as this could appear in branded products.
|
||||
Blockly.Msg.WORKSPACE_LABEL_PLAIN = 'Blocks workspace.';
|
||||
/** @type {string} */
|
||||
/// Aria label for a workspace with one stack of blocks.
|
||||
Blockly.Msg.WORKSPACE_LABEL_1_STACK = 'Blocks workspace. 1 stack of blocks';
|
||||
/** @type {string} */
|
||||
|
||||
Reference in New Issue
Block a user