1
0
Fork 0
mirror of https://github.com/inretio/WordPress-Plugin-Boilerplate synced 2024-12-23 04:13:53 +02:00

A better way of loading language files

This commit is contained in:
Lee Willis 2013-01-30 20:11:12 +00:00
parent 7660b7601c
commit df80c7e5eb

View file

@ -103,7 +103,10 @@ class PluginName {
public function plugin_textdomain() { public function plugin_textdomain() {
// TODO: replace "plugin-name-locale" with a unique value for your plugin // TODO: replace "plugin-name-locale" with a unique value for your plugin
load_plugin_textdomain( 'plugin-name-locale', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' ); $domain = 'plugin-name-locale';
$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
load_textdomain( $domain, WP_LANG_DIR.'/'.$domain.'/'.$domain.'-'.$locale.'.mo' );
load_plugin_textdomain( $domain, FALSE, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
} // end plugin_textdomain } // end plugin_textdomain