From d8eb62232e2b3003925c87b316b66ed6b39ff100 Mon Sep 17 00:00:00 2001 From: scambra Date: Wed, 26 Sep 2012 07:10:54 +0200 Subject: don't duplicate locales with country code --- lib/l10n.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/l10n.php b/lib/l10n.php index 7df01ced72f..26611537175 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -216,8 +216,9 @@ class OC_L10N{ case 'time': if($data instanceof DateTime) return $data->format($this->localizations[$type]); elseif(is_string($data)) $data = strtotime($data); - $language = self::findLanguage(); - setlocale(LC_TIME, array($language, $language.'_'.strtoupper($language))); + $locales = array(self::findLanguage()); + if (strlen($locales[0]) == 2) $locales[] = $language.'_'.strtoupper($language); + setlocale(LC_TIME, $locales); return strftime($this->localizations[$type], $data); break; default: -- cgit v1.2.3