Fix language detection for gettext

This commit is contained in:
Eike Foken
2011-08-11 05:05:00 +02:00
parent a7fd06cb72
commit 5074362e16
5 changed files with 107 additions and 177 deletions

View File

@@ -17,6 +17,5 @@ $hook['post_controller_constructor'] = array(
'filepath' => 'hooks'
);
/* End of file hooks.php */
/* Location: ./application/config/hooks.php */
/* Location: ./application/config/hooks.php */

View File

@@ -1,31 +0,0 @@
<?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;

View File

@@ -0,0 +1,32 @@
<?php defined('BASEPATH') || exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| Supported Languages
| -------------------------------------------------------------------
|
| Contains all languages your site will store data in. Other
| languages can still be displayed via language files, that's totally
| different.
|
| Check for HTML equivalents for characters such as <20> with the URL
| below:
|
| http://htmlhelp.com/reference/html40/entities/latin1.html
|
*/
$config['supported_languages'] = array(
'en'=> array('name' => 'English', 'locale' => 'en_US'),
'de'=> array('name' => 'Deutsch', 'locale' => 'de_DE')
);
/*
| -------------------------------------------------------------------
| Default Language
| -------------------------------------------------------------------
|
| If no language is detected, which one to use? Must be in the
| array above.
|
*/
$config['default_language'] = 'en';