diff --git a/nw/core/document.py b/nw/core/document.py
index ce91ddd8..550cc943 100644
--- a/nw/core/document.py
+++ b/nw/core/document.py
@@ -131,8 +131,7 @@ class NWDoc():
if showStatus and not isOrphan:
self.theParent.setStatus(
self.tr("{0}: {1}").format(
- self.tr("Opened Document"),
- self._theItem.itemName
+ self.tr("Opened Document"), self._theItem.itemName
)
)
@@ -180,8 +179,7 @@ class NWDoc():
if self._theItem is not None:
self.theParent.setStatus(
self.tr("{0}: {1}").format(
- self.tr("Saved Document"),
- self._theItem.itemName
+ self.tr("Saved Document"), self._theItem.itemName
)
)
diff --git a/nw/core/index.py b/nw/core/index.py
index 6af04e3b..83abc3ce 100644
--- a/nw/core/index.py
+++ b/nw/core/index.py
@@ -30,9 +30,6 @@ import json
import os
from time import time
-from functools import partial
-
-from PyQt5.QtCore import QCoreApplication
from nw.constants import (
nwFiles, nwKeyWords, nwItemType, nwItemClass, nwItemLayout, nwAlert
@@ -68,11 +65,6 @@ class NWIndex():
self._timeNotes = 0
self._timeIndex = 0
- self.clearIndex()
-
- # Internal Mappings
- self.tr = partial(QCoreApplication.translate, "NWIndex")
-
return
##
@@ -236,10 +228,6 @@ class NWIndex():
if self.indexBroken:
self.clearIndex()
- self.theParent.makeAlert(
- self.tr("The project index is outdated or broken. Rebuilding index."),
- nwAlert.WARN
- )
return
diff --git a/nw/gui/mainmenu.py b/nw/gui/mainmenu.py
index 184289f8..94087ec0 100644
--- a/nw/gui/mainmenu.py
+++ b/nw/gui/mainmenu.py
@@ -775,7 +775,7 @@ class GuiMainMenu(QMenuBar):
# Search > Find Next
self.aFindNext = QAction(self.tr("Find Next"), self)
- self.aFindNext.setStatusTip(self.tr("Find next occurrence text in document"))
+ self.aFindNext.setStatusTip(self.tr("Find next occurrence of text in document"))
if self.mainConf.osDarwin:
self.aFindNext.setShortcuts(["Ctrl+G", "F3"])
else:
@@ -785,7 +785,7 @@ class GuiMainMenu(QMenuBar):
# Search > Find Prev
self.aFindPrev = QAction(self.tr("Find Previous"), self)
- self.aFindPrev.setStatusTip(self.tr("Find previous occurrence text in document"))
+ self.aFindPrev.setStatusTip(self.tr("Find previous occurrence of text in document"))
if self.mainConf.osDarwin:
self.aFindPrev.setShortcuts(["Ctrl+Shift+G", "Shift+F3"])
else:
diff --git a/nw/gui/statusbar.py b/nw/gui/statusbar.py
index 555a1a2b..3cb19be8 100644
--- a/nw/gui/statusbar.py
+++ b/nw/gui/statusbar.py
@@ -175,7 +175,9 @@ class GuiMainStatus(QStatusBar):
def setStats(self, pWC, sWC):
"""Set the current project statistics.
"""
- self.statsText.setText("%s: %s (%s)" % (self.tr("Words"), f"{pWC:n}", f"{sWC:+n}"))
+ self.statsText.setText(self.tr("{0}: {1} ({2})").format(
+ self.tr("Words"), f"{pWC:n}", f"{sWC:+n}")
+ )
self.statsText.setToolTip(self.tr("Project word count (session change)"))
return
diff --git a/nw/guimain.py b/nw/guimain.py
index dce85cbd..153c8cac 100644
--- a/nw/guimain.py
+++ b/nw/guimain.py
@@ -181,7 +181,7 @@ class GuiMain(QMainWindow):
self.splitOutline.addWidget(self.projMeta)
self.splitOutline.setSizes(self.mainConf.getOutlinePanePos())
- # Main Tabs : Edirot / Outline
+ # Main Tabs : Editor / Outline
self.mainTabs = QTabWidget()
self.mainTabs.setTabPosition(QTabWidget.East)
self.mainTabs.setStyleSheet(r"QTabWidget::pane {border: 0;}")
@@ -466,14 +466,14 @@ class GuiMain(QMainWindow):
lockDetails = (
"
%s" % self.tr(
"The project was locked by the computer "
- "'{computer_name}' ({os_name} {os_version}), "
- "last active on {time}"
+ "'{computerName}' ({osName} {osVersion}), "
+ "last active on {activeTime}"
)
).format(
- computer_name = self.theProject.lockedBy[0],
- os_name = self.theProject.lockedBy[1],
- os_version = self.theProject.lockedBy[2],
- time = datetime.fromtimestamp(
+ computerName = self.theProject.lockedBy[0],
+ osName = self.theProject.lockedBy[1],
+ osVersion = self.theProject.lockedBy[2],
+ activeTime = datetime.fromtimestamp(
int(self.theProject.lockedBy[3])
).strftime("%x %X")
)
@@ -530,6 +530,10 @@ class GuiMain(QMainWindow):
# Check if we need to rebuild the index
if self.theIndex.indexBroken:
+ self.makeAlert(
+ self.tr("The project index is outdated or broken. Rebuilding index."),
+ nwAlert.WARN
+ )
self.rebuildIndex()
# Make sure the changed status is set to false on all that was
diff --git a/sample/nwProject.nwx b/sample/nwProject.nwx
index 94a7dcc9..52fba625 100644
--- a/sample/nwProject.nwx
+++ b/sample/nwProject.nwx
@@ -1,13 +1,13 @@
-
+
Sample Project
Sample Project
Jane Smith
Jay Doh
- 1019
+ 1021
161
- 48272
+ 48283
False