diff --git a/plugins/Multilanguage/helpers/functions.php b/plugins/Multilanguage/helpers/functions.php index 3b739a5..bdedfc3 100644 --- a/plugins/Multilanguage/helpers/functions.php +++ b/plugins/Multilanguage/helpers/functions.php @@ -13,21 +13,33 @@ function locale_human($locale) if (isset($parts[1])) { $langCode = $parts[0]; $regionCode = $parts[1]; - // HACK - use the locale for the language - $language = Zend_Locale::getTranslation($langCode, 'language', $locale); + $language = Zend_Locale::getTranslation($langCode, 'language'); $region = Zend_Locale::getTranslation($regionCode, 'territory'); } else { $region = ''; - // HACK - use the locale for the language - $language = Zend_Locale::getTranslation($locale, 'language', $locale); + $language = Zend_Locale::getTranslation($locale, 'language'); } if ($region != '') { $region = " - $region"; } // HACK - just return the language + // return ucfirst($language); + return ucfirst($language) . $region; +} + +/** + * Convert a standard locale string (en_US) into the language and region. + * + * @param string $locale + * @return string + */ +function locale_human_ui($locale) +{ + $parts = explode('_', $locale); + $langCode = $parts[0]; + $language = Zend_Locale::getTranslation($langCode, 'language', $locale); return ucfirst($language); - // return ucfirst($language) . $region; } /** diff --git a/plugins/Multilanguage/views/shared/common/locale-switcher.php b/plugins/Multilanguage/views/shared/common/locale-switcher.php index 4130180..26b0d9c 100644 --- a/plugins/Multilanguage/views/shared/common/locale-switcher.php +++ b/plugins/Multilanguage/views/shared/common/locale-switcher.php @@ -35,11 +35,11 @@ localeToCountry($locale); ?>