[Sugar-devel] [PATCH Browse] Use named parameters to enable translation in msg with multiple strings

Manuel Quiñones manuq at laptop.org
Thu Mar 22 08:08:48 EDT 2012


El día 22 de marzo de 2012 07:35, Gonzalo Odiard <gonzalo at laptop.org> escribió:
> Maybe was not pushed in master.
> Manuq, can you confirm?

This was unintentionally reverted in ca4ae1c7374304c872a4f38f670aa590e45150ff

My patch from 3 days ago, should fix it.  The subject was: [PATCH]
Change string formatting in downloadmanager to use named arguments

>
> Gonzalo
>
>
> On Thu, Mar 22, 2012 at 2:46 AM, Chris Leonard <cjlhomeaddress at gmail.com>
> wrote:
>>
>> For some reason, I am still seeing an error in Browse POT generation
>>
>>  ####### Checking POT for browse (master) ######
>>
>>
>>
>> Already up-to-date.
>> downloadmanager.py:202: warning: 'msgid' format string with unnamed
>> arguments cannot be properly localized:
>>                                The translator cannot reorder the
>> arguments.
>>                                Please consider using a format string
>> with named arguments,
>>                                and a mapping instead of a tuple for
>> the arguments.
>>
>>
>> Is this a reversion of the earlier patch or something new?
>>
>> cjl
>>
>>
>>
>> On Thu, Oct 6, 2011 at 1:29 PM, Rafael Ortiz <rafael at activitycentral.com>
>> wrote:
>> > On Fri, Sep 30, 2011 at 8:51 AM, <godiard at sugarlabs.org> wrote:
>> >>
>> >> From: Gonzalo Odiard <godiard at gmail.com>
>> >>
>> >> Signed-off-by: Gonzalo Odiard <gonzalo at laptop.org>
>> >> ---
>> >>  downloadmanager.py |    5 +++--
>> >>  1 files changed, 3 insertions(+), 2 deletions(-)
>> >>
>> >> diff --git a/downloadmanager.py b/downloadmanager.py
>> >> index 0fd6537..98d4f1a 100644
>> >> --- a/downloadmanager.py
>> >> +++ b/downloadmanager.py
>> >> @@ -341,8 +341,9 @@ class Download:
>> >>
>> >>     def _create_journal_object(self):
>> >>         self.dl_jobject = datastore.create()
>> >> -        self.dl_jobject.metadata['title'] = _('Downloading %s from
>> >> \n%s.') % \
>> >> -                (self._get_file_name(), self._source.spec)
>> >> +        self.dl_jobject.metadata['title'] = \
>> >> +                _('Downloading %(file)s from \n%(source)s.') % \
>> >> +                {'file': self._get_file_name(), 'source':
>> >> self._source.spec}
>> >>
>> >>         self.dl_jobject.metadata['progress'] = '0'
>> >>         self.dl_jobject.metadata['keep'] = '0'
>> >> --
>> >> 1.7.4.4
>> >>
>> >
>> > Acked, tested and pushed as:
>> >
>> >
>> > http://git.sugarlabs.org/browse/mainline/commit/0984c0a342487c54381c71bb6a77b1b5656bff59
>> >
>> >
>> >> _______________________________________________
>> >> Sugar-devel mailing list
>> >> Sugar-devel at lists.sugarlabs.org
>> >> http://lists.sugarlabs.org/listinfo/sugar-devel
>> >
>> >
>> >
>> > _______________________________________________
>> > Sugar-devel mailing list
>> > Sugar-devel at lists.sugarlabs.org
>> > http://lists.sugarlabs.org/listinfo/sugar-devel
>> >
>
>



-- 
.. manuq ..


More information about the Sugar-devel mailing list