From 5e0b8120833ca20ab8b7936f68fdd34b3b5faf10 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 5 Oct 2023 19:44:54 -0400 Subject: [PATCH] fix: 'Untitled' is not translated closes #5949 --- app/models/Document.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/models/Document.ts b/app/models/Document.ts index 6012e312e..3b9217fd6 100644 --- a/app/models/Document.ts +++ b/app/models/Document.ts @@ -1,5 +1,5 @@ import { addDays, differenceInDays } from "date-fns"; -import { t } from "i18next"; +import i18n, { t } from "i18next"; import floor from "lodash/floor"; import { action, autorun, computed, observable, set } from "mobx"; import { ExportContentType } from "@shared/types"; @@ -241,11 +241,6 @@ export default class Document extends ParanoidModel { return this.title === ""; } - @computed - get titleWithDefault(): string { - return this.title || "Untitled"; - } - @computed get permanentlyDeletedAt(): string | undefined { if (!this.deletedAt) { @@ -279,6 +274,10 @@ export default class Document extends ParanoidModel { return floor((this.tasks.completed / this.tasks.total) * 100); } + get titleWithDefault(): string { + return this.title || i18n.t("Untitled"); + } + @action updateTasks(total: number, completed: number) { if (total !== this.tasks.total || completed !== this.tasks.completed) {