Translation Team/i18n Best Practices: Difference between revisions

Godiard (talk | contribs)
No edit summary
Francis (talk | contribs)
Add coding header tip
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>{{ GoogleTrans-en | es =show | bg =show | zh-CN =show | zh-TW =show | hr =show | cs =show | da =show | nl =show | fi =show | fr =show | de =show | el =show | hi =show | it =show | ja =show | ko =show | no =show | pl =show | pt =show | ro =show | ru =show | sv =show }} </noinclude>{{TOCright}}
<noinclude>{{ GoogleTrans-en | es =show | bg =show | zh-CN =show | zh-TW =show | hr =show | cs =show | da =show | nl =show | fi =show | fr =show | de =show | el =show | hi =show | it =show | ja =show | ko =show | no =show | pl =show | pt =show | ro =show | ru =show | sv =show }} </noinclude>{{TOCright}}
= General tips =
= General tips =
Here are some general tips which will make your translators happy
Here are some general tips which will make your translators happy.  For a much more comprehensive list of best practices, please read the [http://live.gnome.org/TranslationProject/DevGuidelines | Gnome i18n Guidelines].
== When in doubt, use translator-comments ==
== When in doubt, use translator-comments ==
When you are using a string which may be confusing for the translators (contextual issues, or cultural issues), or if you want the string to be translated according to a particular convention, use translator-comments, which would show up alongside the message in the PO file translator get when they translate you software. Example (from Calculate activity)
When you are using a string which may be confusing for the translators (contextual issues, or cultural issues), or if you want the string to be translated according to a particular convention, use translator-comments, which would show up alongside the message in the PO file translator get when they translate you software. Example (from Calculate activity)
Line 25: Line 25:


== Use plural forms ==
== Use plural forms ==
Do not assume that all languages have a concept of singular and plural like English. Some languages might have a single form, and some have more than two form. Use [http://www.gnu.org/software/automake/manual/gettext/Plural-forms.html plural forms] via ''ngettext()'' in these cases. Example (from sugar-update-control):
Do not assume that all languages have a concept of singular and plural like English. Some languages might have a single form, and some have more than two form. Use [http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms plural forms] via ''ngettext()'' in these cases. Example (from sugar-update-control):
<pre>
<pre>
                 header = gettext.ngettext("You can install %s update",
                 header = gettext.ngettext("You can install %s update",
Line 92: Line 92:


Make a request by filing a ticket on bugs.sugarlabs.org. You should set Type to 'task' and Component to 'localization'. Please include a link to the project page on git.sugarlabs.org (or whatever other repository you use).
Make a request by filing a ticket on bugs.sugarlabs.org. You should set Type to 'task' and Component to 'localization'. Please include a link to the project page on git.sugarlabs.org (or whatever other repository you use).
== Specify the character encoding if necessary ==
Python files with non-ascii characters or declaring strings representing them, need to add the following line to the header.
  # -*- coding: utf-8 -*-
If not, the pootle helper won't generate the pot/po files.