- Add: List with Features
- Add: Hyperlink to manfisher.eu in the "other plugins" page - Bugfix: Load text domain - Bugfix: Display the Footnotes button in the plain text editor of posts/pages git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@997524 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
parent
5a6cf06525
commit
14cda8a316
7 changed files with 70 additions and 17 deletions
|
@ -30,19 +30,29 @@ class MCI_Footnotes_Language {
|
|||
* @since 1.5.0
|
||||
*/
|
||||
public static function loadTextDomain() {
|
||||
$l_str_LanguagePath = dirname(__FILE__) . "/../languages/" . MCI_Footnotes_Config::C_STR_PLUGIN_NAME - "-";
|
||||
// language file with localization exists
|
||||
$l_bool_DomainLoaded = load_textdomain(MCI_Footnotes_Config::C_STR_PLUGIN_NAME, $l_str_LanguagePath . apply_filters('plugin_locale', get_locale(), MCI_Footnotes_Config::C_STR_PLUGIN_NAME) . '.mo');
|
||||
if (!empty($l_bool_DomainLoaded)) {
|
||||
if (self::load(apply_filters('plugin_locale', get_locale()))) {
|
||||
return;
|
||||
}
|
||||
// language file without localization exists
|
||||
$l_bool_DomainLoaded = load_textdomain(MCI_Footnotes_Config::C_STR_PLUGIN_NAME, $l_str_LanguagePath . self::getLanguageCode() . '.mo');
|
||||
if (!empty($l_bool_DomainLoaded)) {
|
||||
if (self::load(self::getLanguageCode())) {
|
||||
return;
|
||||
}
|
||||
// fallback to english
|
||||
load_textdomain(MCI_Footnotes_Config::C_STR_PLUGIN_NAME, $l_str_LanguagePath . '-en.mo');
|
||||
self::load("en");
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a specific text domain.
|
||||
*
|
||||
* @author Stefan Herndler
|
||||
* @since 1.5.1
|
||||
* @param string $p_str_LanguageCode Language Code to load a specific text domain.
|
||||
* @return bool
|
||||
*/
|
||||
private static function load($p_str_LanguageCode) {
|
||||
return load_textdomain(MCI_Footnotes_Config::C_STR_PLUGIN_NAME,
|
||||
dirname(__FILE__) . "/../languages/" . MCI_Footnotes_Config::C_STR_PLUGIN_NAME . "-" . $p_str_LanguageCode . '.mo');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,7 +64,7 @@ class MCI_Footnotes_Language {
|
|||
*/
|
||||
private static function getLanguageCode() {
|
||||
// read current WordPress language
|
||||
$l_str_locale = apply_filters('plugin_locale', get_locale(), MCI_Footnotes_Config::C_STR_PLUGIN_NAME);
|
||||
$l_str_locale = apply_filters('plugin_locale', get_locale());
|
||||
// check if WordPress language has a localization (e.g. "en_US" or "de_AT")
|
||||
if (strpos($l_str_locale, "_") !== false) {
|
||||
// remove localization code
|
||||
|
|
Reference in a new issue