[Bugs] #2354 UNSP: Activities list view and Journal view crashes in Arabic

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Tue Sep 21 10:58:40 EDT 2010


#2354: Activities list view and Journal view crashes in Arabic
------------------------------------------+---------------------------------
    Reporter:  erikos                     |          Owner:  erikos                     
        Type:  defect                     |         Status:  new                        
    Priority:  Unspecified by Maintainer  |      Milestone:  Unspecified by Release Team
   Component:  sugar-toolkit              |        Version:  0.90.x                     
    Severity:  Unspecified                |       Keywords:                             
Distribution:  Unspecified                |   Status_field:  Unconfirmed                
------------------------------------------+---------------------------------

Comment(by erikos):

 *That* one works actually :)

 {{{
 diff --git a/src/sugar/util.py b/src/sugar/util.py
 index b947c0a..a061378 100644
 --- a/src/sugar/util.py
 +++ b/src/sugar/util.py
 @@ -271,10 +271,15 @@ def timestamp_to_elapsed_string(timestamp,
 max_levels=2):
              if key in _i18n_timestamps_cache:
                  time_period += _i18n_timestamps_cache[key]
              else:
 -                translation = gettext.dngettext('sugar-toolkit',
 -                                                name_singular,
 -                                                name_plural,
 -                                                elapsed_units) %
 elapsed_units
 +                tmp = gettext.dngettext('sugar-toolkit',
 +                                        name_singular,
 +                                        name_plural,
 +                                        elapsed_units)
 +                try:
 +                    translation = tmp % elapsed_units
 +                except TypeError:
 +                    translation = tmp
 +
                  _i18n_timestamps_cache[key] = translation
                  time_period += translation
 }}}

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/2354#comment:3>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list