[wp-trac] [WordPress Trac] #10971: Translate functions when no locale are expensive no-ops

WordPress Trac wp-trac at lists.automattic.com
Wed Oct 21 05:50:50 UTC 2009


#10971: Translate functions when no locale are expensive no-ops
--------------------------+-------------------------------------------------
 Reporter:  johanee       |       Owner:  westi    
     Type:  defect (bug)  |      Status:  accepted 
 Priority:  normal        |   Milestone:  2.9      
Component:  Performance   |     Version:  2.9      
 Severity:  major         |    Keywords:  has-patch
--------------------------+-------------------------------------------------

Comment(by nbachiyski):

 I like westi's idea. A lot cleaner code, than repeating the logic in each
 function.

 I added the NOOP_Translation class to !GlotPress:
 http://trac.glotpress.org/changeset/291

 Keeping the instance if the empty translation class in the global object
 is both cleaner and faster. No static variables this way. Patch attached.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10971#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list