Changes for upcoming version 1.3.0
- Bugfix: Changed tooltip class to be unique - Bugfix: Changed superscript styling to not manipulate the line height - Bugfix: Changed styling of the footnotes text in the reference container to avoid line breaks - Updated: Reformatted code - Added: new settings tab for custom CSS settings git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@957947 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
parent
0f3996338b
commit
3802249ec4
26 changed files with 2137 additions and 1651 deletions
|
@ -8,48 +8,48 @@
|
|||
* Since: 1.0
|
||||
*/
|
||||
|
||||
// action to locate language and load the WordPress-specific language file
|
||||
add_action('plugins_loaded', 'MCI_Footnotes_LoadLanguage');
|
||||
|
||||
/**
|
||||
* loads the langauge file including localization if exists
|
||||
* otherwise loads the langauge file without localization information
|
||||
* loads the language file including localization if exists
|
||||
* otherwise loads the language file without localization information
|
||||
* @since 1.0
|
||||
*/
|
||||
function footnotes_load_language()
|
||||
{
|
||||
/* read current wordpress langauge */
|
||||
function MCI_Footnotes_LoadLanguage() {
|
||||
// read current WordPress language
|
||||
$l_str_locale = apply_filters('plugin_locale', get_locale(), FOOTNOTES_PLUGIN_NAME);
|
||||
/* get only language code (removed localization code) */
|
||||
$l_str_languageCode = footnotes_getLanguageCode();
|
||||
// get only language code (removed localization code)
|
||||
$l_str_languageCode = MCI_Footnotes_getLanguageCode();
|
||||
|
||||
/* language file with localization exists */
|
||||
if ($l_bool_loaded = load_textdomain(FOOTNOTES_PLUGIN_NAME, FOOTNOTES_LANGUAGE_DIR . FOOTNOTES_PLUGIN_NAME . '-' . $l_str_locale . '.mo')) {
|
||||
|
||||
/* language file without localization exists */
|
||||
} else if ($l_bool_loaded = load_textdomain(FOOTNOTES_PLUGIN_NAME, FOOTNOTES_LANGUAGE_DIR . FOOTNOTES_PLUGIN_NAME . '-' . $l_str_languageCode . '.mo')) {
|
||||
|
||||
/* load default language file, nothing will happen: default language will be used (=english) */
|
||||
} else {
|
||||
load_textdomain(FOOTNOTES_PLUGIN_NAME, FOOTNOTES_LANGUAGE_DIR . FOOTNOTES_PLUGIN_NAME . '-en.mo');
|
||||
}
|
||||
// language file with localization exists
|
||||
$l_bool_loaded = load_textdomain(FOOTNOTES_PLUGIN_NAME, FOOTNOTES_LANGUAGE_DIR . FOOTNOTES_PLUGIN_NAME . '-' . $l_str_locale . '.mo');
|
||||
if (empty($l_bool_loaded)) {
|
||||
// language file without localization exists
|
||||
$l_bool_loaded = load_textdomain(FOOTNOTES_PLUGIN_NAME, FOOTNOTES_LANGUAGE_DIR . FOOTNOTES_PLUGIN_NAME . '-' . $l_str_languageCode . '.mo');
|
||||
if (empty($l_bool_loaded)) {
|
||||
// fallback to english
|
||||
load_textdomain(FOOTNOTES_PLUGIN_NAME, FOOTNOTES_LANGUAGE_DIR . FOOTNOTES_PLUGIN_NAME . '-en.mo');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* reads the wordpress langauge and returns only the language code lowercase
|
||||
* reads the WordPress language and returns only the language code lowercase
|
||||
* removes the localization code
|
||||
* @since 1.0
|
||||
* @return string (only the "en" from "en_US")
|
||||
*/
|
||||
function footnotes_getLanguageCode()
|
||||
{
|
||||
/* read current wordpress langauge */
|
||||
function MCI_Footnotes_getLanguageCode() {
|
||||
// read current WordPress language
|
||||
$l_str_locale = apply_filters('plugin_locale', get_locale(), FOOTNOTES_PLUGIN_NAME);
|
||||
/* check if wordpress language has a localization (e.g. "en_US" or "de_AT") */
|
||||
// check if WordPress language has a localization (e.g. "en_US" or "de_AT")
|
||||
if (strpos($l_str_locale, "_") !== false) {
|
||||
/* remove localization code */
|
||||
// remove localization code
|
||||
$l_arr_languageCode = explode("_", $l_str_locale);
|
||||
$l_str_languageCode = $l_arr_languageCode[0];
|
||||
return $l_str_languageCode;
|
||||
}
|
||||
/* return language code lowercase */
|
||||
// return language code lowercase
|
||||
return strtolower($l_str_locale);
|
||||
}
|
Reference in a new issue