From GNU MediaGoblin Wiki
Revision as of 19:07, 6 December 2011 by Manolinux (Talk | contribs)

Jump to: navigation, search


For translators

You can translate our tools at Transifex:

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

We are currently using no translation teams, so you can just edit the strings (but try to be nice and consistent with the current translation).

Notes for some language teams


Interessante Hinweise zur Übersetzung finden sich bei Gnome:

In Abweichung von diesen Richtlinien wird momentan "du" für die Anrede benutzt.


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 de discusión de este artículo.

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

Fixing translations from transifex

Transifex only show you strings that currently have no translation.

If you want to fix an existing translation, you can download a .po file with the "Download for viewing" or "Download for tranlation" link, then edit the .po file with an appropiate tool (i.e. Poedit or emacs po-mode) and then upload the resulting file with the "Upload file" button.

For developers

Marking strings for translation

In Jinja2


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/en/LC_MESSAGES/mediagoblin.po .

Compiling translations

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

Pulling translations from Transifex

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

tx push -s


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>
         <a class="header_submit" href="">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>
         <a class="header_submit" href="">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.

Personal tools