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

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 8c5083ba20

View file

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