]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix the behaviour of getLanguageCode() to match the expectation of the name
authorJoas Schilling <nickvergessen@owncloud.com>
Mon, 2 Mar 2015 17:02:51 +0000 (18:02 +0100)
committerJoas Schilling <nickvergessen@owncloud.com>
Tue, 3 Mar 2015 15:47:31 +0000 (16:47 +0100)
lib/private/l10n.php
lib/public/il10n.php

index 6c66bee3e7975f5f2a167e225558a2fef39366b1..4e9316c333e561954b48df11eed4a65d628b651c 100644 (file)
@@ -358,24 +358,15 @@ class OC_L10N implements \OCP\IL10N {
                self::$language = $lang;
        }
 
-
        /**
-        * find the best language
-        *
-        * @param array|string $app details below
-        *
-        * If $app is an array, ownCloud assumes that these are the available
-        * languages. Otherwise ownCloud tries to find the files in the l10n
-        * folder.
+        * The code (en, de, ...) of the language that is used for this OC_L10N object
         *
-        * If nothing works it returns 'en'
         * @return string language
         */
-       public function getLanguageCode($app=null) {
-               return self::findLanguage($app);
+       public function getLanguageCode() {
+               return $this->lang ? $this->lang : self::findLanguage();
        }
 
-
        /**
         * find the best language
         * @param array|string $app details below
@@ -515,7 +506,7 @@ class OC_L10N implements \OCP\IL10N {
         * @throws \Punic\Exception\ValueNotInList
         */
        public function getDateFormat() {
-               $locale = self::findLanguage();
+               $locale = $this->getLanguageCode();
                return Punic\Calendar::getDateFormat('short', $locale);
        }
 
@@ -523,7 +514,7 @@ class OC_L10N implements \OCP\IL10N {
         * @return int
         */
        public function getFirstWeekDay() {
-               $locale = self::findLanguage();
+               $locale = $this->getLanguageCode();
                return Punic\Calendar::getFirstWeekday($locale);
        }
 }
index 2c95ddfec181f88628a9f6aa4bd73060b6809d6b..c63c18209e451bc38bc7031f153fede3c286d5f2 100644 (file)
@@ -75,15 +75,9 @@ interface IL10N {
 
 
        /**
-        * find the best language
-        * @param array|string $app details below
-        * @return string language
-        *
-        * If $app is an array, ownCloud assumes that these are the available
-        * languages. Otherwise ownCloud tries to find the files in the l10n
-        * folder.
+        * The code (en, de, ...) of the language that is used for this OC_L10N object
         *
-        * If nothing works it returns 'en'
+        * @return string language
         */
-       public function getLanguageCode($app=null);
+       public function getLanguageCode();
 }