@ -599,7 +599,7 @@ class rcube
*
*
* @return string Localized text
* @return string Localized text
*/
*/
public function gettext($attrib, $domain=null)
public function gettext($attrib, $domain = null)
{
{
// load localization files if not done yet
// load localization files if not done yet
if (empty($this->texts)) {
if (empty($this->texts)) {
@ -633,18 +633,25 @@ class rcube
}
}
}
}
// format output
// replace \n with real line break
if (($attrib['uppercase'] & & strtolower($attrib['uppercase'] == 'first')) || $attrib['ucfirst']) {
$text = strtr($text, array('\n' => "\n"));
return ucfirst($text);
// case folding
if (($attrib['uppercase'] & & strtolower($attrib['uppercase']) == 'first') || $attrib['ucfirst']) {
$case_mode = MB_CASE_TITLE;
}
}
else if ($attrib['uppercase']) {
else if ($attrib['uppercase']) {
return mb_strtoupper($text);
$case_mode = MB_CASE_UPPER ;
}
}
else if ($attrib['lowercase']) {
else if ($attrib['lowercase']) {
return mb_strtolower($text);
$case_mode = MB_CASE_LOWER;
}
if (isset($case_mode)) {
$text = mb_convert_case($text, $case_mode);
}
}
return strtr($text, array('\n' => "\n"));
return $text;
}
}
/**
/**