Sort countries by locale, according to user's language and country settings

This commit is contained in:
Nathan Gray 2015-03-24 16:05:02 +00:00
parent 99657a094b
commit 21fca0b702

View File

@ -456,6 +456,16 @@ class country
$this->countries_translated[$k] = $translated;
}
}
asort($this->countries_translated);
if(class_exists('Collator') && class_exists('Locale'))
{
$col = new \Collator($GLOBALS['egw_info']['user']['preferences']['common']['lang'].'_'.
$GLOBALS['egw_info']['user']['preferences']['common']['country']);
$col->asort($this->countries_translated);
}
else
{
asort($this->countries_translated);
}
}
}