diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-03-02 18:02:51 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-03-03 16:47:31 +0100 |
commit | b669bf26d6774706a61242d67fbfe24f05eb1760 (patch) | |
tree | df87392d2ed11133936465182609fd70dd2f1450 /lib/private/l10n.php | |
parent | ed4c05c7b5e61d00722238f25154ad475fd632bb (diff) | |
download | nextcloud-server-b669bf26d6774706a61242d67fbfe24f05eb1760.tar.gz nextcloud-server-b669bf26d6774706a61242d67fbfe24f05eb1760.zip |
Fix the behaviour of getLanguageCode() to match the expectation of the name
Diffstat (limited to 'lib/private/l10n.php')
-rw-r--r-- | lib/private/l10n.php | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/private/l10n.php b/lib/private/l10n.php index 6c66bee3e79..4e9316c333e 100644 --- a/lib/private/l10n.php +++ b/lib/private/l10n.php @@ -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); } } |