Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit e4af78b

Browse files
committed
Add translatable error
1 parent 5e3acdb commit e4af78b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/SlashCommands.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,10 @@ export const Commands = [
298298
const unixTimestamp = Date.parse(args);
299299
if (!unixTimestamp) {
300300
throw new Error(
301-
`We were unable to understand the given date (${args}). Try using the format YYYY-MM-DD.`,
301+
_t(
302+
'We were unable to understand the given date (%(inputDate)s). Try using the format YYYY-MM-DD.',
303+
{ inputDate: args },
304+
),
302305
);
303306
}
304307

src/i18n/strings/en_EN.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,8 @@
435435
"Sends a message as html, without interpreting it as markdown": "Sends a message as html, without interpreting it as markdown",
436436
"Upgrades a room to a new version": "Upgrades a room to a new version",
437437
"You do not have the required permissions to use this command.": "You do not have the required permissions to use this command.",
438-
"Jump to the given date in the timeline": "Jump to the given date in the timeline",
438+
"Jump to the given date in the timeline (YYYY-MM-DD)": "Jump to the given date in the timeline (YYYY-MM-DD)",
439+
"We were unable to understand the given date (%(inputDate)s). Try using the format YYYY-MM-DD.": "We were unable to understand the given date (%(inputDate)s). Try using the format YYYY-MM-DD.",
439440
"Changes your display nickname": "Changes your display nickname",
440441
"Changes your display nickname in the current room only": "Changes your display nickname in the current room only",
441442
"Changes the avatar of the current room": "Changes the avatar of the current room",
@@ -861,7 +862,7 @@
861862
"Meta Spaces": "Meta Spaces",
862863
"Use new room breadcrumbs": "Use new room breadcrumbs",
863864
"New spotlight search experience": "New spotlight search experience",
864-
"Jump to date (adds /jumptodate). Also requires your homeserver to have MSC3030 enabled": "Jump to date (adds /jumptodate). Also requires your homeserver to have MSC3030 enabled",
865+
"Jump to date (adds /jumptodate)": "Jump to date (adds /jumptodate)",
865866
"Don't send read receipts": "Don't send read receipts",
866867
"Font size": "Font size",
867868
"Use custom size": "Use custom size",

0 commit comments

Comments
 (0)