From 62cbe9b8301159a20c0862cd2efa393f15a4b04f Mon Sep 17 00:00:00 2001 From: GaryJones Date: Fri, 1 Nov 2013 10:31:34 +0000 Subject: [PATCH] Improved load text domain. Includes the required textdomain within the .mo file name. Wraps WP_LANG_DIR in trailingslashit() to ensure two slashes aren't used. Grabs the path to the languages folder to it better works with symlinks. --- gistpress.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gistpress.php b/gistpress.php index 74d0875..622b63d 100644 --- a/gistpress.php +++ b/gistpress.php @@ -45,8 +45,8 @@ function gistpress_i18n() { $domain = 'gistpress'; $locale = apply_filters( 'plugin_locale', get_locale(), $domain ); - load_textdomain( $domain, WP_LANG_DIR . '/gistpress/' . $locale . '.mo' ); - load_plugin_textdomain( $domain, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); + load_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain . '/' . $domain . '-' . $locale . '.mo' ); + load_plugin_textdomain( $domain, FALSE, basename( dirname( __FILE__ ) ) . '/languages' ); } add_action( 'init', 'gistpress_i18n' );