mirror of
https://github.com/silverstripe/silverstripe-installer
synced 2024-10-22 15:05:33 +00:00
MINOR Installer gets default locale from i18n::get_locale() before trying to autodiscover by USER_AGENT string
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/branches/2.4@100877 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ce381845d5
commit
ee3bbe3c95
@ -57,11 +57,11 @@ include_once('sapphire/dev/install/DatabaseAdapterRegistry.php');
|
||||
|
||||
// Set default locale, but try and sniff from the user agent
|
||||
$locales = i18n::$common_locales;
|
||||
$defaultLocale = 'en_US';
|
||||
if (isset($_SERVER['HTTP_USER_AGENT'])) {
|
||||
$defaultLocale = i18n::get_locale();
|
||||
if(isset($_SERVER['HTTP_USER_AGENT'])) {
|
||||
foreach($locales as $code => $details) {
|
||||
$bits = explode('_', $code);
|
||||
if (preg_match("/{$bits[0]}.{$bits[1]}/", $_SERVER['HTTP_USER_AGENT'])) {
|
||||
if(preg_match("/{$bits[0]}.{$bits[1]}/", $_SERVER['HTTP_USER_AGENT'])) {
|
||||
$defaultLocale = $code;
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user