You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bloodhound.apache.org by Olemis Lang <ol...@gmail.com> on 2014/01/09 02:18:07 UTC

Fwd: i18n code is fragile

I've pushed a few updates onto my patch queue to refresh previous
patches . I tried to improve the coverage of translations but I'm
stuck now due to the following issue .

Feedback will be appreciated .

---------- Forwarded message ----------
From: Olemis Lang <ol...@gmail.com>
Date: Wed, 8 Jan 2014 20:01:03 -0500
Subject: i18n code is fragile
To: trac-dev <tr...@googlegroups.com>

I'm reviewing and improving the translations of a plugin . I have to
say that the code is quite fragile . Briefly , this is what I have :

  - ${x} in a Genshi template
  - x = _('string1') in code
  - x = 'string2'

In all cases the i18n domain is the same . In some instances x is
already translated in code and displayed correctly ; other times it's
not translated hence English text is embedded .

However there's a chance for 'string2' to be available in the catalog
so I want to transform this into something like `${dgettext(d, x) if d
and dgettext else x}` and , by doing so, *all* translations associated
to the given domain vanish and only English texts are output but the
rest of the web site remains translated , as expected .

Has anybody experienced this before ? What can I do ? Any hints ?

-- 
Regards,

Olemis - @olemislc

Apacheā„¢ Bloodhound contributor
http://issues.apache.org/bloodhound
http://blood-hound.net

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article: