Skip to:
Content

bbPress.org

Changeset 4934


Ignore:
Timestamp:
05/20/2013 08:35:02 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Allow partial global/local .mo file loading in bbPress::load_textdomain(). Props strangerstudios.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bbpress.php

    r4930 r4934  
    437437     * @since bbPress (r2596)
    438438     *
    439      * @uses apply_filters() Calls 'bbpress_locale' with the
    440      *                        {@link get_locale()} value
     439     * @uses apply_filters() Calls 'plugin_locale' with {@link get_locale()} value
    441440     * @uses load_textdomain() To load the textdomain
    442      * @return bool True on success, false on failure
    443441     */
    444442    public function load_textdomain() {
    445443
    446444        // Traditional WordPress plugin locale filter
    447         $locale        = apply_filters( 'plugin_locale',  get_locale(), $this->domain );
     445        $locale        = apply_filters( 'plugin_locale', get_locale(), $this->domain );
    448446        $mofile        = sprintf( '%1$s-%2$s.mo', $this->domain, $locale );
    449447
     
    453451
    454452        // Look in global /wp-content/languages/bbpress folder
    455         if ( file_exists( $mofile_global ) ) {
    456             return load_textdomain( $this->domain, $mofile_global );
     453        load_textdomain( $this->domain, $mofile_global );
    457454
    458455        // Look in local /wp-content/plugins/bbpress/bbp-languages/ folder
    459         } elseif ( file_exists( $mofile_local ) ) {
    460             return load_textdomain( $this->domain, $mofile_local );
    461         }
    462 
    463         // Nothing found
    464         return false;
     456        load_textdomain( $this->domain, $mofile_local );
    465457    }
    466458
Note: See TracChangeset for help on using the changeset viewer.