[wp-trac] [WordPress Trac] #12905: the_title_attribute() is hard to internationalize

WordPress Trac wp-trac at lists.automattic.com
Mon Apr 19 12:47:41 UTC 2010


#12905: the_title_attribute() is hard to internationalize
--------------------------+-------------------------------------------------
 Reporter:  mdawaffe      |       Owner:  nbachiyski    
     Type:  defect (bug)  |      Status:  new           
 Priority:  normal        |   Milestone:  Future Release
Component:  i18n          |     Version:  3.0           
 Severity:  normal        |    Keywords:                
--------------------------+-------------------------------------------------

Comment(by nbachiyski):

 We should try an move all before/after arguments to similar template
 approach. It improves code readability a lot. Compare {{{'before' =>
 '<li>', 'after' => '</li>'}}} with {{{'<li>%s</li>'}}}.

 That's why the name formatted seems a little niche. I propose to call the
 argument just {{{text}}}. Its default value will be {{{%s}}}. This way we
 can skip the {{{%}}} checks and just say {{{sprintf( $text, $title );}}}.
 If text doesn't contain any %s sprintf won't complain, just the title
 won't appear anywhere in the result. I am perfectly ok with that.

 We can differentiate if {{{$args}}} is argument string or text template by
 checking if it starts by {{{arg=}}} where {{{arg}}} is one of the valid
 arguments (we have them all in {{{$default}}}).

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


More information about the wp-trac mailing list