Allow splitting long notifications

This adds the ability to split notification messages in to multiple paragraphs.
This commit is contained in:
David Lechner
2021-04-01 13:58:01 -05:00
parent ca1ec0a64e
commit 55e724e8d8
2 changed files with 18 additions and 3 deletions
+16 -1
View File
@@ -20,5 +20,20 @@ export default function Notification(props: OwnProps): JSX.Element {
fallback: en,
});
const { messageId, replacements } = props;
return <>{i18n.translate(messageId, replacements)}</>;
let message = i18n.translate(messageId, replacements) as
| React.ReactElement
| string;
// Use newline characters to create paragraphs
if (typeof message === 'string') {
message = (
<>
{message.split('\n').map((x, i) => (
<p key={i}>{x}</p>
))}
</>
);
}
return message;
}
+2 -2
View File
@@ -6,14 +6,14 @@
},
"ble": {
"gattPermission": "The web browser did not give permission to use Bluetooth Low Energy",
"gattServiceNotFound": "Connected to hub but failed to get {serviceName} service. Ensure that you are using the most recent firmware. If the problem persists, try removing the \"{hubName}\" device in your OS Bluetooth settings, then try connecting again.",
"gattServiceNotFound": "Connected to hub but failed to get {serviceName} service.\nEnsure that you are using the most recent firmware.\nIf the problem persists, try removing the \"{hubName}\" device in your OS Bluetooth settings, then try connecting again.",
"noWebBluetooth": "This web browser does not support Web Bluetooth or it is not enabled.",
"noBluetooth": "No Bluetooth adapter could be found. Bluetooth won't work.",
"unexpectedError": "Unexpected error while trying to connect: {errorMessage}"
},
"editor": {
"programChanged": {
"message": "The program was changed in another window. Do you want to delete this program and replace it with the new program?",
"message": "The program was changed in another window.\nDo you want to delete this program and replace it with the new program?",
"action": "Reload"
}
},