
Originally Posted by
balihr
Yeah, sorry about that. As mentioned earlier, the plugin is currently compatible with up to 1.5.8. Updating it to work with 2.1.0 is on top of my priorities list, but my schedule has unexpectedly turned into a nightmare. I should be free after the first week of Feb and will be updating it first thing. Until then, I'm afraid I can't do much.
wow, this is your plugin? who knew....
only because i truly like @balihr, i can provide some direction to the OP question.
please note, that while this may solve your original error; a new error may/will pop up. (note the use of a linux not windows slash!
)
the situation is you want to load a language file, when ZC has not loaded it. this is how i solved this issue:
create a file; call it something like:
includes/functions/extra_functions/my_functions.php
in that location.
then within that file, put in the following code:
PHP Code:
function loadExtraLanguages(string $filename, string $middleDir = ''): void
{
global $template_dir, $languageLoader;
if (empty($middleDir)) {
$middleDir = '/' . $template_dir;
}
$new_langfile = DIR_FS_CATALOG . DIR_WS_LANGUAGES . $_SESSION['language'] . $middleDir . '/' . 'lang.' . $filename;
if (file_exists($new_langfile)) {
$languageLoader->loadExtraLanguageFiles(DIR_FS_CATALOG . DIR_WS_LANGUAGES, $_SESSION['language'], $filename, $middleDir);
} else {
$languageLoader->loadExtraLanguageFiles(DIR_FS_CATALOG . DIR_WS_LANGUAGES, $_SESSION['language'], $filename);
}
}
now, once that is done, on line 97 change accordingly:
PHP Code:
//from:
$languageLoader->loadDefinesFromFile('', $_SESSION['language'], 'account.php');
//to:
loadExtraLanguages('account.php');
the function will load either the new style language file, ie lang.account.php or the old style, depending on what exists for the specific file.
please let us know if that works for you.
you may run into other errors, but this is how i accomplished loading a language file when needed in zc v158 and onwards...
you are welcome.
best.