Skip to content

Simulator accessibility improvements. #948

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

Merged
merged 10 commits into from
Sep 12, 2022
8 changes: 8 additions & 0 deletions lang/ui.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,10 @@
"defaultMessage": "Radio",
"description": "Radio simulator panel title"
},
"simulator-radio-code": {
"defaultMessage": "micro:bit sent:",
"description": "Visually hidden text for a radio message sent from the simulated micro:bit. Text of the message follows."
},
"simulator-radio-group-notice": {
"defaultMessage": "Radio group set to {groupNumber}",
"description": "Message in radio simulator area when the radio group changes"
Expand All @@ -927,6 +931,10 @@
"defaultMessage": "Send message",
"description": "Aria label for the simulator radio send button"
},
"simulator-radio-user": {
"defaultMessage": "You sent:",
"description": "Visually hidden text for a radio message sent from the user to the simulated micro:bit. Text of the message follows."
},
"simulator-reference-link": {
"defaultMessage": "Link to Reference section",
"description": "Aria label for simulator Reference link button"
Expand Down
8 changes: 8 additions & 0 deletions lang/ui.es-es.json
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,10 @@
"defaultMessage": "Radio",
"description": "Radio simulator panel title"
},
"simulator-radio-code": {
"defaultMessage": "Radio message from the micro:bit simulator",
"description": "Aria label for a message sent from the micro:bit simulator"
},
"simulator-radio-group-notice": {
"defaultMessage": "Grupo de radio configurado a {groupNumber}",
"description": "Message in radio simulator area when the radio group changes"
Expand All @@ -926,6 +930,10 @@
"defaultMessage": "Enviar mensaje",
"description": "Aria label for the simulator radio send button"
},
"simulator-radio-user": {
"defaultMessage": "Radio message to the micro:bit simulator",
"description": "Aria label for a message sent to the micro:bit simulator"
},
"simulator-reference-link": {
"defaultMessage": "Enlace a la sección de referencia",
"description": "Aria label for simulator Reference link button"
Expand Down
8 changes: 8 additions & 0 deletions lang/ui.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,10 @@
"defaultMessage": "Radio",
"description": "Radio simulator panel title"
},
"simulator-radio-code": {
"defaultMessage": "Radio message from the micro:bit simulator",
"description": "Aria label for a message sent from the micro:bit simulator"
},
"simulator-radio-group-notice": {
"defaultMessage": "Le groupe radio est réglé sur {groupNumber}",
"description": "Message in radio simulator area when the radio group changes"
Expand All @@ -926,6 +930,10 @@
"defaultMessage": "Envoyer un message",
"description": "Aria label for the simulator radio send button"
},
"simulator-radio-user": {
"defaultMessage": "Radio message to the micro:bit simulator",
"description": "Aria label for a message sent to the micro:bit simulator"
},
"simulator-reference-link": {
"defaultMessage": "Lien vers la section de référence",
"description": "Aria label for simulator Reference link button"
Expand Down
8 changes: 8 additions & 0 deletions lang/ui.ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,10 @@
"defaultMessage": "無線",
"description": "Radio simulator panel title"
},
"simulator-radio-code": {
"defaultMessage": "Radio message from the micro:bit simulator",
"description": "Aria label for a message sent from the micro:bit simulator"
},
"simulator-radio-group-notice": {
"defaultMessage": "無線のグループを{groupNumber}に設定",
"description": "Message in radio simulator area when the radio group changes"
Expand All @@ -926,6 +930,10 @@
"defaultMessage": "メッセージを送信",
"description": "Aria label for the simulator radio send button"
},
"simulator-radio-user": {
"defaultMessage": "Radio message to the micro:bit simulator",
"description": "Aria label for a message sent to the micro:bit simulator"
},
"simulator-reference-link": {
"defaultMessage": "参照セクションへのリンク",
"description": "Aria label for simulator Reference link button"
Expand Down
8 changes: 8 additions & 0 deletions lang/ui.ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,10 @@
"defaultMessage": "라디오",
"description": "Radio simulator panel title"
},
"simulator-radio-code": {
"defaultMessage": "Radio message from the micro:bit simulator",
"description": "Aria label for a message sent from the micro:bit simulator"
},
"simulator-radio-group-notice": {
"defaultMessage": "라디오 그룹이 {groupNumber}(으)로 설정됨",
"description": "Message in radio simulator area when the radio group changes"
Expand All @@ -926,6 +930,10 @@
"defaultMessage": "메시지 전송",
"description": "Aria label for the simulator radio send button"
},
"simulator-radio-user": {
"defaultMessage": "Radio message to the micro:bit simulator",
"description": "Aria label for a message sent to the micro:bit simulator"
},
"simulator-reference-link": {
"defaultMessage": "레퍼런스 섹션에 링크하기",
"description": "Aria label for simulator Reference link button"
Expand Down
8 changes: 8 additions & 0 deletions lang/ui.zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,10 @@
"defaultMessage": "无线电",
"description": "Radio simulator panel title"
},
"simulator-radio-code": {
"defaultMessage": "Radio message from the micro:bit simulator",
"description": "Aria label for a message sent from the micro:bit simulator"
},
"simulator-radio-group-notice": {
"defaultMessage": "无线电组设置为 {groupNumber}",
"description": "Message in radio simulator area when the radio group changes"
Expand All @@ -926,6 +930,10 @@
"defaultMessage": "发送消息",
"description": "Aria label for the simulator radio send button"
},
"simulator-radio-user": {
"defaultMessage": "Radio message to the micro:bit simulator",
"description": "Aria label for a message sent to the micro:bit simulator"
},
"simulator-reference-link": {
"defaultMessage": "链接到 Reference (参考)部分",
"description": "Aria label for simulator Reference link button"
Expand Down
8 changes: 8 additions & 0 deletions lang/ui.zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,10 @@
"defaultMessage": "無線電",
"description": "Radio simulator panel title"
},
"simulator-radio-code": {
"defaultMessage": "Radio message from the micro:bit simulator",
"description": "Aria label for a message sent from the micro:bit simulator"
},
"simulator-radio-group-notice": {
"defaultMessage": "無線電組設定為 {groupNumber}",
"description": "Message in radio simulator area when the radio group changes"
Expand All @@ -926,6 +930,10 @@
"defaultMessage": "傳送訊息",
"description": "Aria label for the simulator radio send button"
},
"simulator-radio-user": {
"defaultMessage": "Radio message to the micro:bit simulator",
"description": "Aria label for a message sent to the micro:bit simulator"
},
"simulator-reference-link": {
"defaultMessage": "參考區的連結",
"description": "Aria label for simulator Reference link button"
Expand Down
12 changes: 12 additions & 0 deletions src/messages/ui.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2017,6 +2017,12 @@
"value": "Radio"
}
],
"simulator-radio-code": [
{
"type": 0,
"value": "micro:bit sent:"
}
],
"simulator-radio-group-notice": [
{
"type": 0,
Expand Down Expand Up @@ -2057,6 +2063,12 @@
"value": "Send message"
}
],
"simulator-radio-user": [
{
"type": 0,
"value": "You sent:"
}
],
"simulator-reference-link": [
{
"type": 0,
Expand Down
12 changes: 12 additions & 0 deletions src/messages/ui.es-es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2009,6 +2009,12 @@
"value": "Radio"
}
],
"simulator-radio-code": [
{
"type": 0,
"value": "Radio message from the micro:bit simulator"
}
],
"simulator-radio-group-notice": [
{
"type": 0,
Expand Down Expand Up @@ -2049,6 +2055,12 @@
"value": "Enviar mensaje"
}
],
"simulator-radio-user": [
{
"type": 0,
"value": "Radio message to the micro:bit simulator"
}
],
"simulator-reference-link": [
{
"type": 0,
Expand Down
12 changes: 12 additions & 0 deletions src/messages/ui.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2009,6 +2009,12 @@
"value": "Radio"
}
],
"simulator-radio-code": [
{
"type": 0,
"value": "Radio message from the micro:bit simulator"
}
],
"simulator-radio-group-notice": [
{
"type": 0,
Expand Down Expand Up @@ -2049,6 +2055,12 @@
"value": "Envoyer un message"
}
],
"simulator-radio-user": [
{
"type": 0,
"value": "Radio message to the micro:bit simulator"
}
],
"simulator-reference-link": [
{
"type": 0,
Expand Down
12 changes: 12 additions & 0 deletions src/messages/ui.ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -1999,6 +1999,12 @@
"value": "無線"
}
],
"simulator-radio-code": [
{
"type": 0,
"value": "Radio message from the micro:bit simulator"
}
],
"simulator-radio-group-notice": [
{
"type": 0,
Expand Down Expand Up @@ -2043,6 +2049,12 @@
"value": "メッセージを送信"
}
],
"simulator-radio-user": [
{
"type": 0,
"value": "Radio message to the micro:bit simulator"
}
],
"simulator-reference-link": [
{
"type": 0,
Expand Down
12 changes: 12 additions & 0 deletions src/messages/ui.ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -2017,6 +2017,12 @@
"value": "라디오"
}
],
"simulator-radio-code": [
{
"type": 0,
"value": "Radio message from the micro:bit simulator"
}
],
"simulator-radio-group-notice": [
{
"type": 0,
Expand Down Expand Up @@ -2061,6 +2067,12 @@
"value": "메시지 전송"
}
],
"simulator-radio-user": [
{
"type": 0,
"value": "Radio message to the micro:bit simulator"
}
],
"simulator-reference-link": [
{
"type": 0,
Expand Down
12 changes: 12 additions & 0 deletions src/messages/ui.zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -2014,6 +2014,12 @@
"value": "无线电"
}
],
"simulator-radio-code": [
{
"type": 0,
"value": "Radio message from the micro:bit simulator"
}
],
"simulator-radio-group-notice": [
{
"type": 0,
Expand Down Expand Up @@ -2054,6 +2060,12 @@
"value": "发送消息"
}
],
"simulator-radio-user": [
{
"type": 0,
"value": "Radio message to the micro:bit simulator"
}
],
"simulator-reference-link": [
{
"type": 0,
Expand Down
12 changes: 12 additions & 0 deletions src/messages/ui.zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -2006,6 +2006,12 @@
"value": "無線電"
}
],
"simulator-radio-code": [
{
"type": 0,
"value": "Radio message from the micro:bit simulator"
}
],
"simulator-radio-group-notice": [
{
"type": 0,
Expand Down Expand Up @@ -2046,6 +2052,12 @@
"value": "傳送訊息"
}
],
"simulator-radio-user": [
{
"type": 0,
"value": "Radio message to the micro:bit simulator"
}
],
"simulator-reference-link": [
{
"type": 0,
Expand Down
18 changes: 11 additions & 7 deletions src/simulator/CompassModule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
import { Box, HStack, Icon, Stack, Text } from "@chakra-ui/react";
import { ReactNode, useEffect, useRef } from "react";
import { FormattedMessage } from "react-intl";
import { FormattedMessage, useIntl } from "react-intl";
import {
RangeSensor as RangeSensorType,
SensorStateKey,
Expand All @@ -29,6 +29,7 @@ const CompassModule = ({
minimised,
}: CompassModuleProps) => {
const ref = useRef<SVGSVGElement>(null);
const intl = useIntl();
const compassHeading = state["compassHeading"];
useEffect(() => {
const needle = ref.current?.querySelector("#Needle");
Expand All @@ -44,7 +45,7 @@ const CompassModule = ({
<RangeSensor
id="compassHeading"
icon={icon}
title="compass heading"
title={intl.formatMessage({ id: "simulator-compass-heading-one" })}
sensor={compassHeading as RangeSensorType}
onSensorChange={onValueChange}
minimised={minimised}
Expand All @@ -55,11 +56,14 @@ const CompassModule = ({
<FormattedMessage id="simulator-compass-heading-one" />
</Text>
<HStack spacing={3} pl={4} width="100%">
<Axis
axis="compassHeading"
label=""
state={state}
onValueChange={onValueChange}
<RangeSensor
id="compassHeading"
title={intl.formatMessage({
id: "simulator-compass-heading-one",
})}
sensor={compassHeading as RangeSensorType}
onSensorChange={onValueChange}
minimised={minimised}
/>
<Icon
ref={ref}
Expand Down
Loading