[wp-trac] [WordPress Trac] #11012: Filter load_textdomain to control mofiles loaded

WordPress Trac wp-trac at lists.automattic.com
Wed Nov 18 09:45:13 UTC 2009


#11012: Filter load_textdomain to control mofiles loaded
-------------------------+--------------------------------------------------
 Reporter:  johanee      |       Owner:  westi    
     Type:  enhancement  |      Status:  reviewing
 Priority:  normal       |   Milestone:  2.9      
Component:  i18n         |     Version:  2.9      
 Severity:  normal       |    Keywords:  has-patch
-------------------------+--------------------------------------------------

Comment(by nbachiyski):

 Replying to [comment:4 westi]:
 >
 > Now we can't have a plugin with a textdomain of "already-loaded" which
 although a bizarre name would be a bizarre bug!
 >

 We can. The value of {{{$plugin_override}}} isn't used for anything,
 except to determine whether to go on.

 > How about this?
 >
 >         {{{ $plugin_override = apply_filters(
 'override_load_textdomain', false, $domain, $mofile ); }}}

 I didn't want to name the filter {{{override_load_textdomain}}}, because
 sometimes we want to use it to just execute our own code there and it
 doesn't have to do anything with overriding. For example, if I want to re-
 generate MO files each time a domain is loaded or if I want to log each
 load_textdomain call, it is bizarre to use a hook, which has override in
 its name.

 Of course, we can have both. The filter you proposed and an action called
 {{{load_textdomain}}}. I don't have a preference.

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


More information about the wp-trac mailing list