18 How to translate
Bandie edited this page 2018-11-04 23:16:47 +01:00

This article will show you how you can help to translate this project.

General preparation

It would be best if you create a Linux work environment. If you're not familiar with Linux, try to take the Distrochooser test.
It might help you to choose one of the many Linux distributions.
Anyway, the following text will assume that you have chosen Ubuntu or Kubuntu or something like that.

  1. Install git on your computer.

    git: A versioning software so that you can keep track in software projects on which changing has taken place at what time and circumstances. This is what github is all about.

    Installation on (K)Ubuntu: Open the console and type sudo apt-get install git, type in your password (you won't see any dots or stars in there while typing) and it is going to be installed.

  2. If not already done, create a github account.

  3. Generate a new ssh key. Here you only need to follow the "Generating a new SSH key" steps.

  4. Add a new ssh key to your github account.

  5. Create a GPG key and add it to your GitHub account.

  6. Enable gpg signed commits by typing git config --global commit.gpgsign true in your command line.

  7. Go to this github project page 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.

  8. Clone your fork you just made from this project.

  9. 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

Are you new to .po files? You might want to read about The .po structure.

Translating the pam_panic program including the pam_panic_config script

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 to the LINGUAS file within the po directory.

Steps to do - Tech-savvy edition

  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.
  3. Change the header from "Last-Translator: <your.mail@address.tld>\n" to "Last-Translator: Your Name <your.mail@address.tld>\n"
  4. Do your translation. (You can use some .po translation programs or use online services for it)
  5. Add your language to the LINGUAS file.

Translation notes: pam_panic program / pam_panic_config

  • Please fill out translations even if they're the same, like digits.
  • Please keep the formatting of the words like in the original; e.g. ERROR should be kept uppercase.
  • Please don't translate words in surrounding of \", for example \"allow\".
  • Please include all spaces and special characters like in msgid.
  • There are two strings "We will destroy" and "when you trigger the panic function.". They are actually one sentence with something in between, as in: "We will destroy X when you trigger the panic function."

Translating the man pages (manuals)

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.
  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"
  4. Do your translation.

Translating notes: man pages

  • Please fill out translations even if they're the same, like digits or other things.
  • Translate __PAMPANICSO__, __PAMPANICPW__, __PPASSFILE__ and other weird looking stuff exactly like they're looking.
  • Please don't translate the words "reboot", "poweroff", "serious", "allow" and "reject", but include them in your text. Those are surrounded by escape sequences like "B" (which means "make the word "reboot" big).
  • Please include all spaces and special characters like in msgid, like \", B, E<lt>yourmailadress@foo.comE<gt>.
  • Seeing
    msgid ""
    "This man page has been revised by Jordy Dickinson E<lt>jordy."
    "dickinson@icloud.comE<gt>."
    
    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

  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 "/man8/pam_panic.8.gz ".
  2. Same thing for src/pam_panic_pw/man/Makefile.am.

Translating the .desktop file

The .desktop file is the link and icon for Desktop Environments. You can find the desktop file here: src/pam_panic_config/applications/pampanic-config.desktop The structure of the .desktop file will be understandable to you; nothing hard. The program behind the desktop file is not translatable yet.

Send 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