[Sugar-devel] [PATCH sugar-toolkit-gtk3] Use class-based API for gettext translations

Daniel Drake dsd at laptop.org
Tue Aug 14 17:55:38 EDT 2012


On Tue, Aug 14, 2012 at 1:15 PM, Manuel Kaufmann <humitos at gmail.com> wrote:
> Broadly speaking, the issue is related with "merging Unicode string
> with 8bits ones" and this convey many problems that are difficult to
> find out and solve. In Python, is highly recommended to use Unicode
> throughout the source code

Personally, I'd say that recommending universal use of unicode in
Python 2 is questionable.

> With this patch there is no need to change the source code of all the
> activities, they should work as they are. But, we can omit the import
> of gettext as _ because this patch installs it as a builtin
> function[1]:
>
> from gettext import gettext as _

So _ will suddenly change from returning a string to a unicode for all
activities? That is likely to break several things, for the same
reasons that we recently saw in another thread: why doesn't pygi
return unicode strings for GtkEntry.get_text() and so on?

The unicode mess is sorted in Python 3; it may be better to invest
effort in moving that direction instead. (after a quick glance at the
thread you linked to, I'm not sure what the actual problem is).

Daniel


More information about the Sugar-devel mailing list