Update readmes
This commit is contained in:
@@ -39,6 +39,10 @@ Contributions to this project are welcome. However, please read the
|
||||
[Contributing Guide](https://github.com/vkbo/novelWriter/blob/main/CONTRIBUTING.md) before
|
||||
submitting larger additions or changes.
|
||||
|
||||
If you want to help translating novelWriter into another language, please see the
|
||||
[README](https://github.com/vkbo/novelWriter/blob/main/i18n/README.md) in the `nw/assets/i18n`
|
||||
folder.
|
||||
|
||||
## Key Features
|
||||
|
||||
Some key features of novelWriter are listed below. Consult the
|
||||
|
||||
+32
-34
@@ -1,58 +1,56 @@
|
||||
# novelWriter Internationalisation
|
||||
|
||||
The `i18n` folder contains the internationalisation files for novelWriter.
|
||||
There are two types of files. The `nw_XX.ts` / `nw_XX.qm` files are for
|
||||
localisation of the main GUI, and the `project_XX.json` files are JSON files
|
||||
with translation maps for the novelWriter projects, used by the Build Novel
|
||||
Project tool.
|
||||
The `i18n` folder contains the translation files for the Qt5 GUI. There are two types of files
|
||||
involved: the `nw_XX.ts` and the `nw_XX.qm` files. The `nw_XX.ts` files are located in the `i18n`
|
||||
folder at the root of the repository, and the `nw_XX.qm` together with the `project_XX.json` files
|
||||
are located in `nw/assets/i18n`. The latter are JSON files translation maps for the novelWriter
|
||||
projects, used by the Build Novel Project tool.
|
||||
|
||||
## GUI Localisation
|
||||
## Qt GUI Localisation
|
||||
|
||||
The `.qm` files are the actual files used by the application to translate the
|
||||
GUI into another language other than the default British English. The files are
|
||||
not generated by default. They can be built with:
|
||||
The `.qm` files are the actual files used by the application to translate the GUI into another
|
||||
language other than the default British English. The files are not generated by default. They can
|
||||
be built with:
|
||||
```bash
|
||||
python3 setup.py qtlrelease
|
||||
```
|
||||
|
||||
To add a new translation file, first add a new entry in the `novelWriter.pro`
|
||||
file under the `TRANSLATIONS` variable. Please use the underscore syntax for
|
||||
file names as the importer expects this format.
|
||||
To add a new translation file, first add a new entry in the `novelWriter.pro` file under the
|
||||
`TRANSLATIONS` variable. Please use the underscore syntax for file names as the importer expects
|
||||
this format.
|
||||
|
||||
After adding the entry in the `.pro` file, run:
|
||||
```bash
|
||||
python3 setup.py qtlupdate
|
||||
```
|
||||
|
||||
This will build a new `nw_XX.ts` file for the language you just added. The file
|
||||
can then be edited with the Qt 5 Linguist application provided by Qt. This is
|
||||
by far easier than manually editing the `.ts` file. Please select "English" and
|
||||
"United Kingdom" as the source langauge when prompted by Qt 5 Linguist.
|
||||
This will build a new `i18n/nw_XX.ts` file for the language you just added. The file can then be
|
||||
edited with the Qt 5 Linguist application provided by Qt. This is by far easier than manually
|
||||
editing the `.ts` file. Please select "English" and "United Kingdom" as the source langauge when
|
||||
prompted by Qt 5 Linguist.
|
||||
|
||||
When you're done editing, you can build the `nw_XX.qm` file and test it in
|
||||
novelWriter. The Preferences dialog should list the newly added language, and
|
||||
you can select it and test it.
|
||||
When you're done editing, you can build the `nw/assets/i18n/nw_XX.qm` file and test it in
|
||||
novelWriter. The Preferences dialog should list the newly added language, and you can select it and
|
||||
test it.
|
||||
|
||||
Please do not submit the `.qm` files to the repository. Only the `.ts` files
|
||||
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 `pylupdate5`
|
||||
**Note:** This requires that you have the tools Qt 5 Linguist and the PyQt5 tool `pylupdate5`
|
||||
installed on your system.
|
||||
|
||||
## Project Localisation
|
||||
|
||||
Projects can have a different language setting than the GUI itself. The files
|
||||
with format `project_XX.json` are simple translation maps for text that goes
|
||||
into the exported documents generated by the Build Novel Project tool.
|
||||
Projects can have a different language setting than the GUI itself. The files with format
|
||||
`project_XX.json` in `nw/assets/i18n` are simple translation maps for text that goes into the
|
||||
exported documents generated by the Build Novel Project tool.
|
||||
|
||||
The files are loaded based on the language setting on the build tool. At the
|
||||
present time, no other parts of the application use these files. Since these
|
||||
are used as replacement lookups, they are maintained as plain JSON files. The
|
||||
main usage is to generate chapter headers as number words.
|
||||
The files are loaded based on the language setting in the build tool. At the present time, no other
|
||||
parts of the application use these files. Since these are used as replacement lookups, they are
|
||||
maintained as plain JSON files. The main usage is to generate chapter headers as number words.
|
||||
|
||||
There is no trick to using these files. Just copy the `project_en.json` file,
|
||||
rename it to the appropriate language coded filename, and edit it. Please use
|
||||
the underscore as separator if a language needs to be localised to a specific
|
||||
country under a language. The importer will for instance look for `en_US`
|
||||
first, then use `en` if it is not found. If there are no matching files, the
|
||||
project falls back to using English.
|
||||
Adding new translations for these files is easy. Just copy the `project_en.json` file, rename it to
|
||||
the appropriate language coded filename, and edit it. Please use the underscore as separator if a
|
||||
language needs to be localised to a specific country under a language. The importer will for
|
||||
instance look for `en_US` first, then use `en` if it is not found. If there are no matching files,
|
||||
the project falls back to using English.
|
||||
|
||||
Reference in New Issue
Block a user