-
Notifications
You must be signed in to change notification settings - Fork 22
HowTo: Translations
Translating Multiload-ng to a new language is very simple. Here are required steps.
Open terminal in a directory of your choice, and type:
git clone https://github.com/udda/multiload-ng
Download a ZIP containing the source here. Unpack in a directory of your choice.
You will need xgettext tool, contained in gettext package. You probably already have it installed, if not consult your distro documentation for install instructions.
Once you have xgettext, move to the directory where you downloaded the source and execute the following command:
xgettext --no-location -k -k_ -f po/POTFILES.in -o po/template.po --package-name=multiload-ng --add-comments=xgettext --from-code=UTF-8
Don't use -i
(indent) option as it will mess up localization of .desktop files.
Ignore any warning about invalid non-blank line. This is due xgettext does not recognize Desktop file type from its raw extension (.desktop.in.in)
This will create an empty translation file in po/template.po. If this file exists and is already partially translated, you can join new translatable strings appending -j
to the above command line.
If you are
- too lazy, or in a hurry
- not interested in translating lastest code
you can just take an existing translation (language doesn't matter) and then change author, language, and, of course, translations!
Note that this way you could miss some strings (added after the release of edited .po, or original translator might have forgot some lines). Make sure to double check. In any case, when you send translation to me, I will notice you about any missing string.
Now it's time to translate! You can use specialized tool or edit directly the source.
Install a CAT (Computer Aided Translation) tool that supports gettext format. I recommend GTranslator. Edit your template.po, translate every string and save the file.
Don't forget to set metadata too (date, author, language, ...)
If you don't want to use external tools (and you know how to manually edit a .po file), you can open template.po with any text editor of your choice. Translate every string and save the file.
Don't forget to set metadata too (date, author, language, ...). They are located at the beginning of the file.
Once you have a translated file, you can test it. Rename the file with the ISO code of the translated language (like es.po for Spanish or it.po for Italian) and put it into po directory of the source.
Build and install the plugin (instructions in README) and run into with the new language. You can test it easily with standalone plugin:
env LC_ALL=es multiload-ng
Replace es with your language.
Congratulations! You just translated an application into your language!
You can now send translated file to [email protected], or make a pull request, so it can be included in the source.
Thank you!