From 658953df1514d662c3081168f7fe3757e3ffa83d Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Thu, 19 Oct 2023 02:54:22 +0200 Subject: [PATCH 1/2] Add note about pkgutils dependency on PyQt6 for qtlupdate --- i18n/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/i18n/README.md b/i18n/README.md index 159eee73..1c5303a1 100644 --- a/i18n/README.md +++ b/i18n/README.md @@ -48,6 +48,7 @@ instance `en_GB` for British English. You will need the translation tool Qt 5 Linguist on your system. For Ubuntu/Debian, run: + ```bash sudo apt install qttools5-dev-tools ``` @@ -75,6 +76,7 @@ The `i18n` folder at the root of the repository contains the `nw_XX.ts` translat Whether to add a new language to the translation framework, or to update the file against the current source code, you must first run the `qtlupdate` command: + ```bash python3 pkgutils.py qtlupdate i18n/nw_XX.ts ``` @@ -86,6 +88,10 @@ be a valid ISO language code, otherwise novelWriter will not accept the file. For instance, the French translation uses the language code `fr_FR`, so its translation file will be `nw_fr_FR.ts` +Note: The `qtlupdate` command needs the `lupdate` tool provided by PyQt6, which uses the latest +TS file format. The tool in PyQt5 generates an older file format. On Debian/Ubuntu it is provided +by the package `pyqt6-dev-tools`. + ### Edit the Translation File in Qt Linguist @@ -100,6 +106,7 @@ Please select "English" and "United Kingdom" as the _source_ language if prompte The application does not use `.ts` files directly. The `novelwriter/assets/i18n/nw_XX.qm` files are the actual files used to translate the GUI into another language other than the default British English. These files are not generated by default, but they can be built with: + ```bash python3 pkgutils.py qtlrelease ``` From bc1b5f24a0517e6c357de2d3cc729a265a227745 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Thu, 19 Oct 2023 02:58:29 +0200 Subject: [PATCH 2/2] Add more information in error output from pkgutils --- pkgutils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgutils.py b/pkgutils.py index 840ffef7..99f77521 100755 --- a/pkgutils.py +++ b/pkgutils.py @@ -325,6 +325,7 @@ def buildQtI18nTS(sysArgs): from PyQt6.lupdate import lupdate except ImportError: print("ERROR: This command requires lupdate from PyQt6") + print("On Debian/Ubuntu, install: pyqt6-dev-tools") sys.exit(1) print("")