Created
December 16, 2013 16:31
-
-
Save spacedmonkey/7989920 to your computer and use it in GitHub Desktop.
Not load plugin text domain unless file found
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Load the plugin text domain for translation. | |
* | |
* @since 2.0 | |
*/ | |
public function load_plugin_textdomain() { | |
$domain = $this->plugin_slug; | |
$locale = apply_filters( 'plugin_locale', get_locale(), $domain ); | |
$file = trailingslashit( WP_LANG_DIR ) . $domain . '/' . $domain . '-' . $locale . '.mo'; | |
if ( file_exists( $file )){ | |
load_textdomain( $domain, $file ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment