Skip to content

Commit

Permalink
Update i18n readme (#1539)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkbo authored Oct 19, 2023
2 parents 60b977f + bc1b5f2 commit 181809d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions i18n/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down Expand Up @@ -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
```
Expand All @@ -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

Expand All @@ -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
```
Expand Down
1 change: 1 addition & 0 deletions pkgutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("")
Expand Down

0 comments on commit 181809d

Please sign in to comment.