Update build scripts for i18n docs (#2227)

This commit is contained in:
Veronica Berglyd Olsen
2025-02-04 16:43:06 +01:00
committed by GitHub
6 changed files with 15 additions and 16 deletions
+3 -3
View File
@@ -47,9 +47,9 @@ __license__ = "GPLv3"
__author__ = "Veronica Berglyd Olsen" __author__ = "Veronica Berglyd Olsen"
__maintainer__ = "Veronica Berglyd Olsen" __maintainer__ = "Veronica Berglyd Olsen"
__email__ = "code@vkbo.net" __email__ = "code@vkbo.net"
__version__ = "2.7a2" __version__ = "2.7a3"
__hexversion__ = "0x020700a2" __hexversion__ = "0x020700a3"
__date__ = "2025-01-20" __date__ = "2025-02-04"
__status__ = "Stable" __status__ = "Stable"
__domain__ = "novelwriter.io" __domain__ = "novelwriter.io"
+2 -2
View File
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="2.7a2" hexVersion="0x020700a2" fileVersion="1.5" fileRevision="4" timeStamp="2025-01-18 15:16:45"> <novelWriterXML appVersion="2.7a3" hexVersion="0x020700a3" fileVersion="1.5" fileRevision="4" timeStamp="2025-02-04 13:53:28">
<project id="e2be99af-f9bf-4403-857a-c3d1ac25abea" saveCount="2153" autoCount="281" editTime="95823"> <project id="e2be99af-f9bf-4403-857a-c3d1ac25abea" saveCount="2156" autoCount="281" editTime="95855">
<name>Sample Project</name> <name>Sample Project</name>
<author>Jane Smith</author> <author>Jane Smith</author>
</project> </project>
+1 -1
View File
@@ -17,7 +17,7 @@ if [ ! -d $ENVPATH ]; then
python3 -m venv $ENVPATH python3 -m venv $ENVPATH
fi fi
source $ENVPATH/bin/activate source $ENVPATH/bin/activate
pip3 install -r docs/requirements.txt pip3 install -r requirements.txt -r docs/requirements.txt
python3 pkgutils.py build-assets python3 pkgutils.py build-assets
deactivate deactivate
+1 -1
View File
@@ -16,7 +16,7 @@ if [ ! -d $ENVPATH ]; then
python3 -m venv $ENVPATH python3 -m venv $ENVPATH
fi fi
source $ENVPATH/bin/activate source $ENVPATH/bin/activate
pip3 install -r docs/requirements.txt pip3 install -r requirements.txt -r docs/requirements.txt
python3 pkgutils.py build-assets python3 pkgutils.py build-assets
deactivate deactivate
+6 -7
View File
@@ -28,8 +28,6 @@ import zipfile
from pathlib import Path from pathlib import Path
from PyQt6.QtCore import QLocale
from utils.common import ROOT_DIR, writeFile from utils.common import ROOT_DIR, writeFile
@@ -289,6 +287,8 @@ def updateDocsTranslationSources(args: argparse.Namespace) -> None:
def buildDocsTranslationAssets(args: argparse.Namespace | None = None) -> None: def buildDocsTranslationAssets(args: argparse.Namespace | None = None) -> None:
"""Build the documentation i18n PDF files.""" """Build the documentation i18n PDF files."""
from PyQt6.QtCore import QLocale
print("") print("")
print("Building Docs Manuals") print("Building Docs Manuals")
print("=====================") print("=====================")
@@ -299,7 +299,7 @@ def buildDocsTranslationAssets(args: argparse.Namespace | None = None) -> None:
pdfFile = ROOT_DIR / "docs" / "build" / "latex" / "manual.pdf" pdfFile = ROOT_DIR / "docs" / "build" / "latex" / "manual.pdf"
locsDir.mkdir(exist_ok=True) locsDir.mkdir(exist_ok=True)
lang = args.lang lang = args.lang if args else ["all"]
build = [] build = []
if lang == ["all"]: if lang == ["all"]:
build = [i.stem for i in locsDir.iterdir() if i.is_dir()] build = [i.stem for i in locsDir.iterdir() if i.is_dir()]
@@ -334,10 +334,8 @@ def cleanBuiltAssets(args: argparse.Namespace | None = None) -> None:
print("=====================") print("=====================")
print("") print("")
assets = [ assets = [ROOT_DIR / "novelwriter" / "assets" / "sample.zip"]
ROOT_DIR / "novelwriter" / "assets" / "sample.zip", assets.extend((ROOT_DIR / "novelwriter" / "assets").glob("manual*.pdf"))
ROOT_DIR / "novelwriter" / "assets" / "manual.pdf",
]
assets.extend((ROOT_DIR / "novelwriter" / "assets" / "i18n").glob("*.qm")) assets.extend((ROOT_DIR / "novelwriter" / "assets" / "i18n").glob("*.qm"))
for asset in assets: for asset in assets:
if asset.is_file(): if asset.is_file():
@@ -355,4 +353,5 @@ def buildAllAssets(args: argparse.Namespace) -> None:
buildPdfManual() buildPdfManual()
buildSampleZip() buildSampleZip()
buildTranslationAssets() buildTranslationAssets()
buildDocsTranslationAssets()
return return
+2 -2
View File
@@ -157,7 +157,7 @@ def makeDebianPackage(
def debian(args: argparse.Namespace) -> None: def debian(args: argparse.Namespace) -> None:
"""Build a .deb package""" """Build a .deb package"""
if sys.platform == "linux": if sys.platform != "linux":
print("ERROR: Command 'build-deb' can only be used on Linux") print("ERROR: Command 'build-deb' can only be used on Linux")
sys.exit(1) sys.exit(1)
signKey = SIGN_KEY if args.sign else None signKey = SIGN_KEY if args.sign else None
@@ -167,7 +167,7 @@ def debian(args: argparse.Namespace) -> None:
def launchpad(args: argparse.Namespace) -> None: def launchpad(args: argparse.Namespace) -> None:
"""Wrapper for building Debian packages for Launchpad.""" """Wrapper for building Debian packages for Launchpad."""
if sys.platform == "linux": if sys.platform != "linux":
print("ERROR: Command 'build-ubuntu' can only be used on Linux") print("ERROR: Command 'build-ubuntu' can only be used on Linux")
sys.exit(1) sys.exit(1)