Translations: Difference between revisions

From GNU MediaGoblin Wiki
Jump to navigation Jump to search
(Update template location)
 
(37 intermediate revisions by 10 users not shown)
Line 1: Line 1:
= For translators =
= For translators =


<pre style="color: red;">This section has changed recently, since now Mediagoblin lives on Pootle.
You can translate our tools at Transifex:
Here you can find the basic information for translating.
For further details about using Pootle, please have a look at Pootle's Documentation:
http://docs.translatehouse.org/projects/pootle/en/stable-2.5.1/
or you can ask about more details using one of methods listed on http://mediagoblin.org/pages/join.html</pre>


It is very easy to add or complete the translation of MediaGoblin! We use the web interface provided by the GNU instance of Pootle to do the translations. You can see the current status of the translations per language [https://chapters.gnu.org/projects/mediagoblin/ here].
https://www.transifex.net/projects/p/mediagoblin/resource/mediagoblin/

To start translating, just:

# If it's the first time you are translating in the GNU instance of Pootle, then [https://chapters.gnu.org/accounts/register/ register an account]. You will receive an email for activating your account.
# Then you can [https://chapters.gnu.org/accounts/login log in]
# Go to Projects > mediagoblin ([https://chapters.gnu.org/projects/mediagoblin/ direct URL] and click in your language
# Click on "Continue translation".

By default, Pootle only shows you strings that currently have no translation. You can click in the "Translate" tab to show the already translated strings, in case you want to improve any of them.
There are no translation teams, so you can just edit the strings (but try to be nice and consistent with the current translation). If you are a regular contributor to the translations, you might want to add some notes to the [[#Notes for some language teams|per-language section on this page]] to coordinate consistent translations.

Note: please don't translate the words "MediaGoblin" or "GNU" into your native language. Those words should be retained as-is for branding reasons. :)

==Fixing or improving translations ==

If you click in the "Overview" tab, you will see the status of the translation of MediaGoblin to your language. If you click on "Expand details" you will find some statistics and the results of several quality checks (about capitalization, punctuation matching or not the original and the translation) which may help you to fix or improve the translation.

== Notes for some language teams ==
=== German ===

Interessante Hinweise zur Übersetzung finden sich bei Gnome:
* http://live.gnome.org/de/UebersetzungsRichtlinien

In Abweichung von diesen Richtlinien wird momentan "Du" für die Anrede benutzt. "Du" und "Deine" werden groß geschrieben. Benutze die folgenden Begriffe um konsistent zu bleiben:

Benutzerkonto/Nutzerkonto, E-Mail, E-Mail-Adresse, Aktivierungsmail, Konto "aktivieren" (verify email), Album (collection), Kurztitel (slug)

=== Spanish ===

Se está adoptando la siguiente convención para la traducción al español. Si crees que alguna traducción se puede mejorar, sugiérela en la página de discusión de este artículo.

{|
!Inglés
!Español
!Comentarios
|-
|you
|tú
|(segunda persona del singular, expresión informal)
|-
|media
|contenido
|-
|slug
|ficha
|}

=== '''العربية''' ===

.سنتخذ الاصطلاحات التالية للترجمة العربية. إذا كنت تريد تحسين الترجمة يرجى اقتراح التغبرات في صفحة النقاش في هذا المقال
{|
!الانجليزية
!العربية
|-
|MediaGoblin .
|ميدياغوبلن
|-
|media .
|الميديا
|-
|slug .
|المسار
|}


= For developers =
= For developers =
== Marking strings for translation ==
=== In Jinja2 ===

See: http://jinja.pocoo.org/docs/templates/#i18n

Mostly like Django template i18n support, if you have any experience with that.

=== In python code ===

Usually, like this:

<pre>
from mediagoblin.util import pass_to_ugettext as _

def some_func(something):
return _(u'This string would tooootally be translatable now.')
</pre>

Except, in form modules we don't actually want to translate things because for various reasons that doesn't work, so we do the translation call template-side. So write the module to use the fake ugettext passthrough (which doesn't do any translation but still wraps things in _() so that Babel will know to extract these strings):

<pre>
from mediagoblin.util import fake_ugettext_passthrough as _

class FunkyMonkeyForm(wtforms.Form):
funky = wtforms.TextAreaField(
_('Funkiness description'))
</pre>

== Extracting translations ==
== Extracting translations ==


Line 11: Line 106:


<pre>
<pre>
./bin/pybabel extract -F babel.ini -o mediagoblin/i18n/en/LC_MESSAGES/mediagoblin.po .
./bin/pybabel extract -F babel.ini -o mediagoblin/i18n/templates/en/mediagoblin.po .
</pre>
</pre>


Line 20: Line 115:
</pre>
</pre>


== Pulling translations from Transifex ==
== Pulling translations from Transifex (Warning! Obsolete) ==

<pre style="color: red;">This section contains obsolete information. Now Mediagoblin lives on Pootle.
Before the section is updated, you can ask about the process using one of methods listed on
http://mediagoblin.org/pages/join.html</pre>


Unfortunately until the next release of transifex-client which has been patched to have proper entry points, you have to run transifex-client from a virtualenv or from site-packages. But assuming that's done, pulling translations is easy:
Unfortunately until the next release of transifex-client which has been patched to have proper entry points, you have to run transifex-client from a virtualenv or from site-packages. But assuming that's done, pulling translations is easy:
Line 28: Line 127:
</pre>
</pre>


== Pushing new translations to Transifex ==
== Pushing new translations to Transifex (Warning! Obsolete) ==

<pre style="color: red;">This section contains obsolete information. Now Mediagoblin lives on Pootle.
Before the section is updated, you can ask about the process using one of methods listed on
http://mediagoblin.org/pages/join.html</pre>



<pre>
<pre>
tx push -s
tx push -s
</pre>
</pre>

= Troubleshooting (Warning! Obsolete) =

<pre style="color: red;">This section contains obsolete information. Now Mediagoblin lives on Pootle.
Before the section is updated, you can ask about the process using one of methods listed on
http://mediagoblin.org/pages/join.html</pre>


Got an error on Transifex like:

"Translation must start with a newline (\n)"?

The problem here is when we have something like:

{% trans register_url=request.urlgen('mediagoblin.auth.register') %}
<a class="header_submit_highlight" href="{{ register_url }}">Create a free account</a>
or
<a class="header_submit" href="http://wiki.mediagoblin.org/HackingHowto">Set up MediaGoblin on your own server</a>
{% endtrans %}

instead of:

{% trans register_url=request.urlgen('mediagoblin.auth.register') -%}
<a class="header_submit_highlight" href="{{ register_url }}">Create a free account</a>
or
<a class="header_submit" href="http://wiki.mediagoblin.org/HackingHowto">Set up MediaGoblin on your own server</a>
{%- endtrans %}

The distinction might not be obvious... look for the %} versus -%} and {% versus {%- on the first and last lines. The thing about this is this tells Jinja2 to strip the whitespace. Without that, Transifex sees that there's a "\n" on the first line of the original but not on the future translation, and gets upset.

If this happens the template should be updated to strip whitespace and translations should be pushed to transifex.

Latest revision as of 08:22, 22 July 2015

For translators

This section has changed recently, since now Mediagoblin lives on Pootle.
Here you can find the basic information for translating.
For further details about using Pootle, please have a look at Pootle's Documentation:
http://docs.translatehouse.org/projects/pootle/en/stable-2.5.1/
or you can ask about more details using one of methods listed on http://mediagoblin.org/pages/join.html

It is very easy to add or complete the translation of MediaGoblin! We use the web interface provided by the GNU instance of Pootle to do the translations. You can see the current status of the translations per language here.

To start translating, just:

  1. If it's the first time you are translating in the GNU instance of Pootle, then register an account. You will receive an email for activating your account.
  2. Then you can log in
  3. Go to Projects > mediagoblin (direct URL and click in your language
  4. Click on "Continue translation".

By default, Pootle only shows you strings that currently have no translation. You can click in the "Translate" tab to show the already translated strings, in case you want to improve any of them. There are no translation teams, so you can just edit the strings (but try to be nice and consistent with the current translation). If you are a regular contributor to the translations, you might want to add some notes to the per-language section on this page to coordinate consistent translations.

Note: please don't translate the words "MediaGoblin" or "GNU" into your native language. Those words should be retained as-is for branding reasons. :)

Fixing or improving translations

If you click in the "Overview" tab, you will see the status of the translation of MediaGoblin to your language. If you click on "Expand details" you will find some statistics and the results of several quality checks (about capitalization, punctuation matching or not the original and the translation) which may help you to fix or improve the translation.

Notes for some language teams

German

Interessante Hinweise zur Übersetzung finden sich bei Gnome:

In Abweichung von diesen Richtlinien wird momentan "Du" für die Anrede benutzt. "Du" und "Deine" werden groß geschrieben. Benutze die folgenden Begriffe um konsistent zu bleiben:

Benutzerkonto/Nutzerkonto, E-Mail, E-Mail-Adresse, Aktivierungsmail, Konto "aktivieren" (verify email), Album (collection), Kurztitel (slug)

Spanish

Se está adoptando la siguiente convención para la traducción al español. Si crees que alguna traducción se puede mejorar, sugiérela en la página de discusión de este artículo.

Inglés Español Comentarios
you (segunda persona del singular, expresión informal)
media contenido
slug ficha

العربية

.سنتخذ الاصطلاحات التالية للترجمة العربية. إذا كنت تريد تحسين الترجمة يرجى اقتراح التغبرات في صفحة النقاش في هذا المقال

الانجليزية العربية
MediaGoblin . ميدياغوبلن
media . الميديا
slug . المسار

For developers

Marking strings for translation

In Jinja2

See: http://jinja.pocoo.org/docs/templates/#i18n

Mostly like Django template i18n support, if you have any experience with that.

In python code

Usually, like this:

from mediagoblin.util import pass_to_ugettext as _

def some_func(something):
    return _(u'This string would tooootally be translatable now.')

Except, in form modules we don't actually want to translate things because for various reasons that doesn't work, so we do the translation call template-side. So write the module to use the fake ugettext passthrough (which doesn't do any translation but still wraps things in _() so that Babel will know to extract these strings):

from mediagoblin.util import fake_ugettext_passthrough as _

class FunkyMonkeyForm(wtforms.Form):
    funky = wtforms.TextAreaField(
            _('Funkiness description'))

Extracting translations

If you run buildout it should create a script called 'pybabel'. Use it to extract translations like so:

./bin/pybabel extract -F babel.ini -o mediagoblin/i18n/templates/en/mediagoblin.po .

Compiling translations

./bin/pybabel compile -D mediagoblin -d mediagoblin/i18n/

Pulling translations from Transifex (Warning! Obsolete)

This section contains obsolete information. Now Mediagoblin lives on Pootle.
Before the section is updated, you can ask about the process using one of methods listed on
http://mediagoblin.org/pages/join.html

Unfortunately until the next release of transifex-client which has been patched to have proper entry points, you have to run transifex-client from a virtualenv or from site-packages. But assuming that's done, pulling translations is easy:

tx pull -a

Pushing new translations to Transifex (Warning! Obsolete)

This section contains obsolete information. Now Mediagoblin lives on Pootle.
Before the section is updated, you can ask about the process using one of methods listed on
http://mediagoblin.org/pages/join.html


tx push -s

Troubleshooting (Warning! Obsolete)

This section contains obsolete information. Now Mediagoblin lives on Pootle.
Before the section is updated, you can ask about the process using one of methods listed on
http://mediagoblin.org/pages/join.html


Got an error on Transifex like:

"Translation must start with a newline (\n)"?

The problem here is when we have something like:

       {% trans register_url=request.urlgen('mediagoblin.auth.register') %}
         <a class="header_submit_highlight" href="Template:Register url">Create a free account</a>
         or
         <a class="header_submit" href="http://wiki.mediagoblin.org/HackingHowto">Set up MediaGoblin on your own server</a>
       {% endtrans %}

instead of:

       {% trans register_url=request.urlgen('mediagoblin.auth.register') -%}
         <a class="header_submit_highlight" href="Template:Register url">Create a free account</a>
         or
         <a class="header_submit" href="http://wiki.mediagoblin.org/HackingHowto">Set up MediaGoblin on your own server</a>
       {%- endtrans %}

The distinction might not be obvious... look for the %} versus -%} and {% versus {%- on the first and last lines. The thing about this is this tells Jinja2 to strip the whitespace. Without that, Transifex sees that there's a "\n" on the first line of the original but not on the future translation, and gets upset.

If this happens the template should be updated to strip whitespace and translations should be pushed to transifex.