[Sugar-devel] [PATCH sugar] Convert nick to a str, follow up on OLPC #10735
Simon Schampijer
simon at schampijer.de
Tue May 31 10:18:01 EDT 2011
On 05/28/2011 07:52 PM, Sascha Silbe wrote:
> 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:
Yes, better to do this in a coherent manner.
> Acked-By: Sascha Silbe<silbe at activitycentral.com>
>
> Sascha
>
Pushed as:
http://git.sugarlabs.org/sugar/mainline/commit/5cfb315d89eaa2fb21372f4fb545315bb28fb1e0
http://git.sugarlabs.org/sugar/mainline/commit/dc782bda31b590f89bd097d50dd8e6feb5575adc
Thanks for the review,
Simon
More information about the Sugar-devel
mailing list