public/wordpress/wp-content/plugins/wp-courseware/includes/core/i18n.php
/**
	 * Load i18n Functionality.
	 *
	 * This loads the textdomain for the plugin
	 * that allows gettext translations.
	 *
	 * @since 4.3.0
	 */
Load i18n Functionality.
This loads the textdomain for the plugin
that allows gettext translations.


Load i18n Functionality . This loads the textdomain for the plugin that allows gettext translations .
public function load() {
		add_filter( 'load_textdomain_mofile', array( $this, 'load_legacy_textdomain' ), 10, 2 );
		$lang_dir = apply_filters( 'wpcw_languages_directory', WPCW_LANG_PATH );
		$locale = apply_filters( 'plugin_locale', get_locale(), 'wp-courseware' );
		$mofile = sprintf( '%1$s-%2$s.mo', 'wp-courseware', $locale );
		$mofile_global1 = WP_LANG_DIR . '/wp_courseware/wp-courseware-' . $locale . '.mo';
		$mofile_global2 = WP_LANG_DIR . '/wp_courseware/wp_courseware-' . $locale . '.mo';
		$mofile_global3 = WP_LANG_DIR . '/plugins/wp-courseware/' . $mofile;
		if ( file_exists( $mofile_global1 ) ) {
			load_textdomain( 'wp-courseware', $mofile_global1 );
		} elseif ( file_exists( $mofile_global2 ) ) {
			load_textdomain( 'wp-courseware', $mofile_global2 );
		} elseif ( file_exists( $mofile_global3 ) ) {
			load_textdomain( 'wp-courseware', $mofile_global3 );
		} else {
			load_plugin_textdomain( 'wp-courseware', false, $lang_dir );
		}
	}
public function load ( ) { add_filter ( 'load_textdomain_mofile' , array ( $ this , 'load_legacy_textdomain' ) , 10 , 2 ) ; $ lang_dir = apply_filters ( 'wpcw_languages_directory' , WPCW_LANG_PATH ) ; $ locale = apply_filters ( 'plugin_locale' , get_locale ( ) , 'wp-courseware' ) ; $ mofile = sprintf ( '%1$s-%2$s.mo' , 'wp-courseware' , $ locale ) ; $ mofile_global1 = WP_LANG_DIR . '/wp_courseware/wp-courseware-' . $ locale . '.mo' ; $ mofile_global2 = WP_LANG_DIR . '/wp_courseware/wp_courseware-' . $ locale . '.mo' ; $ mofile_global3 = WP_LANG_DIR . '/plugins/wp-courseware/' . $ mofile ; if ( file_exists ( $ mofile_global1 ) ) { load_textdomain ( 'wp-courseware' , $ mofile_global1 ) ; } elseif ( file_exists ( $ mofile_global2 ) ) { load_textdomain ( 'wp-courseware' , $ mofile_global2 ) ; } elseif ( file_exists ( $ mofile_global3 ) ) { load_textdomain ( 'wp-courseware' , $ mofile_global3 ) ; } else { load_plugin_textdomain ( 'wp-courseware' , false , $ lang_dir ) ; } }
Load i18n Functionality.
Load i18n Functionality .
// Load Legacy Textdomain. /**
		 * Filter WP Courseware Languages Directory Path.
		 *
		 * Allow developers to override the languages directory path.
		 *
		 * @since 4.3.0
		 *
		 * @param string The path to the languages folder.
		 */ /**
		 * Filter WP Courseware Locale.
		 *
		 * Allow developers to change the plugin locale.
		 *
		 * @since 4.3.0
		 *
		 * @param string The locale ID.
		 * @param string The plugin locale ID.
		 */ // Specify the .mo file // Look for wp-content/languages/wp_courseware/wp-courseware-{lang}_{country}.mo // Look for wp-content/languages/wp_courseware/wp_courseware-{lang}_{country}.mo // Look in wp-content/languages/plugins/wp-courseware-{lang}_{country}.mo // Check if one of the language file exists