Updated How to translate (markdown)

Bandie 2018-09-30 13:38:16 +02:00
parent c2fa318066
commit 78135b6f10

@ -1,7 +1,7 @@
This article will show you how you can help to translate this project. This article will show you how you can help to translate this project.
## Preparation ## Preparation
1. Install git and gettext. 1. Install git, gettext and po4a.
2. Fork this project. 2. Fork this project.
3. Clone your fork on your computer. 3. Clone your fork on your computer.
@ -9,10 +9,17 @@ This article will show you how you can help to translate this project.
We will begin with the simplest translations: We will begin with the simplest translations:
## Translation within the program - gettext ## Translation within the program - gettext
1. Change into the `po` directory. 1. Run `autoreconf -i && ./configure`.
2. Run `msginit --locale=<your locale here>` (for example `msginit --locale=de_DE.UTF-8`). This will ask for some information about you. It will generate a file ending with `.po` which you want to translate. 2. Change into the `po` directory.
3. Run `msginit --locale=<your locale here>` (for example `msginit --locale=de_DE.UTF-8`). This will ask for your mail adress. It will generate a file ending with `.po` which you want to translate.
4. Change the header from `"Last-Translator: <your.mail@address.tld>\n"` to `"Last-Translator: Your Name <your.mail@address.tld>\n"`
5. Do your translation. (You can use some .po translation programs)
6. Add your language to the `LINGUAS` file.
7. Run `make update-po`.
### .po translation convention
### .po gettext translation convention
- Please fill out translations even if they're the same, like digits.
- Please don't translate words with big letters, for example `ERROR`. - Please don't translate words with big letters, for example `ERROR`.
- Please don't translate words in surrounding of `\"`, for example `\"allow\"`. - Please don't translate words in surrounding of `\"`, for example `\"allow\"`.
- Please include all spaces and special characters like in `msgid`. - Please include all spaces and special characters like in `msgid`.
@ -55,33 +62,21 @@ msgstr ""
## man pages ## man pages
Sadly there's no system implemented yet to translate man pages. It means you have to do it by hand.
### man pages location
The man pages are at
```
src/pam_panic/man/man8
src/pam_panic_pw/man/man1
```
### Preparation ### Preparation
For pam_panic: 1. Change into the `po4a` directory.
1. Go to `src/pam_panic/man`. 2. Run `msginit --locale=<your locale here>` (for example `msginit --locale=de_DE.UTF-8`). This will ask for your mail adress. It will generate a file ending with `.po` which you want to translate.
2. Make a new directory called like your ISO locale. (de for German, es for Spanish, ...). `mkdir de`. 3. Change the header from "Last-Translator: <your.mail@address.tld>" to "Last-Translator: Your Name <your.mail@address.tld>"
3. Copy recursively the man[digit] to your directory which you just created. `cp -r man8 de`.
For pam_panic_pw: ### .po4a man page translation convention
1. Go to `src/pam_panic_pw/man`. - Please fill out translations even if they're the same, like digits.
2. Make a new directory called like your ISO locale. (de for German, es for Spanish, ...). `mkdir de`. - Please don't translate the words "reboot", "poweroff", "serious", "allow" and "reject". Those are surrounded by escape sequences like "B<reboot>" (which means "make the word "reboot" big).
3. Copy recursively the man[digit] to your directory which you just created. `cp -r man1 de`. - Please don't translate words in surrounding of `\"`, for example `\"allow\"`.
- Please include all spaces and special characters like in `msgid`.
### Translate
Try to translate the man page. The man page file is ending with a digit like `pam_panic.8`.
You will see something like `\fBpam_panic\&.so\fR` which looks weird:
- `\fB` and `\fR` are formatting control characters. Just try to adopt them.
- `\&.` is actually a `.`. You need to escape dots like this. Sadly.
### Integration of the man pages ### Integration of the man pages
- Open `src/pam_panic/man/Makefile.am` and put your new man page path into the `nobase_dist_cant_believe_its_not_man_DATA` list. Note that you have to add a `\` at the end of the last entry.
- Open `src/pam_panic/man/Makefile.am` and put your new language in the `nobase_dist_cant_believe_its_not_man_DATA` list. Note that you have to add a `\` at the end of the last entry. It will look like "<yourISOlanghere>/man8/pam_panic.8.gz \".
- Same thing for `src/pam_panic_pw/man/Makefile.am`. - Same thing for `src/pam_panic_pw/man/Makefile.am`.