Try to load a frontend language file from a plugin running on backend. Error occurs when a backend language file already loaded. Language::getPaths
returns something, because there's another file for the same extension.
Nice translated text.
Language constant.
Joomla 3.9.22, PHP 7.4
If I trying to use $this->loadLanguage('com_something', JPATH_SITE)
in my plugin AND com_something's ADMIN language file is already loaded, CMSPlugin::loadLanguage
skips loadig, because it doesn't check if $basePath
matches or not.
CMSPlugin.php, from line 140:
// If language already loaded, don't load it again.
if ($lang->getPaths($extension))
{
return true;
}
Labels |
Added:
?
|
Digging into Joomla\CMS\Language I found out checking if the language file already loaded in CMSPlugin is unnecessary because Language::load() also checks it, and does a better work.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-11-05 08:22:15 |
Closed_By | ⇒ | zero-24 |
Good morning, can you provide a Patch and send it against the staging branch on GitHub?
And for the testers a quick Test extension showcasing the problem would be great.