Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[IMP] Added default language support feature
  • Loading branch information
smrdoshi committed Feb 19, 2018
1 parent db62e82 commit 3a078d0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 606 deletions.
2 changes: 1 addition & 1 deletion web_interface/astpp/application/config/config.php
Expand Up @@ -76,7 +76,7 @@
* | than english.
* |
*/
$config ['language'] = 'english';
$config ['language'] = 'en_EN';

/*
* |--------------------------------------------------------------------------
Expand Down
5 changes: 3 additions & 2 deletions web_interface/astpp/application/libraries/locale.php
Expand Up @@ -36,9 +36,10 @@ function __construct($library_name = '') {
$this->set_lang ();
}
function set_lang($lang = FALSE) {
$current_locale = $this->CI->session->userdata ( 'user_language' );
$current_locale = $this->CI->session->userdata ( 'user_language' );
if (empty ( $current_locale )) {
$current_locale = 'en_US';
//$current_locale = 'en_US';
$current_locale = config_item('language');
}
putenv ( "LANG=$current_locale" );
//setlocale ( LC_ALL, $current_locale . ".UTF-8" );
Expand Down
Expand Up @@ -49,7 +49,7 @@ function set_lang_global($post = false) {
}
if (isset ( $post ['en_EN'] )) {
$language = $post ['en_EN'];
$this->session->unset_userdata ( 'user_language', $language );
$this->session->set_userdata ( 'user_language', $language );
}
$this->locale->set_lang ();
return true;
Expand Down

0 comments on commit 3a078d0

Please sign in to comment.