Calendar library lang file loader issue |
Hello everyone,
I had to use a translation for the Calendar library and I realized that this piece of code is actually not working well for me: Code: if ( ! in_array('calendar_lang.php', $this->CI->lang->is_loaded, TRUE)) Indeed, the content of lang->is_loaded is an array in which calendar_lang.php is a key: Code: array(2) { ["calendar_lang.php"]=> string(6) "french" ["trad_lang.php"]=> string(6) "french" } Therefore, I suggest changing the code to: Code: if (! array_key_exists ( 'calendar_lang.php', $this->CI->lang->is_loaded ))
Once a language file is loaded, you can't load it again in another language. If that's what you are trying to do...
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
No, not at all, I think you got me wrong.
I was simply stating that the piece of code checking if calendar_lang has been already loaded is not working properly. In my case, I load all _lang file depending on user's favorite language. The actual code is not checking properly and reloads the calendar_lang file with the default language set in config.php (03-23-2015, 05:21 AM)gadelat Wrote: He is talking about this piece of Calendar code in base framework That's right, thanks for the direct link |
Welcome Guest, Not a member yet? Register Sign In |