Skip to:
Content

Changeset 3344


Ignore:
Timestamp:
11/03/2010 10:34:39 PM (8 years ago)
Author:
mrmaz
Message:

check global languages directory first

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r3343 r3344  
    19211921function bp_core_load_buddypress_textdomain() {
    19221922    $locale = apply_filters( 'buddypress_locale', get_locale() );
    1923     $mofile = BP_PLUGIN_DIR . "/bp-languages/buddypress-$locale.mo";
    1924 
    1925     if ( file_exists( $mofile ) )
    1926         load_textdomain( 'buddypress', $mofile );
     1923    $mofile = sprintf('buddypress-%s.mo', $locale);
     1924    $mofile_global = WP_LANG_DIR . '/' . $mofile;
     1925    $mofile_local = BP_PLUGIN_DIR . '/bp-languages/' . $mofile;
     1926
     1927    if ( file_exists( $mofile_global ) )
     1928        return load_textdomain( 'buddypress', $mofile_global );
     1929    elseif ( file_exists( $mofile_local ) )
     1930        return load_textdomain( 'buddypress', $mofile_local );
     1931    else
     1932        return false;
    19271933}
    19281934add_action ( 'bp_loaded', 'bp_core_load_buddypress_textdomain', 2 );
Note: See TracChangeset for help on using the changeset viewer.