public load_plugin_textdomain ( ) : boolean | ||
리턴 | boolean | True if the language file was loaded, false otherwise |
public function load_plugin_textdomain()
{
$lang_dir = WPAS_ROOT . 'languages/';
$lang_path = WPAS_PATH . 'languages/';
$locale = apply_filters('plugin_locale', get_locale(), 'awesome-support');
$mofile = "awesome-support-{$locale}.mo";
$glotpress_file = WP_LANG_DIR . '/plugins/awesome-support/' . $mofile;
// Look for the GlotPress language pack first of all
if (file_exists($glotpress_file)) {
$language = load_textdomain('awesome-support', $glotpress_file);
} elseif (file_exists($lang_path . $mofile)) {
$language = load_textdomain('awesome-support', $lang_path . $mofile);
} else {
$language = load_plugin_textdomain('awesome-support', false, $lang_dir);
}
return $language;
}