mirror of
https://github.com/nextcloud/server.git
synced 2025-10-26 19:21:34 +00:00
Merge pull request #2887 from owncloud/l10n-caching
L10N: cache the result of findLanguage
This commit is contained in:
commit
8d1db84ed1
@ -298,10 +298,16 @@ class OC_L10N{
|
||||
$temp = explode(';', $i);
|
||||
$temp[0] = str_replace('-', '_', $temp[0]);
|
||||
if( ($key = array_search($temp[0], $available)) !== false) {
|
||||
if (is_null($app)) {
|
||||
self::$language = $available[$key];
|
||||
}
|
||||
return $available[$key];
|
||||
}
|
||||
foreach($available as $l) {
|
||||
if ( $temp[0] == substr($l, 0, 2) ) {
|
||||
if (is_null($app)) {
|
||||
self::$language = $l;
|
||||
}
|
||||
return $l;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user