summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-05-08 23:45:07 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-05-08 23:45:07 +0200
commit9c57ae89d900f7a3eb37425f749c4c18db1218b5 (patch)
tree55c15cfcc2694bc8af2e402aa4ada32b1b9128b4 /lib
parentc9921ec127ecf936a77d000754063120e1597932 (diff)
downloadnextcloud-server-9c57ae89d900f7a3eb37425f749c4c18db1218b5.tar.gz
nextcloud-server-9c57ae89d900f7a3eb37425f749c4c18db1218b5.zip
Some locales need to be converted to be compliant with CLDR
Diffstat (limited to 'lib')
-rw-r--r--lib/private/l10n.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/private/l10n.php b/lib/private/l10n.php
index b070a299a16..d367dbae690 100644
--- a/lib/private/l10n.php
+++ b/lib/private/l10n.php
@@ -385,6 +385,7 @@ class OC_L10N implements \OCP\IL10N {
if ($locale === null) {
$locale = self::findLanguage();
}
+ $locale = $this->transformToCLDRLocale($locale);
$options = array_merge(array('width' => 'long'), $options);
$width = $options['width'];
@@ -538,6 +539,7 @@ class OC_L10N implements \OCP\IL10N {
*/
public function getDateFormat() {
$locale = $this->getLanguageCode();
+ $locale = $this->transformToCLDRLocale($locale);
return Punic\Calendar::getDateFormat('short', $locale);
}
@@ -546,6 +548,15 @@ class OC_L10N implements \OCP\IL10N {
*/
public function getFirstWeekDay() {
$locale = $this->getLanguageCode();
+ $locale = $this->transformToCLDRLocale($locale);
return Punic\Calendar::getFirstWeekday($locale);
}
+
+ private function transformToCLDRLocale($locale) {
+ if ($locale === 'sr@latin') {
+ return 'sr_latn';
+ }
+
+ return $locale;
+ }
}