diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-09-30 17:53:15 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-10-02 12:51:45 +0200 |
commit | 6b53f7c40e8bbaecfa20a3b19b3164e332903f59 (patch) | |
tree | 9df3e328daa7e8aa53bd4c939e145942d9bd1b72 /lib | |
parent | 4fb2ef3bacf2ae8eeac0b5bebecd98b90cca5511 (diff) | |
download | nextcloud-server-6b53f7c40e8bbaecfa20a3b19b3164e332903f59.tar.gz nextcloud-server-6b53f7c40e8bbaecfa20a3b19b3164e332903f59.zip |
[l10n] remove unused static methods
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/l10n.php | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/lib/private/l10n.php b/lib/private/l10n.php index 89ce2bc8d72..b3c87292f1d 100644 --- a/lib/private/l10n.php +++ b/lib/private/l10n.php @@ -390,29 +390,6 @@ class OC_L10N implements \OCP\IL10N { } /** - * Choose a language - * @param array $text Associative Array with possible strings - * @return String - * - * $text is an array 'de' => 'hallo welt', 'en' => 'hello world', ... - * - * This function is useful to avoid loading thousands of files if only one - * simple string is needed, for example in appinfo.php - */ - public static function selectLanguage($text) { - $lang = self::findLanguage(array_keys($text)); - return $text[$lang]; - } - - /** - * The given language is forced to be used while executing the current request - * @param string $lang - */ - public static function forceLanguage($lang) { - self::$language = $lang; - } - - /** * The code (en, de, ...) of the language that is used for this OC_L10N object * * @return string language @@ -423,17 +400,13 @@ class OC_L10N implements \OCP\IL10N { /** * find the best language - * @param array|string $app details below + * @param string $app * @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. - * * If nothing works it returns 'en' */ public static function findLanguage($app = null) { - if(!is_array($app) && self::$language != '') { + if(self::$language != '') { return self::$language; } @@ -443,13 +416,7 @@ class OC_L10N implements \OCP\IL10N { if($userId && $config->getUserValue($userId, 'core', 'lang')) { $lang = $config->getUserValue($userId, 'core', 'lang'); self::$language = $lang; - if(is_array($app)) { - $available = $app; - $lang_exists = array_search($lang, $available) !== false; - } else { - $lang_exists = self::languageExists($app, $lang); - } - if($lang_exists) { + if(self::languageExists($app, $lang)) { return $lang; } } |