Fix a bug in Build and Constants, and clean up some more nested translates
This commit is contained in:
+474
-195
File diff suppressed because it is too large
Load Diff
+60
-61
@@ -24,8 +24,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
from PyQt5.QtCore import QT_TRANSLATE_NOOP as QT_TRN
|
||||
from PyQt5.QtCore import QCoreApplication, QT_TRANSLATE_NOOP
|
||||
|
||||
from nw.constants.enum import (
|
||||
nwItemClass, nwItemLayout, nwItemType, nwOutline
|
||||
@@ -127,17 +126,17 @@ class nwKeyWords:
|
||||
class nwLabels():
|
||||
|
||||
CLASS_NAME = {
|
||||
nwItemClass.NO_CLASS : QT_TRN("Constant", "None"),
|
||||
nwItemClass.NOVEL : QT_TRN("Constant", "Novel"),
|
||||
nwItemClass.PLOT : QT_TRN("Constant", "Plot"),
|
||||
nwItemClass.CHARACTER : QT_TRN("Constant", "Characters"),
|
||||
nwItemClass.WORLD : QT_TRN("Constant", "Locations"),
|
||||
nwItemClass.TIMELINE : QT_TRN("Constant", "Timeline"),
|
||||
nwItemClass.OBJECT : QT_TRN("Constant", "Objects"),
|
||||
nwItemClass.ENTITY : QT_TRN("Constant", "Entity"),
|
||||
nwItemClass.CUSTOM : QT_TRN("Constant", "Custom"),
|
||||
nwItemClass.ARCHIVE : QT_TRN("Constant", "Outtakes"),
|
||||
nwItemClass.TRASH : QT_TRN("Constant", "Trash"),
|
||||
nwItemClass.NO_CLASS : QT_TRANSLATE_NOOP("Constant", "None"),
|
||||
nwItemClass.NOVEL : QT_TRANSLATE_NOOP("Constant", "Novel"),
|
||||
nwItemClass.PLOT : QT_TRANSLATE_NOOP("Constant", "Plot"),
|
||||
nwItemClass.CHARACTER : QT_TRANSLATE_NOOP("Constant", "Characters"),
|
||||
nwItemClass.WORLD : QT_TRANSLATE_NOOP("Constant", "Locations"),
|
||||
nwItemClass.TIMELINE : QT_TRANSLATE_NOOP("Constant", "Timeline"),
|
||||
nwItemClass.OBJECT : QT_TRANSLATE_NOOP("Constant", "Objects"),
|
||||
nwItemClass.ENTITY : QT_TRANSLATE_NOOP("Constant", "Entity"),
|
||||
nwItemClass.CUSTOM : QT_TRANSLATE_NOOP("Constant", "Custom"),
|
||||
nwItemClass.ARCHIVE : QT_TRANSLATE_NOOP("Constant", "Outtakes"),
|
||||
nwItemClass.TRASH : QT_TRANSLATE_NOOP("Constant", "Trash"),
|
||||
}
|
||||
CLASS_FLAG = {
|
||||
nwItemClass.NO_CLASS : "0",
|
||||
@@ -166,15 +165,15 @@ class nwLabels():
|
||||
nwItemClass.TRASH : "cls_trash",
|
||||
}
|
||||
LAYOUT_NAME = {
|
||||
nwItemLayout.NO_LAYOUT : QT_TRN("Constant", "None"),
|
||||
nwItemLayout.TITLE : QT_TRN("Constant", "Title Page"),
|
||||
nwItemLayout.BOOK : QT_TRN("Constant", "Book"),
|
||||
nwItemLayout.PAGE : QT_TRN("Constant", "Plain Page"),
|
||||
nwItemLayout.PARTITION : QT_TRN("Constant", "Partition"),
|
||||
nwItemLayout.UNNUMBERED : QT_TRN("Constant", "Unnumbered"),
|
||||
nwItemLayout.CHAPTER : QT_TRN("Constant", "Chapter"),
|
||||
nwItemLayout.SCENE : QT_TRN("Constant", "Scene"),
|
||||
nwItemLayout.NOTE : QT_TRN("Constant", "Note"),
|
||||
nwItemLayout.NO_LAYOUT : QT_TRANSLATE_NOOP("Constant", "None"),
|
||||
nwItemLayout.TITLE : QT_TRANSLATE_NOOP("Constant", "Title Page"),
|
||||
nwItemLayout.BOOK : QT_TRANSLATE_NOOP("Constant", "Book"),
|
||||
nwItemLayout.PAGE : QT_TRANSLATE_NOOP("Constant", "Plain Page"),
|
||||
nwItemLayout.PARTITION : QT_TRANSLATE_NOOP("Constant", "Partition"),
|
||||
nwItemLayout.UNNUMBERED : QT_TRANSLATE_NOOP("Constant", "Unnumbered"),
|
||||
nwItemLayout.CHAPTER : QT_TRANSLATE_NOOP("Constant", "Chapter"),
|
||||
nwItemLayout.SCENE : QT_TRANSLATE_NOOP("Constant", "Scene"),
|
||||
nwItemLayout.NOTE : QT_TRANSLATE_NOOP("Constant", "Note"),
|
||||
}
|
||||
LAYOUT_FLAG = {
|
||||
nwItemLayout.NO_LAYOUT : "Xo",
|
||||
@@ -188,27 +187,27 @@ class nwLabels():
|
||||
nwItemLayout.NOTE : "Nt",
|
||||
}
|
||||
KEY_NAME = {
|
||||
nwKeyWords.TAG_KEY : QT_TRN("Constant", "Tag"),
|
||||
nwKeyWords.POV_KEY : QT_TRN("Constant", "Point of View"),
|
||||
nwKeyWords.FOCUS_KEY : QT_TRN("Constant", "Focus"),
|
||||
nwKeyWords.CHAR_KEY : QT_TRN("Constant", "Characters"),
|
||||
nwKeyWords.PLOT_KEY : QT_TRN("Constant", "Plot"),
|
||||
nwKeyWords.TIME_KEY : QT_TRN("Constant", "Timeline"),
|
||||
nwKeyWords.WORLD_KEY : QT_TRN("Constant", "Locations"),
|
||||
nwKeyWords.OBJECT_KEY : QT_TRN("Constant", "Objects"),
|
||||
nwKeyWords.ENTITY_KEY : QT_TRN("Constant", "Entities"),
|
||||
nwKeyWords.CUSTOM_KEY : QT_TRN("Constant", "Custom"),
|
||||
nwKeyWords.TAG_KEY : QT_TRANSLATE_NOOP("Constant", "Tag"),
|
||||
nwKeyWords.POV_KEY : QT_TRANSLATE_NOOP("Constant", "Point of View"),
|
||||
nwKeyWords.FOCUS_KEY : QT_TRANSLATE_NOOP("Constant", "Focus"),
|
||||
nwKeyWords.CHAR_KEY : QT_TRANSLATE_NOOP("Constant", "Characters"),
|
||||
nwKeyWords.PLOT_KEY : QT_TRANSLATE_NOOP("Constant", "Plot"),
|
||||
nwKeyWords.TIME_KEY : QT_TRANSLATE_NOOP("Constant", "Timeline"),
|
||||
nwKeyWords.WORLD_KEY : QT_TRANSLATE_NOOP("Constant", "Locations"),
|
||||
nwKeyWords.OBJECT_KEY : QT_TRANSLATE_NOOP("Constant", "Objects"),
|
||||
nwKeyWords.ENTITY_KEY : QT_TRANSLATE_NOOP("Constant", "Entities"),
|
||||
nwKeyWords.CUSTOM_KEY : QT_TRANSLATE_NOOP("Constant", "Custom"),
|
||||
}
|
||||
OUTLINE_COLS = {
|
||||
nwOutline.TITLE : QT_TRN("Constant", "Title"),
|
||||
nwOutline.LEVEL : QT_TRN("Constant", "Level"),
|
||||
nwOutline.LABEL : QT_TRN("Constant", "Document"),
|
||||
nwOutline.LINE : QT_TRN("Constant", "Line"),
|
||||
nwOutline.CCOUNT : QT_TRN("Constant", "Chars"),
|
||||
nwOutline.WCOUNT : QT_TRN("Constant", "Words"),
|
||||
nwOutline.PCOUNT : QT_TRN("Constant", "Pars"),
|
||||
nwOutline.POV : QT_TRN("Constant", "POV"),
|
||||
nwOutline.FOCUS : QT_TRN("Constant", "Focus"),
|
||||
nwOutline.TITLE : QT_TRANSLATE_NOOP("Constant", "Title"),
|
||||
nwOutline.LEVEL : QT_TRANSLATE_NOOP("Constant", "Level"),
|
||||
nwOutline.LABEL : QT_TRANSLATE_NOOP("Constant", "Document"),
|
||||
nwOutline.LINE : QT_TRANSLATE_NOOP("Constant", "Line"),
|
||||
nwOutline.CCOUNT : QT_TRANSLATE_NOOP("Constant", "Chars"),
|
||||
nwOutline.WCOUNT : QT_TRANSLATE_NOOP("Constant", "Words"),
|
||||
nwOutline.PCOUNT : QT_TRANSLATE_NOOP("Constant", "Pars"),
|
||||
nwOutline.POV : QT_TRANSLATE_NOOP("Constant", "POV"),
|
||||
nwOutline.FOCUS : QT_TRANSLATE_NOOP("Constant", "Focus"),
|
||||
nwOutline.CHAR : KEY_NAME[nwKeyWords.CHAR_KEY],
|
||||
nwOutline.PLOT : KEY_NAME[nwKeyWords.PLOT_KEY],
|
||||
nwOutline.TIME : KEY_NAME[nwKeyWords.TIME_KEY],
|
||||
@@ -216,7 +215,7 @@ class nwLabels():
|
||||
nwOutline.OBJECT : KEY_NAME[nwKeyWords.OBJECT_KEY],
|
||||
nwOutline.ENTITY : KEY_NAME[nwKeyWords.ENTITY_KEY],
|
||||
nwOutline.CUSTOM : KEY_NAME[nwKeyWords.CUSTOM_KEY],
|
||||
nwOutline.SYNOP : QT_TRN("Constant", "Synopsis"),
|
||||
nwOutline.SYNOP : QT_TRANSLATE_NOOP("Constant", "Synopsis"),
|
||||
}
|
||||
|
||||
# END Class nwLabels
|
||||
@@ -226,28 +225,28 @@ class nwQuotes():
|
||||
Source: https://en.wikipedia.org/wiki/Quotation_mark
|
||||
"""
|
||||
SYMBOLS = {
|
||||
"\u0027" : QT_TRN("Constant", "Straight single quotation mark"),
|
||||
"\u0022" : QT_TRN("Constant", "Straight double quotation mark"),
|
||||
"\u0027" : QT_TRANSLATE_NOOP("Constant", "Straight single quotation mark"),
|
||||
"\u0022" : QT_TRANSLATE_NOOP("Constant", "Straight double quotation mark"),
|
||||
|
||||
"\u2018" : QT_TRN("Constant", "Left single quotation mark"),
|
||||
"\u2019" : QT_TRN("Constant", "Right single quotation mark"),
|
||||
"\u201a" : QT_TRN("Constant", "Single low-9 quotation mark"),
|
||||
"\u201b" : QT_TRN("Constant", "Single high-reversed-9 quotation mark"),
|
||||
"\u201c" : QT_TRN("Constant", "Left double quotation mark"),
|
||||
"\u201d" : QT_TRN("Constant", "Right double quotation mark"),
|
||||
"\u201e" : QT_TRN("Constant", "Double low-9 quotation mark"),
|
||||
"\u201f" : QT_TRN("Constant", "Double high-reversed-9 quotation mark"),
|
||||
"\u2e42" : QT_TRN("Constant", "Double low-reversed-9 quotation mark"),
|
||||
"\u2018" : QT_TRANSLATE_NOOP("Constant", "Left single quotation mark"),
|
||||
"\u2019" : QT_TRANSLATE_NOOP("Constant", "Right single quotation mark"),
|
||||
"\u201a" : QT_TRANSLATE_NOOP("Constant", "Single low-9 quotation mark"),
|
||||
"\u201b" : QT_TRANSLATE_NOOP("Constant", "Single high-reversed-9 quotation mark"),
|
||||
"\u201c" : QT_TRANSLATE_NOOP("Constant", "Left double quotation mark"),
|
||||
"\u201d" : QT_TRANSLATE_NOOP("Constant", "Right double quotation mark"),
|
||||
"\u201e" : QT_TRANSLATE_NOOP("Constant", "Double low-9 quotation mark"),
|
||||
"\u201f" : QT_TRANSLATE_NOOP("Constant", "Double high-reversed-9 quotation mark"),
|
||||
"\u2e42" : QT_TRANSLATE_NOOP("Constant", "Double low-reversed-9 quotation mark"),
|
||||
|
||||
"\u2039" : QT_TRN("Constant", "Single left-pointing angle quotation mark"),
|
||||
"\u203a" : QT_TRN("Constant", "Single right-pointing angle quotation mark"),
|
||||
"\u00ab" : QT_TRN("Constant", "Left-pointing double angle quotation mark"),
|
||||
"\u00bb" : QT_TRN("Constant", "Right-pointing double angle quotation mark"),
|
||||
"\u2039" : QT_TRANSLATE_NOOP("Constant", "Single left-pointing angle quotation mark"),
|
||||
"\u203a" : QT_TRANSLATE_NOOP("Constant", "Single right-pointing angle quotation mark"),
|
||||
"\u00ab" : QT_TRANSLATE_NOOP("Constant", "Left-pointing double angle quotation mark"),
|
||||
"\u00bb" : QT_TRANSLATE_NOOP("Constant", "Right-pointing double angle quotation mark"),
|
||||
|
||||
"\u300c" : QT_TRN("Constant", "Left corner bracket"),
|
||||
"\u300d" : QT_TRN("Constant", "Right corner bracket"),
|
||||
"\u300e" : QT_TRN("Constant", "Left white corner bracket"),
|
||||
"\u300f" : QT_TRN("Constant", "Right white corner bracket"),
|
||||
"\u300c" : QT_TRANSLATE_NOOP("Constant", "Left corner bracket"),
|
||||
"\u300d" : QT_TRANSLATE_NOOP("Constant", "Right corner bracket"),
|
||||
"\u300e" : QT_TRANSLATE_NOOP("Constant", "Left white corner bracket"),
|
||||
"\u300f" : QT_TRANSLATE_NOOP("Constant", "Right white corner bracket"),
|
||||
}
|
||||
|
||||
# END Class nwQuotes
|
||||
|
||||
+2
-6
@@ -130,9 +130,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: {0}").format(self._theItem.itemName)
|
||||
)
|
||||
|
||||
return theText
|
||||
@@ -178,9 +176,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: {0}").format(self._theItem.itemName)
|
||||
)
|
||||
|
||||
return True
|
||||
|
||||
+2
-2
@@ -1156,8 +1156,8 @@ class NWProject():
|
||||
if nAuth == 1:
|
||||
authString = self.bookAuthors[0]
|
||||
elif nAuth > 1:
|
||||
authString = "%s and %s" % (
|
||||
", ".join(self.bookAuthors[0:-1]), self.bookAuthors[-1]
|
||||
authString = "%s %s %s" % (
|
||||
", ".join(self.bookAuthors[0:-1]), self.tr("and"), self.bookAuthors[-1]
|
||||
)
|
||||
|
||||
return authString
|
||||
|
||||
@@ -292,8 +292,8 @@ class Tokenizer():
|
||||
|
||||
docSize = len(self.theText)
|
||||
if docSize > nwConst.MAX_DOCSIZE:
|
||||
errVal = self.tr("Document '{0}' is too big ({1}). Skipping.").format(
|
||||
self.theItem.itemName, f"{docSize/1.0e6:.2f} MB"
|
||||
errVal = self.tr("Document '{0}' is too big ({1} MB). Skipping.").format(
|
||||
self.theItem.itemName, f"{docSize/1.0e6:.2f}"
|
||||
)
|
||||
self.theText = "# %s\n\n%s\n\n" % (self.tr("ERROR"), errVal)
|
||||
self.errData.append(errVal)
|
||||
|
||||
+2
-2
@@ -28,9 +28,9 @@ import nw
|
||||
import logging
|
||||
import os
|
||||
|
||||
from time import time
|
||||
from lxml import etree
|
||||
from hashlib import sha256
|
||||
from time import time
|
||||
|
||||
from nw.core.item import NWItem
|
||||
from nw.common import checkHandle
|
||||
@@ -199,7 +199,7 @@ class NWTree():
|
||||
outFile.write("=================\n")
|
||||
outFile.write("\n")
|
||||
outFile.write("%-25s %-9s %-10s %s\n" % (
|
||||
"File Name", "Class", "Layout", "Document Label",
|
||||
"File Name", "Class", "Layout", "Document Label"
|
||||
))
|
||||
outFile.write("-"*tocLen + "\n")
|
||||
outFile.write("\n".join(tocList))
|
||||
|
||||
+25
-23
@@ -133,42 +133,44 @@ class GuiAbout(QDialog):
|
||||
"""Generate the content for the About page.
|
||||
"""
|
||||
listPrefix = " • "
|
||||
aboutMsg = "".join([
|
||||
"<h2>%s</h2>" % self.tr("About novelWriter"),
|
||||
"<p>{copyright:s}.</p>",
|
||||
"<p>%s</p>" % self.tr(
|
||||
"Website: {0}".format("<a href='{website:s}'>{domain:s}</a>")
|
||||
),
|
||||
"<p>%s</p>" % self.tr(
|
||||
webLink = f"<a href='{nw.__url__:s}'>{nw.__domain__:s}</a>"
|
||||
aboutMsg = (
|
||||
"<h2>{title1}</h2>"
|
||||
"<p>{copyright}.</p>"
|
||||
"<p>{website}</p>"
|
||||
"<p>{intro}</p>"
|
||||
"<p>{license1}</p>"
|
||||
"<p>{license2}</p>"
|
||||
"<p>{license3}</p>"
|
||||
"<h3>{title2}</h3>"
|
||||
"<p>{credits}</p>"
|
||||
).format(
|
||||
title1 = self.tr("About novelWriter"),
|
||||
copyright = nw.__copyright__,
|
||||
website = self.tr("Website: {0}").format(webLink),
|
||||
title2 = self.tr("Credits"),
|
||||
credits = "<br/>".join(["%s%s" % (listPrefix, x) for x in nw.__credits__]),
|
||||
intro = self.tr(
|
||||
"novelWriter is a markdown-like text editor designed for organising and "
|
||||
"writing novels. It is written in Python 3 with a Qt5 GUI, using PyQt5."
|
||||
),
|
||||
"<p>%s</p>" % self.tr(
|
||||
license1 = self.tr(
|
||||
"novelWriter is free software: you can redistribute it and/or modify it "
|
||||
"under the terms of the GNU General Public License as published by the "
|
||||
"Free Software Foundation, either version 3 of the License, or (at your "
|
||||
"option) any later version."
|
||||
),
|
||||
"<p>%s</p>" % self.tr(
|
||||
license2 = self.tr(
|
||||
"novelWriter is distributed in the hope that it will be useful, but "
|
||||
"WITHOUT ANY WARRANTY; without even the implied warranty of "
|
||||
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
),
|
||||
"<p>%s</p>" % (
|
||||
self.tr(
|
||||
"See the License tab for the full license text, or visit the "
|
||||
"GNU website at {0} for more details."
|
||||
).format(
|
||||
"<a href=\"https://www.gnu.org/licenses/gpl-3.0.html\">GPL v3.0</a>"
|
||||
)
|
||||
license3 = self.tr(
|
||||
"See the License tab for the full license text, or visit the "
|
||||
"GNU website at {0} for more details."
|
||||
).format(
|
||||
"<a href='https://www.gnu.org/licenses/gpl-3.0.html'>GPL v3.0</a>"
|
||||
),
|
||||
"<h3>%s</h3>" % self.tr("Credits"),
|
||||
"<p>{credits:s}</p>",
|
||||
]).format(
|
||||
copyright = nw.__copyright__,
|
||||
website = nw.__url__,
|
||||
domain = nw.__domain__,
|
||||
credits = "<br/>".join(["%s%s" % (listPrefix, x) for x in nw.__credits__]),
|
||||
)
|
||||
|
||||
theTheme = self.theParent.theTheme
|
||||
|
||||
+7
-9
@@ -986,7 +986,7 @@ class GuiBuildNovel(QDialog):
|
||||
# Report to user
|
||||
if wSuccess:
|
||||
self.theParent.makeAlert(
|
||||
"%s<br> %s" % (
|
||||
"%s<br>%s" % (
|
||||
self.tr("{0} file successfully written to:").format(textFmt), savePath
|
||||
),
|
||||
nwAlert.INFO
|
||||
@@ -1189,13 +1189,11 @@ class GuiBuildNovelDocView(QTextBrowser):
|
||||
|
||||
self.qDocument = self.document()
|
||||
self.qDocument.setDocumentMargin(self.mainConf.getTextMargin())
|
||||
self.setPlaceholderText(
|
||||
self.tr(
|
||||
"This area will show the content of the document to be "
|
||||
"exported or printed. Press the \"Build Preview\" button "
|
||||
"to generate content."
|
||||
)
|
||||
)
|
||||
self.setPlaceholderText(self.tr(
|
||||
"This area will show the content of the document to be "
|
||||
"exported or printed. Press the \"Build Preview\" button "
|
||||
"to generate content."
|
||||
))
|
||||
|
||||
theFont = QFont()
|
||||
if self.mainConf.textFont is None:
|
||||
@@ -1225,7 +1223,7 @@ class GuiBuildNovelDocView(QTextBrowser):
|
||||
|
||||
fPx = int(1.1*self.theTheme.fontPixelSize)
|
||||
|
||||
self.theTitle = QLabel("")
|
||||
self.theTitle = QLabel("", self)
|
||||
self.theTitle.setIndent(0)
|
||||
self.theTitle.setAutoFillBackground(True)
|
||||
self.theTitle.setAlignment(Qt.AlignCenter)
|
||||
|
||||
+1
-1
@@ -798,7 +798,7 @@ class GuiMainMenu(QMenuBar):
|
||||
# Search > Replace Next
|
||||
self.aReplaceNext = QAction(self.tr("Replace Next"), self)
|
||||
self.aReplaceNext.setStatusTip(
|
||||
self.tr("Find and replace next occurrence text in document")
|
||||
self.tr("Find and replace next occurrence of text in document")
|
||||
)
|
||||
self.aReplaceNext.setShortcut("Ctrl+Shift+1")
|
||||
self.aReplaceNext.triggered.connect(lambda: self._docAction(nwDocAction.REPL_NEXT))
|
||||
|
||||
@@ -27,8 +27,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
import nw
|
||||
import logging
|
||||
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtCore import QT_TRANSLATE_NOOP as QT_TRN
|
||||
from PyQt5.QtCore import Qt, QT_TRANSLATE_NOOP
|
||||
from PyQt5.QtWidgets import (
|
||||
QScrollArea, QWidget, QGridLayout, QHBoxLayout, QGroupBox, QLabel
|
||||
)
|
||||
@@ -41,10 +40,10 @@ logger = logging.getLogger(__name__)
|
||||
class GuiOutlineDetails(QScrollArea):
|
||||
|
||||
LVL_MAP = {
|
||||
"H1" : QT_TRN("GuiOutlineDetails", "Title"),
|
||||
"H2" : QT_TRN("GuiOutlineDetails", "Chapter"),
|
||||
"H3" : QT_TRN("GuiOutlineDetails", "Scene"),
|
||||
"H4" : QT_TRN("GuiOutlineDetails", "Section"),
|
||||
"H1" : QT_TRANSLATE_NOOP("GuiOutlineDetails", "Title"),
|
||||
"H2" : QT_TRANSLATE_NOOP("GuiOutlineDetails", "Chapter"),
|
||||
"H3" : QT_TRANSLATE_NOOP("GuiOutlineDetails", "Scene"),
|
||||
"H4" : QT_TRANSLATE_NOOP("GuiOutlineDetails", "Section"),
|
||||
}
|
||||
|
||||
def __init__(self, theParent):
|
||||
|
||||
@@ -200,7 +200,7 @@ class GuiPreferencesGeneral(QWidget):
|
||||
self.tr("Font size"),
|
||||
self.guiFontSize,
|
||||
self.tr("Changing this requires restarting novelWriter."),
|
||||
theUnit = "pt"
|
||||
theUnit = self.tr("pt")
|
||||
)
|
||||
|
||||
# GUI Settings
|
||||
@@ -429,7 +429,8 @@ class GuiPreferencesProjects(QWidget):
|
||||
if newDir:
|
||||
self.backupPath = newDir
|
||||
self.mainForm.setHelpText(
|
||||
self.backupPathRow, self.tr("Path: {0}").format(self.backupPath))
|
||||
self.backupPathRow, self.tr("Path: {0}").format(self.backupPath)
|
||||
)
|
||||
return True
|
||||
|
||||
return False
|
||||
@@ -486,7 +487,7 @@ class GuiPreferencesDocuments(QWidget):
|
||||
self.tr("Font size"),
|
||||
self.textSize,
|
||||
self.tr("Font size for the document editor and viewer."),
|
||||
theUnit = "pt"
|
||||
theUnit = self.tr("pt")
|
||||
)
|
||||
|
||||
# Text Flow
|
||||
|
||||
+5
-5
@@ -186,15 +186,15 @@ class GuiProjectLoad(QDialog):
|
||||
"""Browse for a folder path.
|
||||
"""
|
||||
logger.verbose("GuiProjectLoad browse button clicked")
|
||||
extFilter = [
|
||||
self.tr("novelWriter Project File ({0})").format(nwFiles.PROJ_FILE),
|
||||
self.tr("All files ({0})").format("*.*"),
|
||||
]
|
||||
dlgOpt = QFileDialog.Options()
|
||||
dlgOpt |= QFileDialog.DontUseNativeDialog
|
||||
projFile, _ = QFileDialog.getOpenFileName(
|
||||
self, self.tr("Open novelWriter Project"), "",
|
||||
";;".join([
|
||||
self.tr("novelWriter Project File ({0})").format(nwFiles.PROJ_FILE),
|
||||
self.tr("All Files (*.*)"),
|
||||
]),
|
||||
options=dlgOpt
|
||||
filter=";;".join(extFilter), options=dlgOpt
|
||||
)
|
||||
if projFile:
|
||||
thePath = os.path.abspath(os.path.dirname(projFile))
|
||||
|
||||
@@ -327,9 +327,7 @@ class GuiProjectEditStatus(QWidget):
|
||||
"""
|
||||
if self.selColour is not None:
|
||||
newCol = QColorDialog.getColor(
|
||||
self.selColour,
|
||||
self,
|
||||
self.tr("Select Colour"),
|
||||
self.selColour, self, self.tr("Select Colour"),
|
||||
QColorDialog.DontUseNativeDialog
|
||||
)
|
||||
if newCol.isValid():
|
||||
|
||||
+27
-33
@@ -95,14 +95,12 @@ class ProjWizardIntroPage(QWizardPage):
|
||||
self.theTheme = theWizard.theTheme
|
||||
|
||||
self.setTitle(self.tr("Create New Project"))
|
||||
self.theText = QLabel(
|
||||
self.tr(
|
||||
"Provide at least a working title. The working title should not "
|
||||
"be change beyond this point as it is used by the application for "
|
||||
"generating file names for for instance backups. The other fields "
|
||||
"are optional and can be changed at any time in Project Settings."
|
||||
)
|
||||
)
|
||||
self.theText = QLabel(self.tr(
|
||||
"Provide at least a working title. The working title should not "
|
||||
"be change beyond this point as it is used by the application for "
|
||||
"generating file names for for instance backups. The other fields "
|
||||
"are optional and can be changed at any time in Project Settings."
|
||||
))
|
||||
self.theText.setWordWrap(True)
|
||||
|
||||
self.imgCredit = QLabel(self.tr("Side image by {0}, {1}").format(
|
||||
@@ -166,12 +164,10 @@ class ProjWizardFolderPage(QWizardPage):
|
||||
self.theTheme = theWizard.theTheme
|
||||
|
||||
self.setTitle(self.tr("Select Project Folder"))
|
||||
self.theText = QLabel(
|
||||
self.tr(
|
||||
"Select a location to store the project. A new project folder "
|
||||
"will be created in the selected location."
|
||||
)
|
||||
)
|
||||
self.theText = QLabel(self.tr(
|
||||
"Select a location to store the project. A new project folder "
|
||||
"will be created in the selected location."
|
||||
))
|
||||
self.theText.setWordWrap(True)
|
||||
|
||||
xW = self.mainConf.pxInt(300)
|
||||
@@ -242,13 +238,11 @@ class ProjWizardPopulatePage(QWizardPage):
|
||||
self.theWizard = theWizard
|
||||
|
||||
self.setTitle(self.tr("Populate Project"))
|
||||
self.theText = QLabel(
|
||||
self.tr(
|
||||
"Choose how to pre-fill the project. Either with a minimal set of "
|
||||
"starter items, an example project explaining and showing many of "
|
||||
"the features, or show further custom options on the next page."
|
||||
)
|
||||
)
|
||||
self.theText = QLabel(self.tr(
|
||||
"Choose how to pre-fill the project. Either with a minimal set of "
|
||||
"starter items, an example project explaining and showing many of "
|
||||
"the features, or show further custom options on the next page."
|
||||
))
|
||||
self.theText.setWordWrap(True)
|
||||
|
||||
vS = self.mainConf.pxInt(12)
|
||||
@@ -299,13 +293,11 @@ class ProjWizardCustomPage(QWizardPage):
|
||||
self.theWizard = theWizard
|
||||
|
||||
self.setTitle(self.tr("Custom Project Options"))
|
||||
self.theText = QLabel(
|
||||
self.tr(
|
||||
"Select which additional root folders to make, and how to populate "
|
||||
"the Novel folder. If you don't want to add chapters or scenes, set "
|
||||
"the values to 0. You can add scenes without chapters."
|
||||
)
|
||||
)
|
||||
self.theText = QLabel(self.tr(
|
||||
"Select which additional root folders to make, and how to populate "
|
||||
"the Novel folder. If you don't want to add chapters or scenes, set "
|
||||
"the values to 0. You can add scenes without chapters."
|
||||
))
|
||||
self.theText.setWordWrap(True)
|
||||
|
||||
vS = self.mainConf.pxInt(12)
|
||||
@@ -419,12 +411,14 @@ class ProjWizardFinalPage(QWizardPage):
|
||||
self.theWizard = theWizard
|
||||
|
||||
self.setTitle(self.tr("Finished"))
|
||||
self.theText = QLabel("".join([
|
||||
"<p>%s</p>" % self.tr("All done."),
|
||||
"<p>%s</p>" % self.tr("Press '{0}' to create the new project.").format(
|
||||
self.tr("Done") if self.mainConf.osDarwin else self.tr("Finish")
|
||||
self.theText = QLabel(
|
||||
"<p>{done}</p><p>{help}</p>".format(
|
||||
done = self.tr("All done."),
|
||||
help = self.tr("Press '{0}' to create the new project.").format(
|
||||
self.tr("Done") if self.mainConf.osDarwin else self.tr("Finish")
|
||||
)
|
||||
)
|
||||
]))
|
||||
)
|
||||
self.theText.setWordWrap(True)
|
||||
|
||||
# Assemble
|
||||
|
||||
+4
-4
@@ -702,10 +702,10 @@ class GuiMain(QMainWindow):
|
||||
|
||||
lastPath = self.mainConf.lastPath
|
||||
extFilter = [
|
||||
self.tr("{0} ({1})").format(self.tr("Text files"), "*.txt"),
|
||||
self.tr("{0} ({1})").format(self.tr("Markdown files"), "*.md"),
|
||||
self.tr("{0} ({1})").format(self.tr("novelWriter files"), "*.nwd"),
|
||||
self.tr("{0} ({1})").format(self.tr("All files"), "*.*"),
|
||||
self.tr("Text files ({0})").format("*.txt"),
|
||||
self.tr("Markdown files ({0})").format("*.md"),
|
||||
self.tr("novelWriter files ({0})").format("*.nwd"),
|
||||
self.tr("All files ({0})").format("*.*"),
|
||||
]
|
||||
dlgOpt = QFileDialog.Options()
|
||||
dlgOpt |= QFileDialog.DontUseNativeDialog
|
||||
|
||||
Reference in New Issue
Block a user