#7959 NORM 8.2.0 (: gettext translations slows journal's scrolling

Zarro Boogs per Child bugtracker at laptop.org
Tue Aug 19 10:29:12 EDT 2008


#7959: gettext translations slows journal's scrolling
---------------------------+------------------------------------------------
   Reporter:  riccardo     |       Owner:  marco               
       Type:  enhancement  |      Status:  new                 
   Priority:  normal       |   Milestone:  8.2.0 (was Update.2)
  Component:  sugar        |     Version:  not specified       
 Resolution:               |    Keywords:  performance, r?     
Next_action:  review       |    Verified:  0                   
  Blockedby:               |    Blocking:                      
---------------------------+------------------------------------------------

Comment(by tomeu):

 Replying to [comment:7 riccardo]:
 > patch v3 to util.py uses "if key in cache: ... else: ...". I still
 prefer v2 as we search the key only once.

 I would trade readability for performance only when it can be justified
 with numbers.

 > v3 still uses os.environ['LANG'] as I couldn't find any user of
 setlocale(..) in sugar

 Why does it matter if Sugar is already using setlocale or not?

 > and, gettext.py also uses environment variables to build the list of
 languages in its gettext.find(..) method.

 Ok, then it's LANG as you said.

 > I tested the patch in english, french and arabic and it seemed to work
 ok.
 >
 > About using an LRU:
 > How to find an heuristic to set the queue size ?

 In one screen, we can show up to 20 different strings. If we limit the
 cache at 60 or 80, we won't be using much memory but will cover a quite
 long distance. Sounds good?

-- 
Ticket URL: <http://dev.laptop.org/ticket/7959#comment:8>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system


More information about the Bugs mailing list