• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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:
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:
array(2) { ["calendar_lang.php"]=> string(6) "french" ["trad_lang.php"]=> string(6) "french" }

Therefore, I suggest changing the code to:
if (! array_key_exists ( 'calendar_lang.php', $this->CI->lang->is_loaded ))
$this->CI->lang->load ( 'calendar' );

Once a language file is loaded, you can't load it again in another language. If that's what you are trying to do...
Test your translation files with Translation Tester

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

He is talking about this piece of Calendar code in base framework

(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 Wink

This is confirmed as CI bug and will be fixed in final 3.0 release.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.