How To Translate: Difference between revisions

From Bluefish Wiki
Jump to navigation Jump to search
No edit summary
m (→‎1. Introduction: add zencoding)
 
Line 13: Line 13:
* src/plugin_infbrowser/po/
* src/plugin_infbrowser/po/
* src/plugin_snippets/po/
* src/plugin_snippets/po/
* src/plugin_zencoding/po/
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.
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.



Latest revision as of 12:41, 12 December 2011

 Translations[edit]

(this How To is based on Bluefish Manual page : Man 1 ch12s08)

1. Introduction[edit]

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:

  • po/
  • src/plugin_about/po/
  • src/plugin_charmap/po/
  • src/plugin_entities/po/
  • src/plugin_htmlbar/po/
  • src/plugin_infbrowser/po/
  • src/plugin_snippets/po/
  • src/plugin_zencoding/po/

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[edit]

In a typical po file there are five major types of entries:

  1. 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'
  2. Those which begin with "#," containing some flags (not always present) as: '#, c-format'
  3. 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."'
  4. Those which begin with "msgstr" containing the translated string as: 'msgstr "Une autorisation est requise pour accéder à %s."'
  5. Those which begin with "#~ " containing obsolete strings as: '#~ msgid "Save document as"'


Man1 warning.png When an entry is tagged as fuzzy (i.e. when the line begins with "#, fuzzy"), that means it is probably incorrect.

Man1 warning.png 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".

Man1 warning.png Remember that as long as a translation is marked "fuzzy", it will NOT actually be used!

Man1 warning.png 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:

  1. Translate all empty msgstr entries
  2. Check all fuzzy entries, correct them if they are wrong and remove all fuzzy tags
  3. Optionally, remove obsolete strings
  4. Check that the po file ends with a blank line

3. Shortcut keys[edit]

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 Alt+R to activate this particular GUI element. On the other hand if your locale is Spanish your shortcut key will be Alt+A.


Man1 warning.png You have to keep in mind that two GUI elements must not have the same shortcut key at the same level.

4. Retriving last Bluefish version[edit]

  • 1. In your working space directory (eg ~/tranlations) run:
svn co https://bluefish.svn.sourceforge.net/svnroot/bluefish/trunk/bluefish/

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.

see also Sending_Patches#Notes_for_translators

5. Sending your translation[edit]

see also Sending_Patches#Special_notes_for_translators

  • 1. update your SVN copy. In Bluefish/ dirctory run:
svn update
  • 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