summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
Diffstat (limited to 'settings')
-rw-r--r--settings/personal.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/settings/personal.php b/settings/personal.php
index 32944de7200..0cfdc9ed371 100644
--- a/settings/personal.php
+++ b/settings/personal.php
@@ -95,6 +95,15 @@ ksort($commonlanguages);
// sort now by displayed language not the iso-code
usort( $languages, function ($a, $b) {
+ if ($a['code'] === $a['name'] && $b['code'] !== $b['name']) {
+ // If a doesn't have a name, but b does, list b before a
+ return 1;
+ }
+ if ($a['code'] !== $a['name'] && $b['code'] === $b['name']) {
+ // If a does have a name, but b doesn't, list a before b
+ return -1;
+ }
+ // Otherwise compare the names
return strcmp($a['name'], $b['name']);
});