diff options
author | Andreas Fischer <bantu@owncloud.com> | 2013-10-23 15:38:54 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2013-10-23 15:38:54 +0200 |
commit | daf93c45165ac2c73fc1f0d6af513b8c3e497691 (patch) | |
tree | 73ed2c61aee7c6cbb38b1c93670ca37b25d3abba /lib/private/l10n.php | |
parent | c14b470ea24258b0402ad8ee783646d23c6693b9 (diff) | |
download | nextcloud-server-daf93c45165ac2c73fc1f0d6af513b8c3e497691.tar.gz nextcloud-server-daf93c45165ac2c73fc1f0d6af513b8c3e497691.zip |
Sort, so 'de' is preferred over 'de_DE' when performing non-exact matching.
Diffstat (limited to 'lib/private/l10n.php')
-rw-r--r-- | lib/private/l10n.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/l10n.php b/lib/private/l10n.php index 62827312d32..9392cfac05b 100644 --- a/lib/private/l10n.php +++ b/lib/private/l10n.php @@ -458,6 +458,10 @@ class OC_L10N implements \OCP\IL10N { } else { $available = self::findAvailableLanguages($app); } + + // E.g. make sure that 'de' is before 'de_DE'. + sort($available); + $preferences = preg_split('/,\s*/', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE'])); foreach($preferences as $preference) { list($prefered_language) = explode(';', $preference); |