[wp-trac] [WordPress Trac] #17266: Custom languages files support

WordPress Trac wp-trac at lists.automattic.com
Thu Apr 28 11:05:15 UTC 2011


#17266: Custom languages files support
-----------------------------+------------------------------
 Reporter:  DreadLox         |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  I18N             |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  2nd-opinion      |
-----------------------------+------------------------------

Comment (by anmari):

 This functionality could also be added as a simple plugin or function
 using the load_textdomain_mofile filter.

 WP code will call:

 {{{
 $mofile = apply_filters( 'load_textdomain_mofile', $mofile, $domain );
 }}}


 The filter could check for mofile in languages folder first, and if not
 there, then use normal path.

 I wrote something like that for my own plugin and wrote the general
 concept up here - I called it an 'accent' for your website.




 {{{

 $locale = get_locale();
 $mofile = WP_CONTENT_DIR.'/languages/'. $domain . '-' . $locale . '.mo';
 //teehee - allows local own  domain file
 if (!load_textdomain($domain,  $mofile)) {//allow first a custom lang
 location
         $result = load_plugin_textdomain($domain, false/* nlr */,
 $location);
 }
 }}}

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


More information about the wp-trac mailing list