diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-09-30 16:49:16 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-09-30 16:49:16 +0200 |
commit | 5a2b30d78f1a5cb1879a453a9ac43cd5fa1de90c (patch) | |
tree | 28dc1f79f13e46b3baa9a3beab45bf41a9babfa8 /lib | |
parent | acd6c9b605c4d66ab2176bbb1f7b1952c4e7981d (diff) | |
download | nextcloud-server-5a2b30d78f1a5cb1879a453a9ac43cd5fa1de90c.tar.gz nextcloud-server-5a2b30d78f1a5cb1879a453a9ac43cd5fa1de90c.zip |
cache found l10n per app and not globally
* fixes: if the first call to this is with an app that has no translations
all future call will get a list with only english in there - even
if their l10n holds more translations
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/l10n.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/l10n.php b/lib/private/l10n.php index 168011cfcec..ad02ba88526 100644 --- a/lib/private/l10n.php +++ b/lib/private/l10n.php @@ -503,8 +503,9 @@ class OC_L10N implements \OCP\IL10N { * @return array an array of available languages */ public static function findAvailableLanguages($app=null) { - if(!empty(self::$availableLanguages)) { - return self::$availableLanguages; + // also works with null as key + if(isset(self::$availableLanguages[$app]) && !empty(self::$availableLanguages[$app])) { + return self::$availableLanguages[$app]; } $available=array('en');//english is always available $dir = self::findI18nDir($app); @@ -518,7 +519,7 @@ class OC_L10N implements \OCP\IL10N { } } - self::$availableLanguages = $available; + self::$availableLanguages[$app] = $available; return $available; } |