[wp-trac] Re: [WordPress Trac] #9686: Please : load_theme_textdomain function be hookable

WordPress Trac wp-trac at lists.automattic.com
Thu Apr 30 14:27:55 GMT 2009


#9686: Please : load_theme_textdomain function be hookable
-------------------------------------------------------+--------------------
 Reporter:  michelwppi                                 |        Owner:  nbachiyski    
     Type:  enhancement                                |       Status:  reopened      
 Priority:  normal                                     |    Milestone:  Future Release
Component:  i18n                                       |      Version:  2.8           
 Severity:  normal                                     |   Resolution:                
 Keywords:  has-patch needs-testing reporter-feedback  |  
-------------------------------------------------------+--------------------
Changes (by michelwppi):

 * cc: michelwppi (added)


Comment:

 Thanks for your observations.[[BR]]

 1) for hakre :[[BR]]
 the timing when choosen .mo file (currently in theme's folder as by
 instance fusion a theme with localization) is downloaded (fired by
 load_theme_textdomain function in functions.php of current theme) is the
 same in WP 2.7.1 and WP 2.8[[BR]]
 2) for Denis :[[BR]]
 because get_locale is called inside load_theme_textdomain it is too soon
 for dynamic multilingual site as managed by xili-language example here
 [http://dev.xiligroup.com] or elsewhere.[[BR]]
 [[BR]]

 If we want that people don't have to change the line
 ''load_theme_textdomain in functions.php'' of the choosen theme built by
 others authors, I suggest this short modification like this (around line
 361 in WP 2.8 :[[BR]]



 {{{
  * @param string $domain Unique identifier for retrieving translated
 strings
  */
 function load_theme_textdomain($domain, $path = false) {
     if (has_filter('load_theme_textdomain')) {
 do_action('load_theme_textdomain',$domain,$path);
 } else {
         $locale = get_locale();

 .....

 }

 }}}

 [[BR]]

 Hope it is understandable !

 Michel

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


More information about the wp-trac mailing list