User tests: Successful: Unsuccessful:
Language::load() also checks, and that works better.
Pull Request for Issue #31311 .
I found the issue in the following situation:
I have a component which have settings for users (at user profile, via plugin) and one of these can be changed temporary for a specific item. The UI for changing default value and for the temporary change shares the same code, and same language file.
Because the plugin works with user profile I can edit it's value both frontend and backend. For some reason (probably custom field types in admin folder) on the admin side it loads the components admin language file, which prevents the loading of frontend language file if CMSPlugin checks if there is any file loaded for the extension.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Aren't all plugin language files located in the admin language folder?
Actually it should load the components language file. Because that's used for UI, generating content, ect. The plugin basically only for show/edit the user's settings in the user's profile. It's not a standalone plugin.
The matter is not the loading of the plugin lang file, but the loading of the component site lang file by the plugin.
oops, OP already replied. :)
The function is
public function loadLanguage($extension = '', $basePath = JPATH_ADMINISTRATOR)
Therefore I guess you can loadLangage in your plugin using the site basepath
The function is
public function loadLanguage($extension = '', $basePath = JPATH_ADMINISTRATOR)
Therefore I guess you can loadLangage in your plugin using the site basepath
Watch the removed lines. It doesn't care with $basePath if any lang file loaded from the same plugin. I want to use both frontend and backend lang files, but those lines makes it impossible.
The function is
public function loadLanguage($extension = '', $basePath = JPATH_ADMINISTRATOR)
Therefore I guess you can loadLangage in your plugin using the site basepathWatch the removed lines. It doesn't care with $basePath if any lang file loaded from the same plugin. I want to use both frontend and backend lang files, but those lines makes it impossible.
Also, Joomla loads all admin lang files of the extensions, so loading a frontend file from a component is problematic from the admin side via plugins. Of course I can use Language::load(), but then there's no real reason for the existence of Plugin::loadLanguage()
The Plugin::loadLanguage() loads the plugins language file but you can use Language::load() to load the component language file. I dont intent to change this behavior within J3. I would recommend to check whether the current status of J4 is still the same, get it tested and get it fixed there
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-07-21 17:11:07 |
Closed_By | ⇒ | zero-24 | |
Labels |
Added:
?
|
Aren't all plugin language files located in the admin language folder?