From 2180a4c4205466e34888f689bdbf1c7624c3ad87 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 12 Apr 2013 00:58:14 +0200 Subject: [PATCH] -L10N: cache the result of findLanguage --- lib/l10n.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/l10n.php b/lib/l10n.php index 1e07a9b9557..315e326b292 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -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; } }