Add internationalisation to progress strings in room export dialog (#7385)
This commit is contained in:
parent
7857bf2da1
commit
3229b06b01
6 changed files with 59 additions and 19 deletions
|
@ -395,7 +395,10 @@ export default class HTMLExporter extends Exporter {
|
|||
let prevEvent = null;
|
||||
for (let i = start; i < Math.min(start + 1000, 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;
|
||||
|
||||
|
@ -411,15 +414,18 @@ export default class HTMLExporter extends Exporter {
|
|||
}
|
||||
|
||||
public async export() {
|
||||
this.updateProgress("Starting export...");
|
||||
this.updateProgress(_t("Starting export..."));
|
||||
|
||||
const fetchStart = performance.now();
|
||||
const res = await this.getRequiredEvents();
|
||||
const fetchEnd = performance.now();
|
||||
|
||||
this.updateProgress(`Fetched ${res.length} events in ${(fetchEnd - fetchStart)/1000}s`, true, false);
|
||||
this.updateProgress(_t("Fetched %(count)s events in %(seconds)ss", {
|
||||
count: res.length,
|
||||
seconds: (fetchEnd - fetchStart) / 1000,
|
||||
}), true, false);
|
||||
|
||||
this.updateProgress("Creating HTML...");
|
||||
this.updateProgress(_t("Creating HTML..."));
|
||||
|
||||
const usedClasses = new Set<string>();
|
||||
for (let page = 0; page < res.length / 1000; page++) {
|
||||
|
@ -442,8 +448,11 @@ export default class HTMLExporter extends Exporter {
|
|||
if (this.cancelled) {
|
||||
logger.info("Export cancelled successfully");
|
||||
} else {
|
||||
this.updateProgress("Export successful!");
|
||||
this.updateProgress(`Exported ${res.length} events in ${(exportEnd - fetchStart)/1000} seconds`);
|
||||
this.updateProgress(_t("Export successful!"));
|
||||
this.updateProgress(_t("Exported %(count)s events in %(seconds)s seconds", {
|
||||
count: res.length,
|
||||
seconds: (exportEnd - fetchStart) / 1000,
|
||||
}));
|
||||
}
|
||||
|
||||
this.cleanUp();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue