The project language files should obviously also be in the i18n folder

This commit is contained in:
Veronica K. B. Olsen
2021-02-17 12:14:57 +01:00
parent 51564d1adc
commit 35b8e389a3
6 changed files with 5 additions and 7 deletions
+1 -3
View File
@@ -76,7 +76,6 @@ class Config:
self.themeRoot = None # The full path to the nw/assets/themes folder
self.dictPath = None # The full path to the nw/assets/dict folder
self.iconPath = None # The full path to the nw/assets/icons folder
self.langPath = None # The full path to the nw/assets/lang folder
self.helpPath = None # The full path to the novelwriter .qhc help file
# Runtime Settings and Variables
@@ -298,7 +297,6 @@ class Config:
self.themeRoot = os.path.join(self.assetPath, "themes")
self.dictPath = os.path.join(self.assetPath, "dict")
self.iconPath = os.path.join(self.assetPath, "icons")
self.langPath = os.path.join(self.assetPath, "lang")
self.appIcon = os.path.join(self.iconPath, "novelwriter.svg")
# Internationalisation
@@ -384,7 +382,7 @@ class Config:
for lngPath, lngBase in langList:
for lngCode in self.qLocal.uiLanguages():
qTrans = QTranslator()
lngFile = "%s_%s" % (lngBase, lngCode)
lngFile = "%s_%s" % (lngBase, lngCode.replace("-", "_"))
if lngFile not in self.qtTrans:
if qTrans.load(lngFile, lngPath):
logger.debug("Loaded: %s" % qTrans.filePath())
+3 -3
View File
@@ -1254,9 +1254,9 @@ class NWProject():
theLang = "en"
lngShort = theLang.split("_")[0]
loadFile = os.path.join(self.mainConf.langPath, "project_en.json")
chkFile1 = os.path.join(self.mainConf.langPath, "project_%s.json" % theLang)
chkFile2 = os.path.join(self.mainConf.langPath, "project_%s.json" % lngShort)
loadFile = os.path.join(self.mainConf.nwLangPath, "project_en.json")
chkFile1 = os.path.join(self.mainConf.nwLangPath, "project_%s.json" % theLang)
chkFile2 = os.path.join(self.mainConf.nwLangPath, "project_%s.json" % lngShort)
if os.path.isfile(chkFile1):
loadFile = chkFile1
+1 -1
View File
@@ -563,7 +563,7 @@ class ToOdt(Tokenizer):
##
if len(theText) != len(theFmt):
# Genrate dummy format if there isn't any
# Generate dummy format if there isn't any or it doesn't match
theFmt = " "*len(theText)
# XML functions