Skip to content

Commit

Permalink
try loading text domain several ways
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsternberg committed Nov 25, 2014
1 parent 86fc495 commit 56992d5
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions init.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,19 @@ public function include_cmb() {
* @since 2.0.0
*/
public function l10ni18n() {
$locale = apply_filters( 'plugin_locale', get_locale(), 'cmb2' );
$mofile = dirname( __FILE__ ) . '/languages/cmb2-'. $locale .'.mo';
load_textdomain( 'cmb2', $mofile );
$loaded = load_plugin_textdomain( 'cmb2', false, '/languages/' );
if ( ! $loaded ) {
$loaded = load_muplugin_textdomain( 'cmb2', '/languages/' );
}
if ( ! $loaded ) {
$loaded = load_theme_textdomain( 'cmb2', '/languages/' );
}

if ( ! $loaded ) {
$locale = apply_filters( 'plugin_locale', get_locale(), 'cmb2' );
$mofile = dirname( __FILE__ ) . '/languages/cmb2-'. $locale .'.mo';
load_textdomain( 'cmb2', $mofile );
}
}

}
Expand Down

0 comments on commit 56992d5

Please sign in to comment.