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
* @throws \Punic\Exception\ValueNotInList
*/
public function getDateFormat() {
- $locale = self::findLanguage();
+ $locale = $this->getLanguageCode();
return Punic\Calendar::getDateFormat('short', $locale);
}
* @return int
*/
public function getFirstWeekDay() {
- $locale = self::findLanguage();
+ $locale = $this->getLanguageCode();
return Punic\Calendar::getFirstWeekday($locale);
}
}
/**
- * 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();
}