Skip to content

Commit

Permalink
Update build scripts for i18n docs (#2227)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkbo authored Feb 4, 2025
2 parents 99db1a1 + ceec883 commit 67a2f63
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
6 changes: 3 additions & 3 deletions novelwriter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
__author__ = "Veronica Berglyd Olsen"
__maintainer__ = "Veronica Berglyd Olsen"
__email__ = "[email protected]"
__version__ = "2.7a2"
__hexversion__ = "0x020700a2"
__date__ = "2025-01-20"
__version__ = "2.7a3"
__hexversion__ = "0x020700a3"
__date__ = "2025-02-04"
__status__ = "Stable"
__domain__ = "novelwriter.io"

Expand Down
4 changes: 2 additions & 2 deletions sample/nwProject.nwx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?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">
<project id="e2be99af-f9bf-4403-857a-c3d1ac25abea" saveCount="2153" autoCount="281" editTime="95823">
<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="2156" autoCount="281" editTime="95855">
<name>Sample Project</name>
<author>Jane Smith</author>
</project>
Expand Down
2 changes: 1 addition & 1 deletion setup/make_pip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if [ ! -d $ENVPATH ]; then
python3 -m venv $ENVPATH
fi
source $ENVPATH/bin/activate
pip3 install -r docs/requirements.txt
pip3 install -r requirements.txt -r docs/requirements.txt
python3 pkgutils.py build-assets
deactivate

Expand Down
2 changes: 1 addition & 1 deletion setup/make_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if [ ! -d $ENVPATH ]; then
python3 -m venv $ENVPATH
fi
source $ENVPATH/bin/activate
pip3 install -r docs/requirements.txt
pip3 install -r requirements.txt -r docs/requirements.txt
python3 pkgutils.py build-assets
deactivate

Expand Down
13 changes: 6 additions & 7 deletions utils/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@

from pathlib import Path

from PyQt6.QtCore import QLocale

from utils.common import ROOT_DIR, writeFile


Expand Down Expand Up @@ -289,6 +287,8 @@ def updateDocsTranslationSources(args: argparse.Namespace) -> None:

def buildDocsTranslationAssets(args: argparse.Namespace | None = None) -> None:
"""Build the documentation i18n PDF files."""
from PyQt6.QtCore import QLocale

print("")
print("Building Docs Manuals")
print("=====================")
Expand All @@ -299,7 +299,7 @@ def buildDocsTranslationAssets(args: argparse.Namespace | None = None) -> None:
pdfFile = ROOT_DIR / "docs" / "build" / "latex" / "manual.pdf"
locsDir.mkdir(exist_ok=True)

lang = args.lang
lang = args.lang if args else ["all"]
build = []
if lang == ["all"]:
build = [i.stem for i in locsDir.iterdir() if i.is_dir()]
Expand Down Expand Up @@ -334,10 +334,8 @@ def cleanBuiltAssets(args: argparse.Namespace | None = None) -> None:
print("=====================")
print("")

assets = [
ROOT_DIR / "novelwriter" / "assets" / "sample.zip",
ROOT_DIR / "novelwriter" / "assets" / "manual.pdf",
]
assets = [ROOT_DIR / "novelwriter" / "assets" / "sample.zip"]
assets.extend((ROOT_DIR / "novelwriter" / "assets").glob("manual*.pdf"))
assets.extend((ROOT_DIR / "novelwriter" / "assets" / "i18n").glob("*.qm"))
for asset in assets:
if asset.is_file():
Expand All @@ -355,4 +353,5 @@ def buildAllAssets(args: argparse.Namespace) -> None:
buildPdfManual()
buildSampleZip()
buildTranslationAssets()
buildDocsTranslationAssets()
return
4 changes: 2 additions & 2 deletions utils/build_debian.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def makeDebianPackage(

def debian(args: argparse.Namespace) -> None:
"""Build a .deb package"""
if sys.platform == "linux":
if sys.platform != "linux":
print("ERROR: Command 'build-deb' can only be used on Linux")
sys.exit(1)
signKey = SIGN_KEY if args.sign else None
Expand All @@ -167,7 +167,7 @@ def debian(args: argparse.Namespace) -> None:

def launchpad(args: argparse.Namespace) -> None:
"""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")
sys.exit(1)

Expand Down

0 comments on commit 67a2f63

Please sign in to comment.