Add internationalisation to progress strings in room export dialog (#7385)

This commit is contained in:
Michael Telatynski 2021-12-15 16:21:51 +00:00 committed by GitHub
parent 7857bf2da1
commit 3229b06b01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 59 additions and 19 deletions

View file

@ -107,7 +107,10 @@ export default class PlainTextExporter extends Exporter {
let content = "";
for (let i = 0; i < events.length; i++) {
const event = events[i];
this.updateProgress(`Processing event ${i + 1} out of ${events.length}`, false, true);
this.updateProgress(_t("Processing event %(number)s out of %(total)s", {
number: i + 1,
total: events.length,
}), false, true);
if (this.cancelled) return this.cleanUp();
if (!haveTileForEvent(event)) continue;
const textForEvent = await this.plainTextForEvent(event);
@ -117,8 +120,8 @@ export default class PlainTextExporter extends Exporter {
}
public async export() {
this.updateProgress("Starting export process...");
this.updateProgress("Fetching events...");
this.updateProgress(_t("Starting export process..."));
this.updateProgress(_t("Fetching events..."));
const fetchStart = performance.now();
const res = await this.getRequiredEvents();
@ -126,7 +129,7 @@ export default class PlainTextExporter extends Exporter {
logger.log(`Fetched ${res.length} events in ${(fetchEnd - fetchStart)/1000}s`);
this.updateProgress("Creating output...");
this.updateProgress(_t("Creating output..."));
const text = await this.createOutput(res);
if (this.files.length) {