Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
a7482227
Commit
a7482227
authored
Nov 27, 2014
by
Vincent Petry
Browse files
Merge pull request #12464 from owncloud/cache-available-languages
Cache results of available languages
parents
51190f71
b20d698e
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/private/l10n.php
View file @
a7482227
...
...
@@ -20,6 +20,7 @@ class OC_L10N implements \OCP\IL10N {
* cache
*/
protected
static
$cache
=
array
();
protected
static
$availableLanguages
=
array
();
/**
* The best language
...
...
@@ -468,6 +469,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
;
}
$available
=
array
(
'en'
);
//english is always available
$dir
=
self
::
findI18nDir
(
$app
);
if
(
is_dir
(
$dir
))
{
...
...
@@ -479,6 +483,8 @@ class OC_L10N implements \OCP\IL10N {
}
}
}
self
::
$availableLanguages
=
$available
;
return
$available
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment