How To Translate: Difference between revisions
Created page with ' == 8. Translations == === 8.1. Introduction === Bluefish has been translated into more than 15 different languages and this is only the beginning. Translation process is not…' |
No edit summary |
||
Line 1: | Line 1: | ||
== Translations == | |||
== | (this How To is based on Bluefish Manual page : [[Man 1 ch12s08]]) | ||
=== 1. Introduction === | |||
=== | |||
Bluefish has been translated into more than 15 different languages and this is only the beginning. | 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. 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.) | Translation process is not a difficult task but you will need some time because there are more than one thousand strings to be translated. <br /> | ||
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/ | |||
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. | 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: | 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: ' | # Those which begin with "#:" showing the places in the source code that contains the string being translated (there may be one or more) as: '<nowiki>#: ../src/about.c:123</nowiki>' | ||
# Those which begin with "#," containing some flags (not always present) as: ' | # Those which begin with "#," containing some flags (not always present) as: '<nowiki>#, c-format</nowiki>' | ||
# Those which begin with "msgid" containing the English string being translated (it may be spanned in several lines) as: ' | # 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: ' | # 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: ' | # Those which begin with "#~ " containing obsolete strings as: '<nowiki>#~ msgid "Save document as"</nowiki>' | ||
[[Image:Man1_warning.png]] When an entry is tagged as fuzzy (i.e. when the line begins with " | [[Image:Man1_warning.png]] When an entry is tagged as fuzzy (i.e. when the line begins with "<nowiki>#, fuzzy</nowiki>"), that means it is probably incorrect. | ||
[[Image:Man1_warning.png]] You have to make sure the translation is correct and then delete either the " | [[Image:Man1_warning.png]] You have to make sure the translation is correct and then delete either the "<nowiki>#, fuzzy</nowiki>" 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 "<nowiki>#, fuzzy, c-format</nowiki>". | ||
[[Image:Man1_warning.png]] Remember that as long as a translation is marked "fuzzy", it will NOT actually be used! | [[Image:Man1_warning.png]] Remember that as long as a translation is marked "fuzzy", it will NOT actually be used! | ||
Line 35: | Line 43: | ||
# Check that the po file ends with a blank line | # 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): | Shortcut keys, known as hotkeys or even accelerator keys, are defined as follows (look at the underscore, please): | ||
Line 47: | Line 55: | ||
[[Image:Man1_warning.png]] You have to keep in mind that two GUI elements must not have the same shortcut key at the same level. | [[Image: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=== | |||
* 1. In your working space directory (eg ~/tranlations) run: <br /> | |||
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 === | |||
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 |
Revision as of 10:54, 20 September 2009
Translations
(this How To is based on Bluefish Manual page : Man 1 ch12s08)
1. Introduction
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/
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"'
When an entry is tagged as fuzzy (i.e. when the line begins with "#, fuzzy"), that means it is probably incorrect.
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".
Remember that as long as a translation is marked "fuzzy", it will NOT actually be used!
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 Alt+R to activate this particular GUI element. On the other hand if your locale is Spanish your shortcut key will be Alt+A.
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
- 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
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