From a61e9ab274441adf5801dccade0176646de1c522 Mon Sep 17 00:00:00 2001 From: pappastech Date: Thu, 6 Sep 2012 19:48:40 +0000 Subject: [PATCH] Fixed last item on the list which was to get the language selection working from the config area of the site versus having to change the language in the application/config/config.php file. We're now at version 2.0! Tom git-svn-id: svn+ssh://jekkos@svn.code.sf.net/p/opensourcepos/code/@55 c3eb156b-1dc0-44e1-88ae-e38439141b53 --- application/config/config.php | 2 +- application/hooks/load_config.php | 9 ++++++++- application/libraries/MY_Language.php | 26 -------------------------- 3 files changed, 9 insertions(+), 28 deletions(-) delete mode 100644 application/libraries/MY_Language.php diff --git a/application/config/config.php b/application/config/config.php index 969fe7128..e323183e7 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -9,7 +9,7 @@ | | */ -$config['application_version'] = '2.0_RC8'; +$config['application_version'] = '2.0'; /* |-------------------------------------------------------------------------- diff --git a/application/hooks/load_config.php b/application/hooks/load_config.php index a19115981..33ccfbb77 100644 --- a/application/hooks/load_config.php +++ b/application/hooks/load_config.php @@ -10,7 +10,14 @@ function load_config() if ($CI->config->item('language')) { - //$CI->lang->switch_to($CI->config->item('language')); + $CI->config->set_item( 'language', $CI->config->item( 'language' ) ); + $loaded = $CI->lang->is_loaded; + $CI->lang->is_loaded = array(); + + foreach($loaded as $file) + { + $CI->lang->load( str_replace( '_lang.php', '', $file ) ); + } } if ($CI->config->item('timezone')) diff --git a/application/libraries/MY_Language.php b/application/libraries/MY_Language.php deleted file mode 100644 index 226fbb9af..000000000 --- a/application/libraries/MY_Language.php +++ /dev/null @@ -1,26 +0,0 @@ -config->set_item('language',$idiom); - $loaded = $this->is_loaded; - $this->is_loaded = array(); - - foreach($loaded as $file) - { - $this->load(str_replace('_lang.php','',$file)); - } - } - } -} - -?>