Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed custom .mo file checks for the localization #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,14 @@ function bp_follow_init() {

/**
* Custom textdomain loader.
*
* Checks WP_LANG_DIR for the .mo file first, then WP_LANG_DIR/plugins/, then
* the plugin's language folder.
*
* Allows for a custom language file other than those packaged with the plugin.
* Checks `WP_LANG_DIR/plugins/` for the .mo file first, then fallbacks to plugin's language folder.
*
* @since 1.1.0
*
* @since 1.3.0 removed custom .mo file checks
* @return bool True if textdomain loaded; false if not.
*/
function bp_follow_localization() {
$domain = 'buddypress-followers';
$mofile_custom = trailingslashit( WP_LANG_DIR ) . sprintf( '%s-%s.mo', $domain, get_locale() );

if ( is_readable( $mofile_custom ) ) {
return load_textdomain( $domain, $mofile_custom );
} else {
return load_plugin_textdomain( $domain, false, basename( BP_FOLLOW_DIR ) . '/languages/' );
}
return load_plugin_textdomain( 'buddypress-followers', false, basename( BP_FOLLOW_DIR ) . '/languages/' );
}

add_action( 'plugins_loaded', 'bp_follow_localization' );