[Sugar-devel] Unicode strings in translations

Gonzalo Odiard gonzalo at laptop.org
Tue Aug 14 22:32:45 EDT 2012


>
> - Strings with format
> Example:
> button.set_tooltip(_('Append %s') % _('something'))
>
>
The problem with this example is when you have language like Spanish,
where some of the characters can be encoded in ascii, but not all.
In this case, gettext will return a str or a PyUnicode depending of the
case,
and if are not compatibles, the format will break.

The worst part, the developer can't know it, depends on the translation.

Gonzalo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20120814/a555adb3/attachment-0001.html>


More information about the Sugar-devel mailing list