Welcome Guest, Not a member yet? Register   Sign In
language/db_lang.php
#1

[eluser]Pedro Luz[/eluser]
Hi,

in my current project, sometimes i get this error:


An Error Was Encountered
Unable to load the requested language file: language/db_lang.php

Why????

thanks
#2

[eluser]simshaun[/eluser]
Well, does the file exist? (under system/ or application/)
#3

[eluser]Pedro Luz[/eluser]
yes.. it does..
i think.. it's trying to read some error in the array in that file...
im trying to isolate the query to see if i can catch the problem...
#4

[eluser]Pedro Luz[/eluser]
$itemArrayQuery = array(
'name' => $this->db->escape($name)
);

// insert the item
$this->db->set($itemArrayQuery);
$this->db->insert('item');

the error is comming from this piece of code...

but dont know why Sad
#5

[eluser]Pedro Luz[/eluser]
one thing that i've notice is that the files in the /system/language/english all start with <?php but they dont end with ?>

is that normal?????
#6

[eluser]simshaun[/eluser]
Its not an error in the code.

The error message you are getting plainly states that it cannot load "language/db_lang.php".
So, you need to make sure "/system/language/db_lang.php" exists.

In CI 1.7.1, the actual path to that file is "/system/language/english/db_lang.php".
It sounds like you need to fix a config setting.
Look in /system/application/config/config.php and check to make sure $config['language'] = 'english';

Edit: Just saw your edited post.
To answer your question, not having ?> at the end of a php file is normal (and advised).
#7

[eluser]Pedro Luz[/eluser]
"Look in /system/application/config/config.php and check to make sure $config[‘language’] = ‘english’;"

the $config[‘language’] = ‘english’; has something to do with the db_lang.php in the /system/language/english?????

i dont think so

the $config[‘language’] = ‘english’; is only for my translations that happens in the /system/application

or i'm i wrong???

but the error is coming from the /system/language for the CI translation

there is no db_lang.php in /system/application/language/<language>
just in /system/language/english
#8

[eluser]simshaun[/eluser]
It has everything to do with it.

The language class will look for the language file it needs by looking in $config['language']. Whatever $config['language'] is set to should be a subdirectory of /language/.

So,
If $config['language'] = 'espanol', CI will be looking for db_lang.php in /language/espanol/
If $config['language'] = 'english', CI will be looking for db_lang.php in /language/english/
If $config['language'] = 'italian', CI will be looking for db_lang.php in /language/italian/
If $config['language'] = '', CI defaults to 'english', so it will be looking for db_lang.php in /language/english/
#9

[eluser]Pedro Luz[/eluser]
so if i change $config['language'] = "republicaDasBananas";

i need to create the /language/republicDasBananas/db_lang.php


?????????????? or to copy paste it??? from the english directory.. o rename it??? in /system/language
#10

[eluser]simshaun[/eluser]
Yes.
Make sure to copy all of the language files though, or you'll be risking the possibility of getting further errors in your application.




Theme © iAndrew 2016 - Forum software by © MyBB