CodeIgniter Forums
language file errors during upgrade from 2.1.4 to 3.0.0 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: language file errors during upgrade from 2.1.4 to 3.0.0 (/showthread.php?tid=61439)



language file errors during upgrade from 2.1.4 to 3.0.0 - objecttothis - 04-15-2015

Just to preface, I have read and followed the step-by-step upgrade instructions found at http://www.codeigniter.com/user_guide/installation/upgrade_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.


RE: language file errors during upgrade from 2.1.4 to 3.0.0 - objecttothis - 04-15-2015

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.


RE: language file errors during upgrade from 2.1.4 to 3.0.0 - Rufnex - 04-15-2015

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.


RE: language file errors during upgrade from 2.1.4 to 3.0.0 - objecttothis - 04-15-2015

According to the CI3 documentation (http://www.codeigniter.com/user_guide/libraries/language.html) I should be able to use the shorthand.

Quote:Internationalization

The Language class in CodeIgniter is meant to provide an easy and lightweight way to support multiplelanguages in your application. It is not meant to be a full implementation of what is commonly called internationalization and localization.

We use the term “idiom” to refer to a language using its common name, rather than using any of the international standards, such as “en”, “en-US”, or “en-CA-x-ca” for English and some of its variants.

Note
There is nothing to prevent you from using those abbreviations in your application!



RE: language file errors during upgrade from 2.1.4 to 3.0.0 - objecttothis - 04-15-2015

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.


RE: language file errors during upgrade from 2.1.4 to 3.0.0 - Rufnex - 04-15-2015

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


RE: language file errors during upgrade from 2.1.4 to 3.0.0 - Rufnex - 04-15-2015

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.


RE: language file errors during upgrade from 2.1.4 to 3.0.0 - objecttothis - 04-16-2015

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.