[Pkg-owncloud-commits] [owncloud] 33/123: Some locales need to be converted to be compliant with CLDR

David Prévot taffit at moszumanska.debian.org
Tue May 19 23:55:10 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 9c57ae89d900f7a3eb37425f749c4c18db1218b5
Author: Thomas Müller <thomas.mueller at tmit.eu>
Date:   Fri May 8 23:45:07 2015 +0200

    Some locales need to be converted to be compliant with CLDR
---
 lib/private/l10n.php | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lib/private/l10n.php b/lib/private/l10n.php
index b070a29..d367dba 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 at latin') {
+			return 'sr_latn';
+		}
+
+		return $locale;
+	}
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list