Add auto language detection
This commit is contained in:
@@ -52,7 +52,7 @@ $autoload['packages'] = array(APPPATH.'third_party');
|
||||
| $autoload['libraries'] = array('database', 'session', 'xmlrpc');
|
||||
*/
|
||||
|
||||
$autoload['libraries'] = array('database','session');
|
||||
$autoload['libraries'] = array('lang_detect', 'database', 'session');
|
||||
|
||||
|
||||
/*
|
||||
|
||||
31
application/config/lang_detect.php
Normal file
31
application/config/lang_detect.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php defined('BASEPATH') || exit("No direct script access allowed");
|
||||
|
||||
/**
|
||||
* Mapping browser's primary language ID to supported language directory.
|
||||
*/
|
||||
$config['lang_available'] = array(
|
||||
'en' => 'english',
|
||||
'en-uk' => 'english',
|
||||
'de' => 'german',
|
||||
'de-at' => 'german'
|
||||
);
|
||||
|
||||
/**
|
||||
* Default language code. This language MUST be supported!
|
||||
*/
|
||||
$config['lang_default'] = 'en';
|
||||
|
||||
/**
|
||||
* Selected language code (is set by the language detection).
|
||||
*/
|
||||
$config['lang_selected'] = 'en';
|
||||
|
||||
/**
|
||||
* The name you want for the cookie.
|
||||
*/
|
||||
$config['lang_cookie_name'] = 'lang_select_language';
|
||||
|
||||
/**
|
||||
* The number of seconds you want the language to be remembered.
|
||||
*/
|
||||
$config['lang_expiration'] = 63072000;
|
||||
Reference in New Issue
Block a user