How to translate LXDE components
The LXDE Project is currently discussing how to make it easier for translators to contribute. At the moment, Pootle is being used.
In the meantime you can contribute by editing .po files. In the following a description how to do this. It is an early draft, please add information and correct it, if you find mistakes.
- 1 How to translate .po-files for LXDE components
- 2 Translating LXLauncher tabs
- 3 Programs to use for translation
How to translate .po-files for LXDE components
- read the Pootle crash course
- visit http://pootle.lxde.org
- register an account and activate it
- get used to the interface
- to be able to add the translated strings to the project file the language has to be "maintained" in pootle, this can be activated by a language coordinator or brother (preferrably you choose to talkt to brother- at IRC or email (firstname.lastname@example.org)).
Get the empty files
When you have got your language added to the Pootle server you just visit http://pootle.lxde.bsnet.se/YOUR LANGUAGE CODE/lxde/review.html and download either one file at a time or a zip file with all the files.
Add a header
Open the file in a regular text editor. Make sure that you add your name and mail address in the boiler plate (first few lines). Example:
# Swedish translation for lxterminal. # Copyright (C) 2009 Free Software Foundation, Inc. # This file is distributed under the same license as the lxterminal package. # Daniel Nylander <email@example.com>, 2009. #
Translate with a program
Choose a Program from the list at the end of the page.
- Translate *.po files with Poedit
- To write: guide for other tools.
Get some feedback
Frequently, these tiny accelerators (_) are overseen when translating files. However, they are nice and convenient for all kind of users (those who are reluctance to mice, those with disabilities etc. as they offer accessibility of menu items, checkboxes and buttons by typing letters only, making access really fast and comfortable) and hence you want to insure that they are all correctly translated:
msgcheck -o /dev/null --check-accelerator=_ lang.po
This will tell you where you broke your translation or forgot to translate a string.
msgcheck is only available if you have intltool installed. This is not requiered.
Test your translation
Now, you have translated everything, all accelerators are included as well in a convenient style, i.e. no duplicate accelerators on dialogs and in menus, and want to test your translation. This step need intltool to work.
msgfmt -o lang.gmo lang.po
Which is going to produce the compiled translation file that only needs to be copied over the existing translation, e.g. in /usr/local/share/locale/pt_BR/LC_MESSAGES/lxpanel.mo for the component LXPanel and Brazilian Portuguese.
You need certain privileges in Pootle to be able to add the file there. Go to the overview page for your language http://pootle.lxde.bsnet.se/YOU LANGUAGE CODE/lxde/ and scroll to the bottom. Make sure that the file you upload have the same name as the one you want to replace. Find it via the brose button and then hit upload, select either merge or overwrite in the form above the button. That's all needed.
Translating LXLauncher tabs
Get the code
svn co https://lxde.svn.sourceforge.net/svnroot/lxde/trunk/ ./lxde
Note revision number!
Realize the patch
mkdir lxde/lxlauncher/data_`whoami` cp lxde/lxlauncher/data/* lxde/lxlauncher/data_`whoami` cd lxde/lxlauncher/data_`whoami` ls lxde*
Edit all files; after:
cd - diff lxde/lxlauncher/data/ lxde/lxlauncher/data_`whoami`/ -uN > ~/path/that/you/prefer/patch_lxlauncher
- Summary: something like "Italian translation for menu items"
- Description: something like
Translation of LXLauncher tabs in Italian. Obtained with diff -uN
- File: attach your file (patch_lxlauncher)
- Description: something like "File to patch using SVN revision XXXX"
Programs to use for translation
Recommended PO file editors are (in no particular order):
- XEmacs (with po-mode): runs on Unices with X
- GNU Emacs (with po-mode): runs on Unices and Windows
- Lokalize: The replacement of Kbabel for KDE4.
- poEdit: Linux, MacOSX and Windows.
- OmegaT, another translation tool for PO files. It is written in Java so it is available for multiple platforms (including Linux, Mac and Windows). It can be downloaded here.
- For Mac OS X there is AquaEmacs and a port of GNU Emacs available using carbon for OS X. Also see the Emacs wiki for more usage help and tips. po-mode is not included, but is easy to add. Get it from the GNU gettext distribution.
- GNU Gettext (Linux/Unix) used for the GNU Translation Project. Gettext also provides msgmerge that makes merging translations easy.
- Vim (Linux/Unix and Windows versions available) with PO ftplugin for easier editing of GNU gettext PO files.
- gted is an eclipse plugin that turns eclipse into a gettext editor. Eclipse is written in Java, so this editor is platform independent.
- POEditor: online localization platform
Be sure to get a recent version for all editors, multiple plural forms are a recent addition to the gettext standard.