Setting default language in config |
Hello!
I'm using the latest CI version. Currently, I'm trying to set up multi language support for my website. In application/config/config.php the default $config['language'] is set to 'english'. It's working as it should, and loads the application/language/english/english_lang.php file. But when I change the $config['language'] to something else, for example, polish, it gives me an error: Unable to load the requested language file: language/polish/english_lang.php Why is it trying to load english_lang.php and not polish_lang.php from the application/language/polish folder? Hope to get some input on this. Best regards.
Have you copied the appropriate language folders from https://github.com/bcit-ci/codeigniter3-translations into your application/language folder?
Code: $this->lang->load('error_messages', 'english'); (09-06-2016, 06:32 AM)ciadmin Wrote: Have you copied the appropriate language folders from https://github.com/bcit-ci/codeigniter3-translations into your application/language folder? When I'm loading the language with your example, everything works fine. The problem is when I set different language than english in the config.php file to use as the default language. When I set $config['language'] = 'polish'; It gives error: Unable to load the requested language file: language/polish/english_lang.php Shouldn't it be loading language/polish/polish_lang.php instead of language/polish/english_lang.php? Sure, I can set my messages for polish language in the language/polish/english_lang.php file, but that doesn't make much sense to me at the moment.
Hmm. something sounds funny, because there is no "english_lang.php" language settings file in CI.
If using language "x", CI looks inside system/language/x/ for specific language files, and then inside application/language/x/
ciadmin is correct there is no english_lang.php file in CodeIgniter.
The only specification is directory english. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Ok, I seem to have figured it out.
In autoload.php I had set $autoload['language'] = array('english'); That's why it was trying to load english_lang.php. Thanks for your input guys! |
Welcome Guest, Not a member yet? Register Sign In |