Fix translation issues

This commit is contained in:
Veronica Berglyd Olsen
2025-01-10 00:59:53 +01:00
parent 04464a2798
commit eba0b607a4
6 changed files with 21 additions and 21 deletions
+6 -6
View File
@@ -207,7 +207,7 @@ class nwLists:
class nwStats:
CHARS_ALL = "allChars"
CHARS = "allChars"
CHARS_TEXT = "textChars"
CHARS_TITLE = "titleChars"
PARAGRAPHS = "paragraphCount"
@@ -215,14 +215,14 @@ class nwStats:
WCHARS_ALL = "allWordChars"
WCHARS_TEXT = "textWordChars"
WCHARS_TITLE = "titleWordChars"
WORDS_ALL = "allWords"
WORDS = "allWords"
WORDS_TEXT = "textWords"
WORDS_TITLE = "titleWords"
# Note: The order here affects the order of menu entries
ALL_FIELDS = [
WORDS_ALL, WORDS_TEXT, WORDS_TITLE,
CHARS_ALL, CHARS_TEXT, CHARS_TITLE,
WORDS, WORDS_TEXT, WORDS_TITLE,
CHARS, CHARS_TEXT, CHARS_TITLE,
WCHARS_ALL, WCHARS_TEXT, WCHARS_TITLE,
PARAGRAPHS, TITLES,
]
@@ -329,7 +329,7 @@ class nwLabels:
nwOutline.SYNOP: QT_TRANSLATE_NOOP("Constant", "Synopsis"),
}
STATS_NAME = {
nwStats.CHARS_ALL: QT_TRANSLATE_NOOP("Stats", "Characters"),
nwStats.CHARS: QT_TRANSLATE_NOOP("Stats", "Characters"),
nwStats.CHARS_TEXT: QT_TRANSLATE_NOOP("Stats", "Characters in Text"),
nwStats.CHARS_TITLE: QT_TRANSLATE_NOOP("Stats", "Characters in Headings"),
nwStats.PARAGRAPHS: QT_TRANSLATE_NOOP("Stats", "Paragraphs"),
@@ -337,7 +337,7 @@ class nwLabels:
nwStats.WCHARS_ALL: QT_TRANSLATE_NOOP("Stats", "Characters, No Spaces"),
nwStats.WCHARS_TEXT: QT_TRANSLATE_NOOP("Stats", "Characters in Text, No Spaces"),
nwStats.WCHARS_TITLE: QT_TRANSLATE_NOOP("Stats", "Characters in Headings, No Spaces"),
nwStats.WORDS_ALL: QT_TRANSLATE_NOOP("Stats", "Words"),
nwStats.WORDS: QT_TRANSLATE_NOOP("Stats", "Words"),
nwStats.WORDS_TEXT: QT_TRANSLATE_NOOP("Stats", "Words in Text"),
nwStats.WORDS_TITLE: QT_TRANSLATE_NOOP("Stats", "Words in Headings"),
}
+1 -1
View File
@@ -584,7 +584,7 @@ class GuiPreferences(NDialog):
self.narratorBreak.setText(CONFIG.narratorBreak)
self.mainForm.addRow(
self.tr("Narrator break symbol"), self.narratorBreak,
self.tr("Symbol to indicate a narrator break in dialogue")
self.tr("Symbol to indicate a narrator break in dialogue.")
)
self.narratorDialog = QLineEdit(self)
+4 -4
View File
@@ -946,11 +946,11 @@ class Tokenizer(ABC):
titleCount = self._counts.get(nwStats.TITLES, 0)
paragraphCount = self._counts.get(nwStats.PARAGRAPHS, 0)
allWords = self._counts.get(nwStats.WORDS_ALL, 0)
allWords = self._counts.get(nwStats.WORDS, 0)
textWords = self._counts.get(nwStats.WORDS_TEXT, 0)
titleWords = self._counts.get(nwStats.WORDS_TITLE, 0)
allChars = self._counts.get(nwStats.CHARS_ALL, 0)
allChars = self._counts.get(nwStats.CHARS, 0)
textChars = self._counts.get(nwStats.CHARS_TEXT, 0)
titleChars = self._counts.get(nwStats.CHARS_TITLE, 0)
@@ -1004,11 +1004,11 @@ class Tokenizer(ABC):
self._counts[nwStats.TITLES] = titleCount
self._counts[nwStats.PARAGRAPHS] = paragraphCount
self._counts[nwStats.WORDS_ALL] = allWords
self._counts[nwStats.WORDS] = allWords
self._counts[nwStats.WORDS_TEXT] = textWords
self._counts[nwStats.WORDS_TITLE] = titleWords
self._counts[nwStats.CHARS_ALL] = allChars
self._counts[nwStats.CHARS] = allChars
self._counts[nwStats.CHARS_TEXT] = textChars
self._counts[nwStats.CHARS_TITLE] = titleChars
+2 -2
View File
@@ -65,8 +65,8 @@ class GuiItemDetails(QWidget):
fntValue = self.font()
fntValue.setPointSizeF(0.9*fPt)
trStats1 = trConst(nwLabels.STATS_NAME[nwStats.CHARS_ALL])
trStats2 = trConst(nwLabels.STATS_NAME[nwStats.WORDS_ALL])
trStats1 = trConst(nwLabels.STATS_NAME[nwStats.CHARS])
trStats2 = trConst(nwLabels.STATS_NAME[nwStats.WORDS])
trStats3 = trConst(nwLabels.STATS_NAME[nwStats.PARAGRAPHS])
# Label
+2 -2
View File
@@ -815,8 +815,8 @@ class GuiOutlineDetails(QScrollArea):
bFont = SHARED.theme.guiFontB
trStats1 = trConst(nwLabels.STATS_NAME[nwStats.CHARS_ALL])
trStats2 = trConst(nwLabels.STATS_NAME[nwStats.WORDS_ALL])
trStats1 = trConst(nwLabels.STATS_NAME[nwStats.CHARS])
trStats2 = trConst(nwLabels.STATS_NAME[nwStats.WORDS])
trStats3 = trConst(nwLabels.STATS_NAME[nwStats.PARAGRAPHS])
# Details Area
+6 -6
View File
@@ -986,17 +986,17 @@ class _StatsWidget(QWidget):
def updateStats(self, data: dict[str, int]) -> None:
"""Update the stats values from a Tokenizer stats dict."""
# Minimal
self.minWordCount.setText("{0:n}".format(data.get(nwStats.WORDS_ALL, 0)))
self.minCharCount.setText("{0:n}".format(data.get(nwStats.CHARS_ALL, 0)))
self.minWordCount.setText("{0:n}".format(data.get(nwStats.WORDS, 0)))
self.minCharCount.setText("{0:n}".format(data.get(nwStats.CHARS, 0)))
# Maximal
self.maxTotalWords.setText("{0:n}".format(data.get(nwStats.WORDS_ALL, 0)))
self.maxTotalWords.setText("{0:n}".format(data.get(nwStats.WORDS, 0)))
self.maxHeadWords.setText("{0:n}".format(data.get(nwStats.WORDS_TITLE, 0)))
self.maxTextWords.setText("{0:n}".format(data.get(nwStats.WORDS_TEXT, 0)))
self.maxTitleCount.setText("{0:n}".format(data.get(nwStats.TITLES, 0)))
self.maxParCount.setText("{0:n}".format(data.get(nwStats.PARAGRAPHS, 0)))
self.maxTotalChars.setText("{0:n}".format(data.get(nwStats.CHARS_ALL, 0)))
self.maxTotalChars.setText("{0:n}".format(data.get(nwStats.CHARS, 0)))
self.maxHeaderChars.setText("{0:n}".format(data.get(nwStats.CHARS_TITLE, 0)))
self.maxTextChars.setText("{0:n}".format(data.get(nwStats.CHARS_TEXT, 0)))
@@ -1037,7 +1037,7 @@ class _StatsWidget(QWidget):
hPx = CONFIG.pxInt(12)
vPx = CONFIG.pxInt(4)
trAllChars = trConst(nwLabels.STATS_NAME[nwStats.CHARS_ALL])
trAllChars = trConst(nwLabels.STATS_NAME[nwStats.CHARS])
trTextChars = trConst(nwLabels.STATS_NAME[nwStats.CHARS_TEXT])
trTitleChars = trConst(nwLabels.STATS_NAME[nwStats.CHARS_TITLE])
trParagraphCount = trConst(nwLabels.STATS_NAME[nwStats.PARAGRAPHS])
@@ -1045,7 +1045,7 @@ class _StatsWidget(QWidget):
trAllWordChars = trConst(nwLabels.STATS_NAME[nwStats.WCHARS_ALL])
trTextWordChars = trConst(nwLabels.STATS_NAME[nwStats.WCHARS_TEXT])
trTitleWordChars = trConst(nwLabels.STATS_NAME[nwStats.WCHARS_TITLE])
trAllWords = trConst(nwLabels.STATS_NAME[nwStats.WORDS_ALL])
trAllWords = trConst(nwLabels.STATS_NAME[nwStats.WORDS])
trTextWords = trConst(nwLabels.STATS_NAME[nwStats.WORDS_TEXT])
trTitleWords = trConst(nwLabels.STATS_NAME[nwStats.WORDS_TITLE])