Updated How to translate (markdown)

Bandie 2018-10-08 20:02:28 +02:00
parent 4b3203c454
commit a926928f4b

@ -17,16 +17,27 @@ then [add it to your github account](https://help.github.com/articles/adding-a-n
3. Go to [this github project page](https://github.com/pampanic/pam_panic/wiki/How-to-translate) and fork this project. (Click on **Fork** in the upper right.) 3. Go to [this github project page](https://github.com/pampanic/pam_panic/wiki/How-to-translate) and fork this project. (Click on **Fork** in the upper right.)
> **Forking:** You are about to create an own version of a project. It will copy its content to your account under a new project, and github will note that this fork exist. After you pressed the Fork button you will be in your **own** project afterwards. > **Forking:** You are about to create an own version of a project. It will copy its content to your account under a new project, and github will note that this fork exist. After you pressed the Fork button you will be in your **own** project afterwards.
4. [Clone your fork](https://help.github.com/articles/cloning-a-repository/) you just made from this project 4. [Clone your fork](https://help.github.com/articles/cloning-a-repository/) you just made from this project.
5. (Optional:) Get an editor for po files like `poedit` or use an online service for it.
5. _Optional:_ Get an editor for po files like `poedit` or use an online service for it.
**Installation on (K)Ubuntu:** `sudo apt-get install poedit` **Installation on (K)Ubuntu:** `sudo apt-get install poedit`
Are you new to .po files? You might want to read about [The .po structure](https://github.com/pampanic/pam_panic/wiki/The-.po-structure). Are you new to .po files? You might want to read about [The .po structure](https://github.com/pampanic/pam_panic/wiki/The-.po-structure).
# Translating the program # Translating the pam_panic program
## Steps to do ## Steps to do for `poedit`
1. Open `poedit`.
2. Go to _Edit -> Preferences_
3. Put in your (nick-)name and email address and close the window.
4. Click on "Create New Translation".
5. Change into the `po` directory of your cloned pam_panic project and choose the file `pam_panic.pot`.
6. Do your translation.
7. Save your translation.
8. Add your [two-letter language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) to the `LINGUAS` file within the po directory.
## Steps to do - Tech-savvy edition
1. Change into the `po` directory. 1. Change into the `po` directory.
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. 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.
3. Change the header from `"Last-Translator: <your.mail@address.tld>\n"` to `"Last-Translator: Your Name <your.mail@address.tld>\n"` 3. Change the header from `"Last-Translator: <your.mail@address.tld>\n"` to `"Last-Translator: Your Name <your.mail@address.tld>\n"`
@ -41,12 +52,22 @@ Are you new to .po files? You might want to read about [The .po structure](https
- Please include all spaces and special characters like in `msgid`. - Please include all spaces and special characters like in `msgid`.
# Translating the man pages # Translating the man pages (manuals)
## Steps to do ## Steps to do for `poedit`
1. Open `poedit`.
2. Go to _Edit -> Preferences_
3. Put in your (nick-)name and email address and close the window.
4. Click on "Create New Translation".
5. Change into the `po4a` directory of your cloned pam_panic project and choose the file `pam_panic.pot`.
6. Do your translation.
7. Save your translation.
## Steps to do - Tech-savvy edition
1. Change into the `po4a` directory. 1. Change into the `po4a` directory.
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. 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.
3. Change the header from "Last-Translator: <your.mail@address.tld>" to "Last-Translator: Your Name <your.mail@address.tld>" 3. Change the header from "Last-Translator: <your.mail@address.tld>" to "Last-Translator: Your Name <your.mail@address.tld>"
4. Do your translation.
## Translating notes: man pages ## Translating notes: man pages
- Please fill out translations even if they're the same, like digits or other things. - Please fill out translations even if they're the same, like digits or other things.
@ -59,16 +80,23 @@ Are you new to .po files? You might want to read about [The .po structure](https
"This man page has been revised by Jordy Dickinson E<lt>jordy." "This man page has been revised by Jordy Dickinson E<lt>jordy."
"dickinson@icloud.comE<gt>." "dickinson@icloud.comE<gt>."
``` ```
Put your own name and mail address into the msgstr, with a sentence like `This man page has been translated by Name E<lt>mail@address.tldE<gt>` (translated of course). Put your own name and mail address into that translation, with a sentence like `This man page has been translated by Name E<lt>mail@address.tldE<gt>` (translated of course).
## Integration of the man pages ## Integration of the man pages
- 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 \". 1. 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`. 2. Same thing for `src/pam_panic_pw/man/Makefile.am`.
# Send a pull request # Send a pull request
After you're satisfied with your work, make a pull request. After you're satisfied with your work:
1. Open the console.
2. Use `cd` to change into the pam_panic directory. E.g. `cd pam_panic` to go into the directory pam_panic.
3. Type `git add . ` (yes, a dot). It will add all changings you've made to the git system.
4. Type `git commit -m "Translation for YOUR_LANGUAGE_HERE"` to make it ready to push to the github servers. The text within the quotes will be the message about the changing you've done.
5. Type `git push` to push it into your project on github. You'll need to use your github credentials to push them up.
6. [Create a pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/)