From 925d9fd5ad69066bdca42048fa69d9e3954b16ae Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sun, 3 Mar 2024 21:25:49 +0100 Subject: [PATCH] Update translations --- i18n/nw_base.ts | 239 +++++++++++++++++------------------- novelwriter/gui/projtree.py | 24 ++-- 2 files changed, 125 insertions(+), 138 deletions(-) diff --git a/i18n/nw_base.ts b/i18n/nw_base.ts index da9cc372..f6837b16 100644 --- a/i18n/nw_base.ts +++ b/i18n/nw_base.ts @@ -3018,118 +3018,118 @@ GuiProjectTree - - Active - - - - - Inactive - - - - - Did not find anywhere to add the file or folder! - - - - - Cannot add new files or folders to the Trash folder. - - - - - New Note - - - - - New Chapter - - - - - New Scene - - - - - New Document - - - - - New Folder - - - - - There is currently no Trash folder in this project. - - - - - The Trash folder is already empty. - - - - + Permanently delete {0} file(s) from Trash? - + + Active + + + + + Inactive + + + + + Did not find anywhere to add the file or folder! + + + + + Cannot add new files or folders to the Trash folder. + + + + + New Note + + + + + New Chapter + + + + + New Scene + + + + + New Document + + + + + New Folder + + + + + There is currently no Trash folder in this project. + + + + + The Trash folder is already empty. + + + + Move '{0}' to Trash? - + Root folders can only be deleted when they are empty. - + Permanently delete '{0}'? - + Drag and drop is only allowed for single items, non-root items, or multiple items with the same parent. - + No documents selected for merging. - + Merged - - + + Could not write document content. - + Do you want to duplicate this document? - + Do you want to duplicate this item and all child items? - + Could not duplicate all items. - + There is nowhere to add item with name '{0}'. @@ -3474,73 +3474,73 @@ - + Backing up project ... - + Cannot backup project because no project name is set. Please set a Project Name in Project Settings. - + Could not create backup folder. - + Created a backup of your project of size {0}B. - + Path: {0} - + Could not write backup archive. - + Project backed up to '{0}' - - + + New - + Note - + Draft - + Finished - + Minor - + Major - + Main @@ -4520,142 +4520,133 @@ _TreeContextMenu - + Empty Trash - + Rename - + Open Document - + View Document - + Create New ... - + Rename to Heading - + Set Active to ... - - Active - - - - - Inactive - - - - + Toggle Active - + Set Status to ... - - + + Manage Labels ... - + Set Importance to ... - + Transform ... - - - - + + + + Convert to {0} - + Merge Child Items into Self - + Merge Child Items into New - + Merge Documents in Folder - + Split Document by Headers - + Expand All - + Collapse All - + Duplicate from Here - + Duplicate Document - + + Delete Permanently - - + + Move to Trash - + Move {0} items to Trash? - + Do you want to convert the folder to a {0}? This action cannot be reversed. @@ -4663,7 +4654,7 @@ _UpdatableMenu - + From Template diff --git a/novelwriter/gui/projtree.py b/novelwriter/gui/projtree.py index 3555f84c..9e415091 100644 --- a/novelwriter/gui/projtree.py +++ b/novelwriter/gui/projtree.py @@ -509,6 +509,11 @@ class GuiProjectTree(QTreeWidget): self._timeChanged = 0.0 self._popAlert = None + # Cached Translations + self.trActive = self.tr("Active") + self.trInactive = self.tr("Inactive") + self.trPermDelete = self.tr("Permanently delete {0} file(s) from Trash?") + # Build GUI # ========= @@ -555,10 +560,6 @@ class GuiProjectTree(QTreeWidget): trRoot = self.invisibleRootItem() trRoot.setFlags(trRoot.flags() ^ Qt.ItemFlag.ItemIsDropEnabled) - # Cached values - self._lblActive = self.tr("Active") - self._lblInactive = self.tr("Inactive") - # Set selection options self.setSelectionMode(QAbstractItemView.SelectionMode.ExtendedSelection) self.setSelectionBehavior(QAbstractItemView.SelectionBehavior.SelectRows) @@ -902,10 +903,7 @@ class GuiProjectTree(QTreeWidget): SHARED.info(self.tr("The Trash folder is already empty.")) return False - msgYes = SHARED.question( - self.tr("Permanently delete {0} file(s) from Trash?").format(nTrash) - ) - if not msgYes: + if not SHARED.question(self.trPermDelete.format(nTrash)): logger.info("Action cancelled by user") return False @@ -1052,7 +1050,7 @@ class GuiProjectTree(QTreeWidget): if nwItem.isFileType(): iconName = "checked" if nwItem.isActive else "unchecked" - toolTip = self._lblActive if nwItem.isActive else self._lblInactive + toolTip = self.trActive if nwItem.isActive else self.trInactive trItem.setToolTip(self.C_ACTIVE, toolTip) else: iconName = "noncheckable" @@ -1847,9 +1845,9 @@ class _TreeContextMenu(QMenu): """Add Active/Inactive actions.""" if multi: mSub = self.addMenu(self.tr("Set Active to ...")) - aOne = mSub.addAction(SHARED.theme.getIcon("checked"), self.tr("Active")) + aOne = mSub.addAction(SHARED.theme.getIcon("checked"), self.projTree.trActive) aOne.triggered.connect(lambda: self._iterItemActive(True)) - aTwo = mSub.addAction(SHARED.theme.getIcon("unchecked"), self.tr("Inactive")) + aTwo = mSub.addAction(SHARED.theme.getIcon("unchecked"), self.projTree.trInactive) aTwo.triggered.connect(lambda: self._iterItemActive(False)) else: action = self.addAction(self.tr("Toggle Active")) @@ -1992,9 +1990,7 @@ class _TreeContextMenu(QMenu): @pyqtSlot() def _iterPermDelete(self) -> None: """Iterate through files and delete them.""" - if SHARED.question( - self.tr("Permanently delete {0} documents in Trash?").format(len(self._items)) - ): + if SHARED.question(self.projTree.trPermDelete.format(len(self._items))): for tItem in self._items: if tItem.isFileType() and tItem.itemClass == nwItemClass.TRASH: self.projTree.permDeleteItem(tItem.itemHandle, askFirst=False, flush=False)