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

Merge pull request #21 from leewillis77/master

A better way of loading language files
This commit is contained in:
Tom McFarlin 2013-01-31 05:09:00 -08:00
commit 4f1cd0cbbf

View file

@ -103,8 +103,11 @@ class PluginName {
public function plugin_textdomain() {
// 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
/**