How To Translate
(this How To is based on Bluefish Manual page : Man 1 ch12s08)
Bluefish has been translated into more than 15 different languages and this is only the beginning.
Translation process is not a difficult task but you will need some time because there are more than one thousand strings to be translated.
There are seven translation directories in Bluefish development branch, one for main program and one for each plugin:
The good news are you don't need to be a programmer to make Bluefish speak your language and the only tool you need is a text editor (Vim, Emacs, bluefish, etc.) or Poedit.
Bluefish uses po (Portable Object) files. A po file is just a plain text file that you can edit with your favorite text editor.
2. PO files basics
In a typical po file there are five major types of entries:
- Those which begin with "#:" showing the places in the source code that contains the string being translated (there may be one or more) as: '#: ../src/about.c:123'
- Those which begin with "#," containing some flags (not always present) as: '#, c-format'
- Those which begin with "msgid" containing the English string being translated (it may be spanned in several lines) as: 'msgid "Authentication is required for %s."'
- Those which begin with "msgstr" containing the translated string as: 'msgstr "Une autorisation est requise pour accéder à %s."'
- Those which begin with "#~ " containing obsolete strings as: '#~ msgid "Save document as"'
You have to make sure the translation is correct and then delete either the "#, fuzzy" line if this is the only flag on the line, or the ", fuzzy" part of the line if there are some other flags on the same line, like in "#, fuzzy, c-format".
As far as obsolete strings are concerned, it is up to you to decide if you want to remove them. On one hand they can be reused in a latter version of the po file, on the other hand they make the po file bigger.
Hence, your task as a translator is to:
- Translate all empty msgstr entries
- Check all fuzzy entries, correct them if they are wrong and remove all fuzzy tags
- Optionally, remove obsolete strings
- Check that the po file ends with a blank line
3. Shortcut keys
Shortcut keys, known as hotkeys or even accelerator keys, are defined as follows (look at the underscore, please):
# src/toolbars.c:482 #: ../src/filebrowser.c:1453 msgid "/_Refresh" msgstr "/_Actualizar"
It means that in the English locale the user have to press R or r to activate this particular GUI element. On the other hand if your locale is Spanish your shortcut key will be A or a.
4. Retriving last Bluefish version
- 1. In your working space directory (eg ~/tranlations) run:
that create the Bluefish SVN directory
- 2. cd bluefish/ and for first installation run ./autogen.sh
- 3. run ./configure and make
- 4. you can now update all files.
5. Sending your translation
- 1. update your SVN copy. In Bluefish/ dirctory run:
- 2. The following step is not necessary but it will help you finding issues, which must be fixed, before your changes can be committed to the subversion tree. It requires an installation of the gettext tools. Please change `your_lang` with your language code ;)
find . -name your_lang.po | xargs msgcat --use-first -o - | msgfmt -o /dev/null --statistics -
- 3. create the tarball:
find . -name your_lang.po | xargs tar -cjf your_lang.tar.bz2
- 4. send the tarball