Browse Source

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>
develop
Tom McFarlin 9 years ago
parent
commit
8c5083ba20
  1. 5
      plugin-name/public/class-plugin-name.php

5
plugin-name/public/class-plugin-name.php

@ -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/' );
}

Loading…
Cancel
Save