The i18n files are no read from assets, while the ts files remain in the root folder
This commit is contained in:
@@ -8,6 +8,10 @@
|
|||||||
setup.iss
|
setup.iss
|
||||||
novelwriter.desktop
|
novelwriter.desktop
|
||||||
novelWriter.pyw
|
novelWriter.pyw
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
/nw/assets/i18n/*.qm
|
||||||
|
.qmake.stash
|
||||||
i18n/*.qm
|
i18n/*.qm
|
||||||
i18n/*.qph
|
i18n/*.qph
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -307,7 +307,7 @@ class Config:
|
|||||||
self.appIcon = os.path.join(self.iconPath, "novelwriter.svg")
|
self.appIcon = os.path.join(self.iconPath, "novelwriter.svg")
|
||||||
|
|
||||||
# Internationalisation
|
# Internationalisation
|
||||||
self.nwLangPath = os.path.join(self.appRoot, "i18n")
|
self.nwLangPath = os.path.join(self.assetPath, "i18n")
|
||||||
|
|
||||||
logger.verbose("App path: %s" % self.appPath)
|
logger.verbose("App path: %s" % self.appPath)
|
||||||
logger.verbose("Last path: %s" % self.lastPath)
|
logger.verbose("Last path: %s" % self.lastPath)
|
||||||
|
|||||||
@@ -217,12 +217,36 @@ def buildQtDocs():
|
|||||||
def buildQtI18n():
|
def buildQtI18n():
|
||||||
"""Build the lang.qm files for Qt Linguist.
|
"""Build the lang.qm files for Qt Linguist.
|
||||||
"""
|
"""
|
||||||
|
print("")
|
||||||
|
print("Building Qt Localisation Files")
|
||||||
|
print("==============================")
|
||||||
|
print("")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.call(["lrelease", "-verbose", "novelWriter.pro"])
|
subprocess.call(["lrelease", "-verbose", "novelWriter.pro"])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("QtI18n Release Error:")
|
print("QtI18n Release Error:")
|
||||||
print(str(e))
|
print(str(e))
|
||||||
|
|
||||||
|
print("")
|
||||||
|
print("Copying Files to nw/assets")
|
||||||
|
print("")
|
||||||
|
|
||||||
|
langDir = os.path.join("nw", "assets", "i18n")
|
||||||
|
for langFile in os.listdir("i18n"):
|
||||||
|
langPath = os.path.join("i18n", langFile)
|
||||||
|
if not os.path.isfile(langPath):
|
||||||
|
continue
|
||||||
|
|
||||||
|
if langFile.endswith(".qm"):
|
||||||
|
destPath = os.path.join(langDir, langFile)
|
||||||
|
os.rename(langPath, destPath)
|
||||||
|
print("Moved: %s -> %s" % (langPath, destPath))
|
||||||
|
|
||||||
|
print("")
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
##
|
##
|
||||||
# Qt Linguist TS Builder (qtlupdate)
|
# Qt Linguist TS Builder (qtlupdate)
|
||||||
##
|
##
|
||||||
@@ -230,12 +254,21 @@ def buildQtI18n():
|
|||||||
def buildQtI18nTS():
|
def buildQtI18nTS():
|
||||||
"""Build the lang.ts files for Qt Linguist.
|
"""Build the lang.ts files for Qt Linguist.
|
||||||
"""
|
"""
|
||||||
|
print("")
|
||||||
|
print("Building Qt Translation Files")
|
||||||
|
print("=============================")
|
||||||
|
print("")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.call(["pylupdate5", "-verbose", "-noobsolete", "novelWriter.pro"])
|
subprocess.call(["pylupdate5", "-verbose", "-noobsolete", "novelWriter.pro"])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("QtI18n Release Error:")
|
print("QtI18n Release Error:")
|
||||||
print(str(e))
|
print(str(e))
|
||||||
|
|
||||||
|
print("")
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
##
|
##
|
||||||
# Sample Project ZIP File Builder (sample)
|
# Sample Project ZIP File Builder (sample)
|
||||||
##
|
##
|
||||||
|
|||||||
Reference in New Issue
Block a user