Difference between revisions of "Translation information"
(More faithful to page titles) |
(Review) |
||
Line 19: | Line 19: | ||
Recommended: | Recommended: | ||
* [https://poedit.net/ Poedit] | * [https://poedit.net/ Poedit] (cross-platform); | ||
* [https://userbase.kde.org/Lokalize Lokalize] (KDE) | * [https://userbase.kde.org/Lokalize Lokalize] (KDE). | ||
You might also try: | You might also try: | ||
* Emacs' po-mode (contained in the gettext distribution; the version in po-utils is old) | * Emacs' po-mode (contained in the gettext distribution; the version in po-utils is old); | ||
* [https://wiki.gnome.org/action/show/Apps/Gedit gedit] | * [https://wiki.gnome.org/action/show/Apps/Gedit gedit] — text editor for GNOME desktops, has a syntax highlight mode for PO file syntax; | ||
* [http://virtaal.translatehouse.org/ Virtaal] — cross-platform PO editor that is clean, simple to use yet powerful | * [http://virtaal.translatehouse.org/ Virtaal] — cross-platform PO editor that is clean, simple to use yet powerful; | ||
* [https://wiki.gnome.org/Apps/Gtranslator Gtranslator] | * [https://wiki.gnome.org/Apps/Gtranslator Gtranslator] (GNOME). | ||
And last but not least, [http://www.gnu.org/software/gettext/manual/ gettext] utils, which are installed on every Linux distribution. You can see a complete reference too from installed info pages by running the command: | And last but not least, [http://www.gnu.org/software/gettext/manual/ gettext] utils, which are installed on every Linux distribution. You can see a complete reference too from installed info pages by running the command: | ||
Line 50: | Line 50: | ||
* The original string that the msgid represents was changed in the source code. A typo in the string may have been fixed or the string altered in some other way. The translator needs to check that the msgstr is still valid and make changes if necessary. | * The original string that the msgid represents was changed in the source code. A typo in the string may have been fixed or the string altered in some other way. The translator needs to check that the msgstr is still valid and make changes if necessary. | ||
* A new string has been added to the source, and the string is similar (but not identical) to the msgid of an already existing, translated message. Then the msgstr of that message will be automatically reused for the new message, but the new message will also at the same time be marked fuzzy so that the translator knows there is some difference that he or she needs to adapt the translation to match. | * A new string has been added to the source, and the string is similar (but not identical) to the msgid of an already existing, translated message. Then the msgstr of that message will be automatically reused for the new message, but the new message will also at the same time be marked fuzzy so that the translator knows there is some difference that he or she needs to adapt the translation to match. | ||
=== A few important things to remember === | === A few important things to remember === | ||
* Some strings that can be ambiguous or having several meanings according to different contexts may have a context prefix : ‘Context|Ambiguous string’. In this case, simply translate ‘Ambiguous string’, the ‘Context|’ | * Some strings that can be ambiguous or having several meanings according to different contexts may have a context prefix : ‘Context|Ambiguous string’. In this case, simply translate ‘Ambiguous string’, the ‘Context|’ part is just a not to translate indication (some info on how to disambiguate a string can be found [https://developer.gnome.org/glib/unstable/glib-I18N.html#Q-:CAPS here]). | ||
* After translating a fuzzy string (one that is marked with a ", fuzzy" comment), please remove its | * After translating a fuzzy string (one that is marked with a <code>", fuzzy"</code> comment), please remove its fuzzy tag — otherwise this translation will be discarded by the build process, meaning that this string will show up untranslated. | ||
* Before publishing your work (after you have finished updating the PO file), please update the "PO-Revision-Date" and "Last-Translator" fields in the PO file header. | * Before publishing your work (after you have finished updating the PO file), please update the <code>"PO-Revision-Date"</code> and <code>"Last-Translator"</code> fields in the PO file header. | ||
If you use a translation software, it may automatically deal with the last two points for you (see its preferences). | If you use a translation software, it may automatically deal with the last two points for you (see its preferences). | ||
Line 63: | Line 61: | ||
=== Verification === | === Verification === | ||
Before submitting your file to the project, | Before submitting your file to the project, you should make sure it is valid. | ||
* Make sure the file is encoded in UTF-8. | * Make sure the file is encoded in UTF-8. | ||
* Make sure it is a valid | * Make sure it is a valid PO file and obtain some statistics about it: simply run <code>msgfmt --statistics -cv translation_file.po</code> from a command window. | ||
* Make sure it is correctly formatted: run <code>check-markup translation_file.po</code> from a command window and verify it doesn't output any error message. The ‘check-markup’ Perl script can be found in the /po directory of Inkscape trunk. | * Make sure it is correctly formatted: run <code>check-markup translation_file.po</code> from a command window and verify it doesn't output any error message. The ‘check-markup’ Perl script can be found in the /po directory of Inkscape trunk. | ||
If your translation software can compile PO files to .mo, it should detect any errors when you save your translations so you don't need to do any further verifications. | |||
=== Programmers === | === Programmers === | ||
There is always one special message in each valid PO file: the PO file header. It is encoded with the msgid for the empty string (<code>""</code>) as the key, and the actual header values are in the msgstr part. This unfortunately means that if you mark an empty string for translation, you will get the entire PO file header back as the ‘translation’. In almost all cases this is probably not what you want. Hence, do not mark empty strings for translation. | |||
Please make sure you use [http://www.gnu.org/software/gettext/manual/html_mono/gettext.html#SEC150 dgettext] for any pluralized strings. | Please make sure you use [http://www.gnu.org/software/gettext/manual/html_mono/gettext.html#SEC150 dgettext] for any pluralized strings. |
Revision as of 21:39, 16 July 2016
This page gathers useful information about translation.
Links and docs
- How to contribute in translation
- Translations statistics
- Using Inkscape's repositories
- Subscribe to the translator mailing list
- Translator mailing list archives
- Interface translation
- Documentation translation
- Website translation
PO translation files
Tools for translators
You can edit PO files from any plain text editor, since they are simple text files. However, many useful tools have been developed to provide a simple experience translating PO files.
Recommended:
You might also try:
- Emacs' po-mode (contained in the gettext distribution; the version in po-utils is old);
- gedit — text editor for GNOME desktops, has a syntax highlight mode for PO file syntax;
- Virtaal — cross-platform PO editor that is clean, simple to use yet powerful;
- Gtranslator (GNOME).
And last but not least, gettext utils, which are installed on every Linux distribution. You can see a complete reference too from installed info pages by running the command:
info gettext
File format
If you open a PO file with a text editor for the first time, you will find its syntax very simple. The PO format is a really simple format, which probably at least partly explains its success and widespread use. The format is basically a hash list consisting of msgid and msgstr pairs, with the msgid being the original English string and key, and the msgstr being the translated value of it. Below is an example of a message.
#: gedit/dialogs/gedit-plugin-program-location-dialog.c:78 #: gedit/dialogs/program-location-dialog.glade2.h:2 msgid "Set program location..." msgstr "Ställ in programplats..."
In addition to the msgid and msgstr parts, a message usually also has lines starting with #:
that tell what source files and what lines the string used as msgid was extracted from. These lines have no syntactic value. They are only there as a help for translators and developers to know where a message came from.
A message in a PO file can be in one of essentially three different states. The message can be translated, fuzzy, or untranslated. A message counts as translated as soon as the msgstr part of it is non-empty. In a similar manner, an untranslated message is one where the msgstr is empty. The fuzzy state is special and essentially means that there is a translation in the msgstr part, but that this translation is most likely not entirely correct, and that it thus needs manual attention by a translator. A message can become fuzzy in one of two ways:
- The original string that the msgid represents was changed in the source code. A typo in the string may have been fixed or the string altered in some other way. The translator needs to check that the msgstr is still valid and make changes if necessary.
- A new string has been added to the source, and the string is similar (but not identical) to the msgid of an already existing, translated message. Then the msgstr of that message will be automatically reused for the new message, but the new message will also at the same time be marked fuzzy so that the translator knows there is some difference that he or she needs to adapt the translation to match.
A few important things to remember
- Some strings that can be ambiguous or having several meanings according to different contexts may have a context prefix : ‘Context|Ambiguous string’. In this case, simply translate ‘Ambiguous string’, the ‘Context|’ part is just a not to translate indication (some info on how to disambiguate a string can be found here).
- After translating a fuzzy string (one that is marked with a
", fuzzy"
comment), please remove its fuzzy tag — otherwise this translation will be discarded by the build process, meaning that this string will show up untranslated. - Before publishing your work (after you have finished updating the PO file), please update the
"PO-Revision-Date"
and"Last-Translator"
fields in the PO file header.
If you use a translation software, it may automatically deal with the last two points for you (see its preferences).
Verification
Before submitting your file to the project, you should make sure it is valid.
- Make sure the file is encoded in UTF-8.
- Make sure it is a valid PO file and obtain some statistics about it: simply run
msgfmt --statistics -cv translation_file.po
from a command window. - Make sure it is correctly formatted: run
check-markup translation_file.po
from a command window and verify it doesn't output any error message. The ‘check-markup’ Perl script can be found in the /po directory of Inkscape trunk.
If your translation software can compile PO files to .mo, it should detect any errors when you save your translations so you don't need to do any further verifications.
Programmers
There is always one special message in each valid PO file: the PO file header. It is encoded with the msgid for the empty string (""
) as the key, and the actual header values are in the msgstr part. This unfortunately means that if you mark an empty string for translation, you will get the entire PO file header back as the ‘translation’. In almost all cases this is probably not what you want. Hence, do not mark empty strings for translation.
Please make sure you use dgettext for any pluralized strings.
Review
This is the start of a list of places to get translation reviews done. So far: