diff --git a/src/DateUtils.ts b/src/DateUtils.ts index 481afb312b..1eaa331f52 100644 --- a/src/DateUtils.ts +++ b/src/DateUtils.ts @@ -138,19 +138,14 @@ export function wantsDateSeparator(prevEventDate: Date, nextEventDate: Date): bo } export function formatFullDateNoDay(date: Date) { - return ( - date.getFullYear() + - "-" + - pad(date.getMonth() + 1) + - "-" + - pad(date.getDate()) + - _t(" at ") + - pad(date.getHours()) + - "." + - pad(date.getMinutes()) + - "." + - pad(date.getSeconds()) - ); + return _t("%(year)s-%(month)s-%(day)s at %(hours)s.%(minutes)s.%(seconds)s", { + year: date.getFullYear(), + month: pad(date.getMonth() + 1), + day: pad(date.getDate()), + hours: pad(date.getHours()), + minutes: pad(date.getMinutes()), + seconds: pad(date.getSeconds()), + }); } export function formatFullDateNoDayNoTime(date: Date) { diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 1c5fdcb848..c52ee00ae7 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -105,7 +105,7 @@ "%(weekDayName)s, %(monthName)s %(day)s %(time)s": "%(weekDayName)s, %(monthName)s %(day)s %(time)s", "%(weekDayName)s, %(monthName)s %(day)s %(fullYear)s": "%(weekDayName)s, %(monthName)s %(day)s %(fullYear)s", "%(weekDayName)s, %(monthName)s %(day)s %(fullYear)s %(time)s": "%(weekDayName)s, %(monthName)s %(day)s %(fullYear)s %(time)s", - " at ": " at ", + "%(year)s-%(month)s-%(day)s at %(hours)s.%(minutes)s.%(seconds)s": "%(year)s-%(month)s-%(day)s at %(hours)s.%(minutes)s.%(seconds)s", "Who would you like to add to this community?": "Who would you like to add to this community?", "Warning: any person you add to a community will be publicly visible to anyone who knows the community ID": "Warning: any person you add to a community will be publicly visible to anyone who knows the community ID", "Invite new community members": "Invite new community members", @@ -728,7 +728,7 @@ "Share your public space": "Share your public space", "Unknown App": "Unknown App", "%(creatorName)s created this room.": "%(creatorName)s created this room.", - "This is the start of export of %(roomName)s.\n Exported by %(exporterDetails)s at %(exportDate)s. ": "This is the start of export of %(roomName)s.\n Exported by %(exporterDetails)s at %(exportDate)s. ", + "This is the start of export of . Exported by at %(exportDate)s.": "This is the start of export of . Exported by at %(exportDate)s.", "Topic: %(topic)s": "Topic: %(topic)s", "Help us improve %(brand)s": "Help us improve %(brand)s", "Send anonymous usage data which helps us improve %(brand)s. This will use a cookie.": "Send anonymous usage data which helps us improve %(brand)s. This will use a cookie.", diff --git a/src/utils/exportUtils/HtmlExport.tsx b/src/utils/exportUtils/HtmlExport.tsx index 8fb30b08a3..3472d99507 100644 --- a/src/utils/exportUtils/HtmlExport.tsx +++ b/src/utils/exportUtils/HtmlExport.tsx @@ -82,14 +82,36 @@ export default class HTMLExporter extends Exporter { creatorName, }); - const exportedText = _t(`This is the start of export of %(roomName)s. - Exported by %(exporterDetails)s at %(exportDate)s. `, { - exportDate, - roomName: this.room.name, - exporterDetails: ` - ${exporterName ? `${ exporterName }(${ exporter })` : `${ exporter }`} - `, - }); + const exportedText = renderToStaticMarkup( +

+ {_t( + "This is the start of export of . Exported by at %(exportDate)s.", + { + exportDate, + }, + { + roomName: () => {this.room.name}, + exporterDetails: () => ( + + {exporterName ? ( + <> + {exporterName} + {exporter} + + ) : ( + {exporter} + )} + + ), + }, + )} +

, + ); + const topicText = topic ? _t("Topic: %(topic)s", { topic }) : "";