CodeIgniter Forums

Full Version: Those damn language files kill you: HMVC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Oke here is the problem i have been working on a project for quite some time now and was getting started on translating the whole thing.
I am working with hmvc Wirezdesign and using CI 3.0, everything works fine i can create modules load everything i need but then those language file's.....

Somehow HMVC does not recognize where i put my lang file's its giving me this error:

Code:
Unable to load the requested language file: language/dutch/members_lang.php

il bet this has been asked 1000 time's now but google is not helping and searching Codeigniter forums is not helping me eighter.
Someone faced the same problem?

Greetings Decoder
Where did you put the file and how did you attempt to load it?

If I remember correctly, it should work in either /application/language/dutch/members_lang.php or /application/modules/members/language/dutch/members_lang.php, assuming that you're in a module named members. One of the common issues I've seen with loading files in HMVC comes up when loading files from one module within another module (which in itself is probably an issue, but not the point at the moment). For instance, if the file is in your members module, but you're currently in another module, it will look in the current module's language directory or the application directory, but it will only look in the members module if you load it like this:
PHP Code:
$this->lang->load('members/members'); 

For this reason, any modules I do create which I expect to be shared widely in the application (or when I'm loading files within Bonfire's modules) will use this format even within the module itself to ensure that the loader looks in the right module.
Hello Mrwhitney,

I am trying to load the laguage in the controller constructor liko so :

PHP Code:
    function __construct() {
 
       parent::__construct();
        

        if (!
$this->ion_auth->logged_in())
        {
            
redirect('auth/login');
        }
    
//$this->load->language('members');
    //$this->lang->load('members');
 
   

[attachment=291]

In my searches over the internet regarding this the actual docs from wirezdesign say the first approach is the one to go with, but without results.
However the funny thing here is....all the language files from Ion Auth seem to load fine.....so i must be doing something wrong here, i disected the pyro cms source to see how Phill did it and also studied the bonfire source to see how it was done.

Hope you or anybody could point me in the right direction to sort this out.

Thanks in advanced

Decoder
Oke i found the problem and must say it's a dump mistake.
First off i was sitting here drinking a cup of coffee pulling my hairs out figuring out why it wont load.

I created 7 modules in my project members, media, shoutbox, forums ect en tought oke lets try the others, so i adjusted the filestructure en created language folder and files accordinly to those module's.

guess what? they worked the first run......i was like DAMNNNN how come???

Then i took a good look and i noticed it....... i got a space on my language folder title so thats why it could not find it...Damn dude lol.

Removed the space and refreshed the page and Haleluja the it is Smile

Thanks anyway mwhitney for trying helping me it's much appreciated.

If a forum Moderator reads this you can lock or delete this post.

Cheers Decoder