Skip to content

Commit

Permalink
Improve error handling for WebUSB issues (#1164)
Browse files Browse the repository at this point in the history
Use a dialog to show WebUSB errors with clearer action for the user.
  • Loading branch information
microbit-robert authored May 3, 2024
1 parent 2126e74 commit 9bfff59
Show file tree
Hide file tree
Showing 24 changed files with 208 additions and 397 deletions.
8 changes: 0 additions & 8 deletions lang/ui.ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -1130,14 +1130,6 @@
"defaultMessage": "Torna a connectar la teva micro:bit i torna-ho a provar.",
"description": "Part of WebUSB error message"
},
"webusb-error-update-req-description": {
"defaultMessage": "Has d'<link>actualitzar el microprogramari de la teva micro:bit </link> per fer ús d'aquesta característica.",
"description": "WebUSB error telling user to update firmware"
},
"webusb-error-update-req-title": {
"defaultMessage": "Actualitza el microprogramari de la micro:bit ",
"description": "Error text telling user to update firmware"
},
"webusb-not-supported": {
"defaultMessage": "Malauradament, WebUSB no és compatible amb aquest navegador i el teu programa es desarà al teu ordinador. Segueix els passos de la pantalla següent per transferir-lo ala teva micro:bit. Et recomanem Google Chrome o Microsoft Edge perquè et puguis connectar directament a la teva micro:bit.",
"description": "Explantion shown when user's browser doesn't support WebUSB"
Expand Down
8 changes: 0 additions & 8 deletions lang/ui.de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1130,14 +1130,6 @@
"defaultMessage": "Bitte schließe deinen micro:bit erneut an und versuche es nochmal.",
"description": "Part of WebUSB error message"
},
"webusb-error-update-req-description": {
"defaultMessage": "Um diese Funktion nutzen zu können, musst du deine <link>micro:bit Firmware aktualisieren </link>.",
"description": "WebUSB error telling user to update firmware"
},
"webusb-error-update-req-title": {
"defaultMessage": "Bitte aktualisiere die micro:bit Firmware",
"description": "Error text telling user to update firmware"
},
"webusb-not-supported": {
"defaultMessage": "Leider wird WebUSB in diesem Browser nicht unterstützt und dein Programm wird stattdessen auf deinem Computer gespeichert. Folge den Schritten auf dem nächsten Bildschirm, um es auf deinen micro:bit zu übertragen. Wir empfehlen Google Chrome oder Microsoft Edge, damit du dich direkt mit deinem micro:bit verbinden kannst.",
"description": "Explantion shown when user's browser doesn't support WebUSB"
Expand Down
14 changes: 3 additions & 11 deletions lang/ui.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1120,25 +1120,17 @@
"description": "Part of WebUSB error message"
},
"webusb-error-clear-connect-title": {
"defaultMessage": "Unable to claim interface",
"defaultMessage": "Another page or browser tab is connected to this micro:bit",
"description": "Title of error for WebUsb connection"
},
"webusb-error-default-title": {
"defaultMessage": "WebUSB error",
"description": "Default title for error messages relating to WebUSB"
},
"webusb-error-reconnect-microbit-description": {
"defaultMessage": "Please reconnect your micro:bit and try again.",
"defaultMessage": "<p>Please follow these steps, then try again:</p><ul><li>unplug the USB cable</li><li>unplug the battery pack if one is attached</li><li>reconnect the USB cable</li><li>reconnect the battery pack if one was attached</li></ul>",
"description": "Part of WebUSB error message"
},
"webusb-error-update-req-description": {
"defaultMessage": "You need to <link>update your micro:bit firmware</link> to make use of this feature.",
"description": "WebUSB error telling user to update firmware"
},
"webusb-error-update-req-title": {
"defaultMessage": "Please update the micro:bit firmware",
"description": "Error text telling user to update firmware"
},
"webusb-not-supported": {
"defaultMessage": "Unfortunately, WebUSB is not supported in this browser and your program will be saved to your computer instead. Follow the steps on the next screen to transfer it to your micro:bit. We recommend Google Chrome or Microsoft Edge so you can connect directly to your micro:bit.",
"description": "Explantion shown when user's browser doesn't support WebUSB"
Expand Down Expand Up @@ -1171,4 +1163,4 @@
"defaultMessage": "Zoom out",
"description": "Text label for zoom out button"
}
}
}
8 changes: 0 additions & 8 deletions lang/ui.es-es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1130,14 +1130,6 @@
"defaultMessage": "Por favor reconecta el micro:bit e intentalo de nuevo.",
"description": "Part of WebUSB error message"
},
"webusb-error-update-req-description": {
"defaultMessage": "Necesitas <link>actualizar el firmware del micro:bit</link> para usar esta función.",
"description": "WebUSB error telling user to update firmware"
},
"webusb-error-update-req-title": {
"defaultMessage": "Actualiza el firmware micro:bit",
"description": "Error text telling user to update firmware"
},
"webusb-not-supported": {
"defaultMessage": "Desafortunadamente, este navegador no admite WebUSB, por lo que el programa se guardará en el ordenador. Sigue los pasos indicados en la siguiente pantalla para transferirlo al micro:bit. Recomendamos Google Chrome o Microsoft Edge para poder conectarte directamente al micro:bit.",
"description": "Explantion shown when user's browser doesn't support WebUSB"
Expand Down
8 changes: 0 additions & 8 deletions lang/ui.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1130,14 +1130,6 @@
"defaultMessage": "Veuillez reconnecter votre micro:bit et réessayer.",
"description": "Part of WebUSB error message"
},
"webusb-error-update-req-description": {
"defaultMessage": "Vous devez <link>mettre à jour le micrologiciel de votre micro:bit</link> pour utiliser cette fonctionnalité.",
"description": "WebUSB error telling user to update firmware"
},
"webusb-error-update-req-title": {
"defaultMessage": "Veuillez mettre à jour le micrologiciel de micro:bit",
"description": "Error text telling user to update firmware"
},
"webusb-not-supported": {
"defaultMessage": "Malheureusement, WebUSB n'est pas pris en charge dans ce navigateur et votre programme sera sauvegardé sur votre ordinateur. Suivez les étapes sur l'écran suivant pour le transférer vers votre micro:bit. Nous vous recommandons Google Chrome ou Microsoft Edge afin que vous puissiez vous connecter directement à votre micro:bit.",
"description": "Explantion shown when user's browser doesn't support WebUSB"
Expand Down
8 changes: 0 additions & 8 deletions lang/ui.ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -1130,14 +1130,6 @@
"defaultMessage": "micro:bitを再接続して、やり直してください。",
"description": "Part of WebUSB error message"
},
"webusb-error-update-req-description": {
"defaultMessage": "この機能を利用するには、<link>micro:bitファームウェアを更新</link>する必要があります。",
"description": "WebUSB error telling user to update firmware"
},
"webusb-error-update-req-title": {
"defaultMessage": "micro:bit のファームウェアを更新してください。",
"description": "Error text telling user to update firmware"
},
"webusb-not-supported": {
"defaultMessage": "残念ながら、WebUSBはこのブラウザではサポートされていないので、代わりにプログラムをコンピュータに保存します。 次の画面の手順に従ってmicro:bitに転送してください。micro:bitと直接接続できるように、Google ChromeまたはMicrosoft Edgeをお勧めします。",
"description": "Explantion shown when user's browser doesn't support WebUSB"
Expand Down
8 changes: 0 additions & 8 deletions lang/ui.ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -1130,14 +1130,6 @@
"defaultMessage": "micro:bit 연결을 확인한 후, 다시 시도해 보세요.",
"description": "Part of WebUSB error message"
},
"webusb-error-update-req-description": {
"defaultMessage": "이 기능을 활용하려면 <link>micro:bit 펌웨어를 업데이트</link>해야 합니다.",
"description": "WebUSB error telling user to update firmware"
},
"webusb-error-update-req-title": {
"defaultMessage": "micro:bit 펌웨어를 업데이트 하세요.",
"description": "Error text telling user to update firmware"
},
"webusb-not-supported": {
"defaultMessage": "이 브라우저가 WebUSB를 지원하지 않아 프로그램이 컴퓨터에 저장됩니다. micro:bit로 전송하려면 다음 화면의 단계를 따르세요. micro:bit에 직접 연결할 수 있도록 Google Chrome 또는 Microsoft Edge 사용을 권장합니다.",
"description": "Explantion shown when user's browser doesn't support WebUSB"
Expand Down
8 changes: 0 additions & 8 deletions lang/ui.nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -1130,14 +1130,6 @@
"defaultMessage": "Verbind je micro:bit opnieuw en probeer het nog eens.",
"description": "Part of WebUSB error message"
},
"webusb-error-update-req-description": {
"defaultMessage": "Je moet <link>je micro:bit firmware</link> updaten om deze functie te gebruiken.",
"description": "WebUSB error telling user to update firmware"
},
"webusb-error-update-req-title": {
"defaultMessage": "Werk de firmware van de micro:bit bij",
"description": "Error text telling user to update firmware"
},
"webusb-not-supported": {
"defaultMessage": "Helaas wordt WebUSB niet ondersteund in deze browser en zal je programma worden opgeslagen op je computer. Volg de stappen op het volgende scherm om het naar de micro:bit te verplaatsen. We raden Google Chrome of Microsoft Edge aan, zodat je direct verbinding kunt maken met je micro:bit.",
"description": "Explantion shown when user's browser doesn't support WebUSB"
Expand Down
8 changes: 0 additions & 8 deletions lang/ui.zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -1130,14 +1130,6 @@
"defaultMessage": "请重新连接 micro:bit 然后再次尝试。",
"description": "Part of WebUSB error message"
},
"webusb-error-update-req-description": {
"defaultMessage": "您需要 <link>update your micro:bit firmware</link> 才能使用此功能。",
"description": "WebUSB error telling user to update firmware"
},
"webusb-error-update-req-title": {
"defaultMessage": "请更新 micro:bit 固件",
"description": "Error text telling user to update firmware"
},
"webusb-not-supported": {
"defaultMessage": "很遗憾,此浏览器不支持 WebUSB,您的程序将被保存到您的计算机上。请按照下一个屏幕上的步骤将其传输到您的 micro:bit。我们建议您使用 Google Chrome 或 Microsoft Edge 浏览器,以便您可以直接连接到您的 micro:bit。",
"description": "Explantion shown when user's browser doesn't support WebUSB"
Expand Down
8 changes: 0 additions & 8 deletions lang/ui.zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -1130,14 +1130,6 @@
"defaultMessage": "請重新連接你的 micro:bit 後再試一次。",
"description": "Part of WebUSB error message"
},
"webusb-error-update-req-description": {
"defaultMessage": "您需要<link>更新您的 micro:bit 韌體</link>,以使用此功能。",
"description": "WebUSB error telling user to update firmware"
},
"webusb-error-update-req-title": {
"defaultMessage": "請更新 micro:bit 韌體",
"description": "Error text telling user to update firmware"
},
"webusb-not-supported": {
"defaultMessage": "很抱歉,此瀏覽器不支援 WebUSB,您的程式將儲存至您的電腦。請依照下一個畫面上的步驟,將其傳輸至您的 micro:bit。我們建議您使用 Google Chrome 或 Microsoft Edge,以便能直接連線至您的 micro:bit。",
"description": "Explantion shown when user's browser doesn't support WebUSB"
Expand Down
12 changes: 0 additions & 12 deletions src/messages/ui.ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -2417,18 +2417,6 @@
"value": "Torna a connectar la teva micro:bit i torna-ho a provar."
}
],
"webusb-error-update-req-description": [
{
"type": 0,
"value": "Has d<link>actualitzar el microprogramari de la teva micro:bit </link> per fer ús daquesta característica."
}
],
"webusb-error-update-req-title": [
{
"type": 0,
"value": "Actualitza el microprogramari de la micro:bit "
}
],
"webusb-not-supported": [
{
"type": 0,
Expand Down
26 changes: 0 additions & 26 deletions src/messages/ui.de.json
Original file line number Diff line number Diff line change
Expand Up @@ -2499,32 +2499,6 @@
"value": "Bitte schließe deinen micro:bit erneut an und versuche es nochmal."
}
],
"webusb-error-update-req-description": [
{
"type": 0,
"value": "Um diese Funktion nutzen zu können, musst du deine "
},
{
"children": [
{
"type": 0,
"value": "micro:bit Firmware aktualisieren "
}
],
"type": 8,
"value": "link"
},
{
"type": 0,
"value": "."
}
],
"webusb-error-update-req-title": [
{
"type": 0,
"value": "Bitte aktualisiere die micro:bit Firmware"
}
],
"webusb-not-supported": [
{
"type": 0,
Expand Down
70 changes: 48 additions & 22 deletions src/messages/ui.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2430,13 +2430,13 @@
"webusb-error-clear-connect-description-2": [
{
"type": 0,
"value": "Close any other tabs that may be using WebUSB (e.g. MakeCode, Python Editor), or unplug and replug the micro:bit before trying again."
"value": "Close any other pages or tabs that may be using WebUSB (e.g. MakeCode, Python Editor), or unplug and replug the micro:bit before trying again."
}
],
"webusb-error-clear-connect-title": [
{
"type": 0,
"value": "Unable to claim interface"
"value": "Another page or browser tab is connected to this micro:bit"
}
],
"webusb-error-default-title": [
Expand All @@ -2446,35 +2446,61 @@
}
],
"webusb-error-reconnect-microbit-description": [
{
"type": 0,
"value": "Please reconnect your micro:bit and try again."
}
],
"webusb-error-update-req-description": [
{
"type": 0,
"value": "You need to "
},
{
"children": [
{
"type": 0,
"value": "update your micro:bit firmware"
"value": "Please follow these steps, then try again:"
}
],
"type": 8,
"value": "link"
"value": "p"
},
{
"type": 0,
"value": " to make use of this feature."
}
],
"webusb-error-update-req-title": [
{
"type": 0,
"value": "Please update the micro:bit firmware"
"children": [
{
"children": [
{
"type": 0,
"value": "unplug the USB cable"
}
],
"type": 8,
"value": "li"
},
{
"children": [
{
"type": 0,
"value": "unplug the battery pack if one is attached"
}
],
"type": 8,
"value": "li"
},
{
"children": [
{
"type": 0,
"value": "reconnect the USB cable"
}
],
"type": 8,
"value": "li"
},
{
"children": [
{
"type": 0,
"value": "reconnect the battery pack if one was attached"
}
],
"type": 8,
"value": "li"
}
],
"type": 8,
"value": "ul"
}
],
"webusb-not-supported": [
Expand Down
26 changes: 0 additions & 26 deletions src/messages/ui.es-es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2443,32 +2443,6 @@
"value": "Por favor reconecta el micro:bit e intentalo de nuevo."
}
],
"webusb-error-update-req-description": [
{
"type": 0,
"value": "Necesitas "
},
{
"children": [
{
"type": 0,
"value": "actualizar el firmware del micro:bit"
}
],
"type": 8,
"value": "link"
},
{
"type": 0,
"value": " para usar esta función."
}
],
"webusb-error-update-req-title": [
{
"type": 0,
"value": "Actualiza el firmware micro:bit"
}
],
"webusb-not-supported": [
{
"type": 0,
Expand Down
26 changes: 0 additions & 26 deletions src/messages/ui.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2443,32 +2443,6 @@
"value": "Veuillez reconnecter votre micro:bit et réessayer."
}
],
"webusb-error-update-req-description": [
{
"type": 0,
"value": "Vous devez "
},
{
"children": [
{
"type": 0,
"value": "mettre à jour le micrologiciel de votre micro:bit"
}
],
"type": 8,
"value": "link"
},
{
"type": 0,
"value": " pour utiliser cette fonctionnalité."
}
],
"webusb-error-update-req-title": [
{
"type": 0,
"value": "Veuillez mettre à jour le micrologiciel de micro:bit"
}
],
"webusb-not-supported": [
{
"type": 0,
Expand Down
Loading

0 comments on commit 9bfff59

Please sign in to comment.