updating the localization functions to that `load_textdomain` is called.

Removing `load_plugin_textdomain` and leaving only `load_textdomain`.

This is standard as per new WordPress practices[0].

Ultimately, it makes language files more portable as they are still accessible via WordPress even if the plugin developer did not include them with the plugin itself.

Related #120

[0] d2eb67079b (commitcomment-4644357)

Signed-off-by: Tom McFarlin <tom@tommcfarlin.com>
This commit is contained in:
Tom McFarlin 2013-11-19 17:20:26 -05:00
parent d2eb67079b
commit ce5d816a4d
1 changed files with 2 additions and 3 deletions

View File

@ -134,7 +134,6 @@ class Plugin_Name {
switch_to_blog( $blog_id );
self::single_activate();
}
restore_current_blog();
@ -257,8 +256,8 @@ class Plugin_Name {
$domain = $this->plugin_slug;
$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
load_textdomain( $domain, $domain . '/languages/' . $domain . '-' . $locale . '.mo' );
load_plugin_textdomain( $domain, FALSE, basename( plugin_dir_path( dirname( __FILE__ ) ) ) . '/languages/' );
load_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain . '/' . $domain . '-' . $locale . '.mo' );
load_plugin_textdomain( $domain, FALSE, basename( plugin_dir_path( dirname( __FILE__ ) ) ) . 'languages/' );
}