During deployment of phpScheduleIt here in Perth, Australia, I've noticed what I think is a subtle bug in the language selection functions in config/lang.php due to the ordering of regular expressions.
We need to have the en_GB locale set as default for all users as this affects the display of dates, so I set the defaultLanguage configuration option to 'en_GB'. However, the get_browser_lang() function consistently returns en_US as the language. Our browsers are sending en-au as their HTTP_ACCEPT_LANGUAGE.
Preliminary investigation showed that this was due to the regular expressions used to match the various English locales. The regexp for en_US is
en([-_]us)?|english
This matches en-us, en_us, en... and en-au.
Because en-us sits higher in the $languages array, a HTTP_ACCEPT_LANGUAGE header of 'en-gb' will always match against en_US before being checked against en_GB.
My suggestion is to alter the regular expressions for en_GB and en_US (and probably the others, for consistency) to something like:
'en_US' => array('^(en([-_]us)?|english)$', 'en_US.lang.php', 'en', 'English US'),
'en_GB' => array('^en[-_]gb$', 'en_GB.lang.php', 'en', 'English GB'),
This means that the en_US regex matches on 'en' and 'en-us', but not 'en-gb' or 'en-au'. This also removes the overlap between en_US and en_GB for the 'english' and 'en' codes.