Skip to content

Commit

Permalink
Make offline image text translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-robert committed Apr 25, 2024
1 parent fcf4d63 commit 710ea9e
Show file tree
Hide file tree
Showing 21 changed files with 104 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lang/ui.ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "Has d'<link>actualitzar el teu microprogramari</link> abans de poder connectar amb aquesta micro:bit.",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "Obert",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.de.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "Du musst <link>die Firmware aktualisieren</link>, bevor eine Verbindung zu diesem micro:bit hergestellt werden kann.",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "Öffnen",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,10 @@
"defaultMessage": "You must <link>update your firmware before</link> you can connect to this micro:bit.",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "Open",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.es-es.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "Debes <link>actualizar el firmware</link> para poder conectar a este micro:bit.",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "Abrir",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "Vous devez <link>mettre à jour le micrologiciel</link> avant de pouvoir vous connecter à ce micro:bit.",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "Ouvrir",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "このmicro:bitに接続するには、<link>ファームウェアを更新</link>する必要があります。",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "開く",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "이 micro:bit에 연결하기 전에 <link>펌웨어를 업데이트</link>해야 합니다.",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "열기",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "Je moet <link>firmware updaten voordat</link> je verbinding kan maken met deze micro:bit.",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "Open",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "您必须 <link>update your firmware before</link> 才能连接到此 micro:bit。",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "打开",
"description": "Open button text"
Expand Down
4 changes: 4 additions & 0 deletions lang/ui.zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@
"defaultMessage": "您必須<link>更新您的韌體</link>,然後才能連線至此 micro:bit。",
"description": "Text in the no micro:bit found dialog"
},
"offline-image-alt": {
"defaultMessage": "Image unavailable offline",
"description": "Alt text for an image placeholder when the user is offline"
},
"open-action": {
"defaultMessage": "開啟",
"description": "Open button text"
Expand Down
6 changes: 4 additions & 2 deletions src/documentation/OfflineImageFallback.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BoxProps, Image, Text, VStack } from "@chakra-ui/react";
import offlinePlaceholder from "./offline.svg";
import { FormattedMessage, useIntl } from "react-intl";

interface OfflineImageFallbackProps extends BoxProps {
useIcon?: boolean;
Expand All @@ -10,19 +11,20 @@ const OfflineImageFallback = ({
width,
...props
}: OfflineImageFallbackProps) => {
const intl = useIntl();
return (
<>
{useIcon ? (
<Image
fallbackSrc={offlinePlaceholder}
{...props}
p={2}
alt="Image unavailable offline"
alt={intl.formatMessage({ id: "offline-image-alt" })}
/>
) : (
<VStack justifyContent="center" {...props} maxWidth={width}>
<Text textAlign="center" wordBreak="break-word">
Image unavailable offline
<FormattedMessage id="offline-image-alt" />
</Text>
</VStack>
)}
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,12 @@
"value": "Has d<link>actualitzar el teu microprogramari</link> abans de poder connectar amb aquesta micro:bit."
}
],
"offline-image-alt": [
{
"type": 0,
"value": "Image unavailable offline"
}
],
"open-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,12 @@
"value": ", bevor eine Verbindung zu diesem micro:bit hergestellt werden kann."
}
],
"offline-image-alt": [
{
"type": 0,
"value": "Image unavailable offline"
}
],
"open-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,12 @@
"value": " you can connect to this micro:bit."
}
],
"offline-image-alt": [
{
"type": 0,
"value": "Image unavailable offline"
}
],
"open-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.es-es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,12 @@
"value": " para poder conectar a este micro:bit."
}
],
"offline-image-alt": [
{
"type": 0,
"value": "Image unavailable offline"
}
],
"open-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,12 @@
"value": " avant de pouvoir vous connecter à ce micro:bit."
}
],
"offline-image-alt": [
{
"type": 0,
"value": "Image unavailable offline"
}
],
"open-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,12 @@
"value": "する必要があります。"
}
],
"offline-image-alt": [
{
"type": 0,
"value": "Image unavailable offline"
}
],
"open-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,12 @@
"value": "해야 합니다."
}
],
"offline-image-alt": [
{
"type": 0,
"value": "Image unavailable offline"
}
],
"open-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,12 @@
"value": " je verbinding kan maken met deze micro:bit."
}
],
"offline-image-alt": [
{
"type": 0,
"value": "Image unavailable offline"
}
],
"open-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,12 @@
"value": " 才能连接到此 micro:bit。"
}
],
"offline-image-alt": [
{
"type": 0,
"value": "Image unavailable offline"
}
],
"open-action": [
{
"type": 0,
Expand Down
6 changes: 6 additions & 0 deletions src/messages/ui.zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,12 @@
"value": ",然後才能連線至此 micro:bit。"
}
],
"offline-image-alt": [
{
"type": 0,
"value": "Image unavailable offline"
}
],
"open-action": [
{
"type": 0,
Expand Down

0 comments on commit 710ea9e

Please sign in to comment.