= 4.7 ) { $get_locale = get_user_locale(); } /** * Language Locale for plugin * * @var $get_locale The locale to use. * Uses get_user_locale()` in WordPress 4.7 or greater, * otherwise uses `get_locale()`. */ $locale = apply_filters( 'plugin_locale', $get_locale, 'bsf-utm-analytics' ); $mofile = sprintf( '%1$s-%2$s.mo', 'bsf-utm-analytics', $locale ); // Setup paths to current locale file. $mofile_global = WP_LANG_DIR . '/plugins/' . $mofile; $mofile_local = $lang_dir . $mofile; if ( file_exists( $mofile_global ) ) { // Look in global /wp-content/languages/bsf-utm-analytics/ folder. load_textdomain( 'bsf-utm-analytics', $mofile_global ); } elseif ( file_exists( $mofile_local ) ) { // Look in local /wp-content/plugins/bsf-utm-analytics/languages/ folder. load_textdomain( 'bsf-utm-analytics', $mofile_local ); } else { // Load the default language files. load_plugin_textdomain( 'bsf-utm-analytics', false, $lang_dir ); } } } /** * Kicking this off by calling 'get_instance()' method */ Plugin_Loader::get_instance();