summaryrefslogtreecommitdiffstats
path: root/lib/private/l10n.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2013-10-23 15:38:54 +0200
committerAndreas Fischer <bantu@owncloud.com>2013-10-23 15:38:54 +0200
commitdaf93c45165ac2c73fc1f0d6af513b8c3e497691 (patch)
tree73ed2c61aee7c6cbb38b1c93670ca37b25d3abba /lib/private/l10n.php
parentc14b470ea24258b0402ad8ee783646d23c6693b9 (diff)
downloadnextcloud-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.php4
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);