URI Language Identifier |
[eluser]Ficoder[/eluser]
Hi, I'm using this URI Language Identifier library to my site support multilanguage. Cause this script doesn't use HTTP_ACCEPT_LANGUAGE, it will always show site with default language what i have defined in config file. I thought that i make little change, that every time when $lang_abbr is changed, it would be stored in cookie, and when user next time visits page, it would load that as default language from cookie. But im stuck cause i can't use set_cookie helper in library, is it possible to use helpers in library or should i just use native PHP functions? Btw. I tried first Internationalization (i18n) library for CodeIgniter, but i couldn't get it work. When i used it, it always gives me redirect pages. If i tried to access site like server/site/controller i always got "Redirecting to". But if i accessed like this server/site/lang/controller, it worked, but all form actions etc. are pointing to urls without lang. If i submit forms i will get redirect pages.
[eluser]bretticus[/eluser]
Checkout Utilizing CodeIgniter Resources within Your Library in the manual.
[eluser]Ficoder[/eluser]
[quote author="bretticus" date="1283072688"]Checkout Utilizing CodeIgniter Resources within Your Library in the manual.[/quote] Thanks. I think i just need to take couple of steps back and read all through again. I keep getting "Fatal error: Call to undefined function get_instance() in C:\xampp\htdocs\test\application\libraries\MY_Language.php on line 39" error when trying to set $CI =& get_instance(); variable.
[eluser]Ficoder[/eluser]
Correct me if i'm wrong, but i think i can't use helpers in this case? Cause if i'm trying to assign CI object to variable, i always have this same error that there isn't function get_instance(). Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); So i have to make changes like this: Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); But after that, i have to call DoYourThing() function manually and it doesn't serve at is purpose anymore. Cause my goal is that, i doesn't have to call some function in every controller. That's why i want this to be more "Core" thing. |
Welcome Guest, Not a member yet? Register Sign In |