Difference between revisions of "Translate *.po files with Poedit"

From LXDE.org
Jump to: navigation, search
(created page)
 
 
(17 intermediate revisions by 8 users not shown)
Line 1: Line 1:
=translate *.po files with Poedit=
+
This is a description how to translate LXDE components with Poedit. It is not complete and may be wrong at some places edit when I missed something important or even said something wrong (hope not ;)).
This is a Description how to translate LXDE components with Poedit. It is not Complete and may be wrong at some places edit when I missed something important or even said something wrong (hope not ;)).
 
 
 
==Get the code==
 
First of all you should get the latest code from svn. To do so type in the following
 
  <nowiki>svn co https://lxde.svn.sourceforge.net/svnroot/lxde/trunk/ ./lxde</nowiki>
 
into a Terminal. You also can use a script for this.
 
  <nowiki>#!/bin/bash
 
# svn_co_lxde.sh
 
# autor maces
 
 
 
if [ -z $1 ]
 
then
 
xterm -e $0 copy
 
else
 
        echo "starting"
 
        echo "------------------"
 
        svn co https://lxde.svn.sourceforge.net/svnroot/lxde/trunk/ ./lxde
 
       
 
        echo "------------------"
 
        echo "(program exited with code: $?)"
 
        echo "Press return to continue"
 
        #to be more compatible with shells like dash
 
        dummy_var=""
 
        read dummy_var
 
fi
 
exit</nowiki>The script opens xterm and execute the same command as above. Make sure to make it executable (chmod 755 ./svn_co_lxde.sh). You now should have the latest code in ./lxde.  
 
  
 
==Install Poedit==
 
==Install Poedit==
 
Of course we need Poedit, so just install it (as root).
 
Of course we need Poedit, so just install it (as root).
  
Archlinux:
+
Arch Linux:
 
   pacman -Sy poedit
 
   pacman -Sy poedit
  
Ubuntu:
+
Debian/Ubuntu:
   apt-get install poedit
+
   aptitude install poedit
 +
 
 +
Fedora:
 +
  yum install poedit
 +
 
 +
Foresight:
 +
  conary install poedit
 +
 
 +
Gentoo:
 +
  emerge app-i18n/poedit
 +
 
 +
Windows:
 +
  Download: http://www.poedit.net/download.php#win32
  
Please add the command for your Distro
+
Please add the command for your distro.
  
 
==Translating==
 
==Translating==
Line 45: Line 31:
  
 
===Open a *.po file===
 
===Open a *.po file===
This way when you want to edit an existing yourlanguage.po file. Click on File->Open navigate to ./lxde/lxmusic/po and open lxmusic.pot with Poedit and open the file.
+
This way when you want to edit an existing yourlanguage.po file. Click on File->Open navigate to ./lxde/lxmusic/po and open lxmusic.po with Poedit and open the file.
  
 
===Start translating===
 
===Start translating===
 
You should see something like this (If it doesn't check Menu->View).
 
You should see something like this (If it doesn't check Menu->View).
  
[[Image:Poedit-mainscreen.png]]
+
[[Image:Poedit-mainscreen.png|550px]]
 +
 
 +
Here is a explanation of what you see.
  
Here an explanation of what you see.
+
[[Image:Poedit-mainscreen-explanations.png|550px]]
  
[[Image:Poedit-mainscreen-explanations.png]]
+
Now we start translating. Simply select the strings you want to translate by click on them and insert the translation in the empty box under the original text (look at the Image). Go on like this until you are ready.
  
Now we start translating. Simply select the words you want to translate by click on them and insert the translation in the empty box under the original text (look at the Image). Go on like this until you are ready.
+
(hint: ctrl+up/down arrow moves between the strings)
  
 
===Fuzzy translations===
 
===Fuzzy translations===
If you think the translation is only quick and dirty/ not so good select the fuzzy button and you will see it is marked.
+
A translation can be marked as fuzzy, a fuzzy translation can originate from more or less two sources. The first one being yourself - or one of your peers. If a string is roughly translated and needs more attention it's wise to mark it fuzzy to make it easy to find and review. The second source for fuzzy strings are msgmerge or something similar, when mergin an old translation with an updated template (.pot) msgmerge will note updated english strings with fuzzy to notify the translator to review the translations.
 +
 
 +
Do '''not''' leave fuzzy strings in translations considered done!
  
 
[[Image:Fuzzy-button.png]]
 
[[Image:Fuzzy-button.png]]
  
[[Image:Fuzzy-translations.png]]
+
[[Image:Fuzzy-translations.png|550px]]
  
 
===Edit Comment===
 
===Edit Comment===
For editing/making a comment simply click on the Edit button and insert a comment in the Window which will appear.
+
For editing/making a comment simply click on the edit button (next to fuzzy button) and insert a comment in the Window which will appear.
  
 
[[Image:Edit-comment.png]]
 
[[Image:Edit-comment.png]]
Line 82: Line 72:
 
To save the .*po file just Click on File->Save.
 
To save the .*po file just Click on File->Save.
  
==Upload translation==
+
[[Category:LXDE]]
There are (at the moment)two ways to upload the translations.
+
[[Category:Projects]]
 
+
[[Category:Translations]]
===Way1 - The tracker===
+
[[Category:How to]]
For this way you need an SF.net account. Go to https://sourceforge.net/tracker2/?group_id=180858&atid=894871 and click on add new artifact. As subject use something like "German translation for lxmusic" and choose "Translations" as Category. Type in a nice text and don't forget to attach your *.po file. After this click on Add Artifact and you are ready.
 
  
===Way2 - The Mailinglist===
+
[[fr:Traduction de fichiers *.po avec Poedit]]
For this way you need to subscribe to translation@mailinglist.lxde.org. If you are subscribed write a email to translation@mailinglist.lxde.org with Something like "German translation for lxmusi" as subject. Type in a nice text and don't forget to attach your *.po file. After this send the email and you are ready.
 

Latest revision as of 09:01, 7 January 2014

This is a description how to translate LXDE components with Poedit. It is not complete and may be wrong at some places edit when I missed something important or even said something wrong (hope not ;)).

Install Poedit

Of course we need Poedit, so just install it (as root).

Arch Linux:

 pacman -Sy poedit

Debian/Ubuntu:

 aptitude install poedit

Fedora:

 yum install poedit

Foresight:

 conary install poedit

Gentoo:

 emerge app-i18n/poedit

Windows:

 Download: http://www.poedit.net/download.php#win32

Please add the command for your distro.

Translating

In this example we are going to translate LXMusic (Just change the path for another Program).

Open a *.pot file

This way when there is no yourlanguage.po file. Click on File->New catalog from POT file, navigate to ./lxde/lxmusic/po and open lxmusic.pot with Poedit and open the file. Now insert the wanted informations (if you want) and click OK. Now you have to choose the *.po file which will be generated. Please name it like de_DE.po/es_ES.po/zh_TW.po/... .

Open a *.po file

This way when you want to edit an existing yourlanguage.po file. Click on File->Open navigate to ./lxde/lxmusic/po and open lxmusic.po with Poedit and open the file.

Start translating

You should see something like this (If it doesn't check Menu->View).

Poedit-mainscreen.png

Here is a explanation of what you see.

Poedit-mainscreen-explanations.png

Now we start translating. Simply select the strings you want to translate by click on them and insert the translation in the empty box under the original text (look at the Image). Go on like this until you are ready.

(hint: ctrl+up/down arrow moves between the strings)

Fuzzy translations

A translation can be marked as fuzzy, a fuzzy translation can originate from more or less two sources. The first one being yourself - or one of your peers. If a string is roughly translated and needs more attention it's wise to mark it fuzzy to make it easy to find and review. The second source for fuzzy strings are msgmerge or something similar, when mergin an old translation with an updated template (.pot) msgmerge will note updated english strings with fuzzy to notify the translator to review the translations.

Do not leave fuzzy strings in translations considered done!

Fuzzy-button.png

Fuzzy-translations.png

Edit Comment

For editing/making a comment simply click on the edit button (next to fuzzy button) and insert a comment in the Window which will appear.

Edit-comment.png

You easily can see if a translation contains a comment by the comment icon in front of the original text in the mainview.

Comment-symbol.png

What have I changed

To check what you have changed look for lines with a star in front of the original text.

Changed-symbol.png

Save the translation

To save the .*po file just Click on File->Save.