[Sugar-devel] [PATCH sugar] Convert nick to a str, follow up on OLPC #10735

Sascha Silbe sascha-ml-reply-to-2011-2 at silbe.org
Sat May 28 13:52:31 EDT 2011


Excerpts from Simon Schampijer's message of Wed May 25 17:41:13 +0200 2011:

[src/jarabe/frame/activitiestray.py]
> @@ -545,7 +545,7 @@ class IncomingTransferPalette(BaseTransferPalette):
>  
>          self.file_transfer.connect('notify::state', self.__notify_state_cb)
>  
> -        nick = self.file_transfer.buddy.props.nick
> +        nick = str(self.file_transfer.buddy.props.nick)
>          self.props.secondary_text = _('Transfer from %s') % (nick,)

If we'd care about non-UTF-8 locales, this should read something like:

        nick = unicode(self.file_transfer.buddy.props.nick, 'utf-8')
        text = _('Transfer from %s') % (nick, )
        self.props.secondary_text = text.encode('utf-8')

with gettext.ugettext as _.


However there's a lot more that will break in Sugar for non-UTF-8
locales, so for now:

Acked-By: Sascha Silbe <silbe at activitycentral.com>

Sascha

-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 494 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110528/b1e97c22/attachment.pgp>


More information about the Sugar-devel mailing list