Enable proper i18n for date utils

This commit is contained in:
Jaiwanth 2021-06-09 16:12:57 +05:30
parent 573ababb8c
commit 716e2effbc
3 changed files with 40 additions and 23 deletions

View file

@ -82,14 +82,36 @@ export default class HTMLExporter extends Exporter {
creatorName,
});
const exportedText = _t(`This is the start of export of <b>%(roomName)s</b>.
Exported by %(exporterDetails)s at %(exportDate)s. `, {
exportDate,
roomName: this.room.name,
exporterDetails: `<a href="https://matrix.to/#/${exporter}" target="_blank" rel="noopener noreferrer">
${exporterName ? `<b>${ exporterName }</b>(${ exporter })` : `<b>${ exporter }</b>`}
</a>`,
});
const exportedText = renderToStaticMarkup(
<p>
{_t(
"This is the start of export of <roomName/>. Exported by <exporterDetails/> at %(exportDate)s.",
{
exportDate,
},
{
roomName: () => <b>{this.room.name}</b>,
exporterDetails: () => (
<a
href={`https://matrix.to/#/${exporter}`}
target="_blank"
rel="noopener noreferrer"
>
{exporterName ? (
<>
<b>{exporterName}</b>
{exporter}
</>
) : (
<b>{exporter}</b>
)}
</a>
),
},
)}
</p>,
);
const topicText = topic ? _t("Topic: %(topic)s", { topic }) : "";