diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-05-11 11:21:28 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-05-11 11:21:28 +0200 |
commit | 7db994971e243eaeb0ee8fa86e8dfea13384c6d9 (patch) | |
tree | fea35f82d471f2b61d31467509b95b33ff2d1412 /lib | |
parent | f057efc42e62cc0efd511d84969ba1679104627c (diff) | |
parent | 9c57ae89d900f7a3eb37425f749c4c18db1218b5 (diff) | |
download | nextcloud-server-7db994971e243eaeb0ee8fa86e8dfea13384c6d9.tar.gz nextcloud-server-7db994971e243eaeb0ee8fa86e8dfea13384c6d9.zip |
Merge pull request #16208 from owncloud/fix-language-selection-sr-latin
Some locales need to be converted to be compliant with CLDR
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/l10n.php | 11 |
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; + } } |