novelWriter i18n and portuguese translation
This commit is contained in:
+10
-2
@@ -24,6 +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 functools import partial
|
||||
import nw
|
||||
import logging
|
||||
import os
|
||||
@@ -32,6 +33,8 @@ from lxml import etree
|
||||
from hashlib import sha256
|
||||
from time import time
|
||||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
|
||||
from nw.core.item import NWItem
|
||||
from nw.common import checkHandle
|
||||
from nw.constants import (
|
||||
@@ -79,6 +82,8 @@ class NWTree():
|
||||
|
||||
self._handleSeed = None # Used for generating handles for testing
|
||||
|
||||
self.tr = partial(QCoreApplication.translate, self.__class__.__name__)
|
||||
|
||||
return
|
||||
|
||||
##
|
||||
@@ -195,11 +200,14 @@ class NWTree():
|
||||
tocText = os.path.join(self.theProject.projPath, nwFiles.TOC_TXT)
|
||||
with open(tocText, mode="w", encoding="utf8") as outFile:
|
||||
outFile.write("\n")
|
||||
outFile.write("Table of Contents\n")
|
||||
outFile.write("%s\n" % self.tr("Table of Contents"))
|
||||
outFile.write("=================\n")
|
||||
outFile.write("\n")
|
||||
outFile.write("%-25s %-9s %-10s %s\n" % (
|
||||
"File Name", "Class", "Layout", "Document Label"
|
||||
self.tr("File Name"),
|
||||
self.tr("Class"),
|
||||
self.tr("Layout"),
|
||||
self.tr("Document Label"),
|
||||
))
|
||||
outFile.write("-"*tocLen + "\n")
|
||||
outFile.write("\n".join(tocList))
|
||||
|
||||
Reference in New Issue
Block a user