language file errors during upgrade from 2.1.4 to 3.0.0 |
Just to preface, I have read and followed the step-by-step upgrade instructions found at http://www.codeigniter.com/user_guide/in...e_300.html. I've also searched but I was unable to come up with a solution that has fixed my problem.
My production CI 2.1.4 web application works with no errors. However when I clone that to my dev version and walk through the upgrade instructions I get the following error: "Unable to load the requested language file: language/en/en_lang.php" en_lang.php does not exist and has never existed. autoload.php Code: $autoload['language'] = array('common', 'config', 'customers', 'employees', 'error', 'items', 'login', 'module', 'orders', 'reports', 'sales','suppliers','receivings','giftcards', 'item_kits'); config.php Code: $config['language'] = 'en'; My /application/language/ folder structure hasn't changed and is a two character subfolder for each language with identical _lang.php files in each folder (e.g. /application/language/en/...) again, this is working properly in 2.1.4.
Update: so, just for testing I placed an empty file named en_lang.php in /application/language/en/ and the error went away.
I saw nothing in the documentation indicating that this should be necessary. What changed. I'd prefer to understand why it is that CI 3.0.0 is requiring the file en_lang.php or [idiom]_lang.php to be there.
CI3 assume that the default language is english and not in shorhand en. If you set in your config english instead of en it should work without any error.
According to the CI3 documentation (http://www.codeigniter.com/user_guide/li...guage.html) I should be able to use the shorthand.
Quote:Internationalization
further, when I change the language I get an error indicating that it's looking for the same en_lang.php in that language's folder
Quote:Unable to load the requested language file: language/az/en_lang.php If it was asking for az_lang.php I would understand but it isn't. Instead it wants en_lang.php.
Sure, you can of course use shortand names but then you have to put alle neccesary lang files in the default lang directory. You can look here for many translations: https://github.com/bcit-ci/codeigniter3-translations
Did you load the lang in your controller like that?
$this->lang->load('en', 'az'); This, would give you your error messages, because ci looks for a language file en_lang.php inside the languages/az folder.
Keep in mind this is working without errors in my CI 2.x production environment. Ill check my code when I get home but you're suggesting things that would have broken the CI 2.x web-app also.
|
Welcome Guest, Not a member yet? Register Sign In |