From 1c9ebfd11c85d8c15247ab2afbfacfb83e271a51 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Thu, 6 May 2021 12:33:15 +0200 Subject: [PATCH] Improve feedback and documentation for i18n --- docs/source/int_started.rst | 7 ++++--- i18n/README.md | 9 ++++++++- setup.py | 6 ++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/docs/source/int_started.rst b/docs/source/int_started.rst index 79485daf..031284c7 100644 --- a/docs/source/int_started.rst +++ b/docs/source/int_started.rst @@ -106,8 +106,8 @@ Building the Translation Files If you installed novelWriter from a package, the translation files should be pre-built and included. If you're running novelWriter from the source code, you will need to generate the files -yourself. The files you need will be written to the ``i18n`` folder, and will have the ``.qm`` file -extension. +yourself. The files you need will be written to the ``nw/assets/i18n`` folder, and will have the +``.qm`` file extension. You can build the ``.qm`` files with: @@ -115,7 +115,8 @@ You can build the ``.qm`` files with: python3 setup.py qtlrelease -This requires that the Python package ``pylupdate5`` to be installed. +This requires that the Qt Linguist tool is installed on your system. On Ubuntu and Debian, the +needed package is called `qttools5-dev-tools`. .. note:: If you want to improve novelWriter with translation files for another language, or update an diff --git a/i18n/README.md b/i18n/README.md index 82c9ccfa..8f460445 100644 --- a/i18n/README.md +++ b/i18n/README.md @@ -36,9 +36,16 @@ test it. Please do not submit the `.qm` files to the repository. Only the `.ts` files in the `i18n` folder are needed. -**Note:** This requires that you have the tools Qt 5 Linguist and the PyQt5 tool `pylupdate5` +**Note** + +These commands require that you have the tools Qt 5 Linguist and the PyQt5 tool `pylupdate5` installed on your system. +For Ubuntu/Debian, run: +```bash +sudo apt install qttools5-dev-tools pyqt5-dev-tools +``` + ### Missing QtBase Translations The default Qt dialogs also have translations, for instance for standard buttons for "Yes", "No", diff --git a/setup.py b/setup.py index 1ac6eb06..1b79a80b 100755 --- a/setup.py +++ b/setup.py @@ -225,8 +225,9 @@ def buildQtI18n(): try: subprocess.call(["lrelease", "-verbose", "novelWriter.pro"]) except Exception as e: - print("QtI18n Release Error:") + print("Qt5 Linguist tools seem to be missing") print(str(e)) + sys.exit(1) print("") print("Moving QM Files to Assets") @@ -262,8 +263,9 @@ def buildQtI18nTS(): try: subprocess.call(["pylupdate5", "-verbose", "-noobsolete", "novelWriter.pro"]) except Exception as e: - print("QtI18n Release Error:") + print("PyQt5 Linguist tools seem to be missing") print(str(e)) + sys.exit(1) print("")