Skip to content

Commit

Permalink
Merge pull request #3275 from kimse1/accept-language-disable
Browse files Browse the repository at this point in the history
Added option to turn Accept-language on/off
  • Loading branch information
Phil Sturgeon committed May 6, 2014
2 parents 00712ab + a20a633 commit c1f5043
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 201 deletions.
13 changes: 13 additions & 0 deletions system/cms/config/language.php
Expand Up @@ -211,3 +211,16 @@
|
*/
$config['default_language'] = 'en';

/*
|--------------------------------------------------------------------------
| Detect language using Accept-Language
|--------------------------------------------------------------------------
|
| Whether or not to take into account the Accept-Language client header
|
| Only turn it on for admin panel:
| $config['check_http_accept_language'] = (bool) preg_match('@\/admin(\/.+)?$@', $_SERVER['REQUEST_URI']);
|
*/
$config['check_http_accept_language'] = TRUE;
199 changes: 0 additions & 199 deletions system/cms/config/language.php.orig

This file was deleted.

4 changes: 2 additions & 2 deletions system/cms/hooks/pick_language.php
Expand Up @@ -57,7 +57,7 @@ function pick_language()
}

// Still no Lang. Lets try some browser detection then
elseif ( ! empty($_SERVER['HTTP_ACCEPT_LANGUAGE']))
elseif ( $config['check_http_accept_language'] and ! empty($_SERVER['HTTP_ACCEPT_LANGUAGE']))
{
// explode languages into array
$accept_langs = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
Expand Down Expand Up @@ -117,4 +117,4 @@ function pick_language()
define('AUTO_LANGUAGE', $lang);

log_message('debug', 'Defined const AUTO_LANGUAGE: '.AUTO_LANGUAGE);
}
}

0 comments on commit c1f5043

Please sign in to comment.