Closed mikajaxxx closed 3 years ago
You must enable the language filter plugin
@mikajaxxx Please check the previous comment and report back if your issue still persists after you have enabled the language filter plugin. Thanks in advance.
As pointed out by @brianteeman , you need to enable System - Language Filter plugin to have it works. The code which handles this could be found here https://github.com/joomla/joomla-cms/blob/4.0-dev/plugins/system/languagefilter/languagefilter.php#L189
Closing this issue as this is not a core issue.
@joomdonation & @brianteeman of course i enabled system - language Filter and System - Language Code before reporting this issue!
In which case neither of us can replicate the reported problem
It doesnt work on my website, i done it the same way as you!
@mikajaxxx Where do you put your code?
@joomdonation at a system plugin
@mikajaxxx And that's the reason of the issue. If you look at https://github.com/joomla/joomla-cms/blob/4.0-dev/plugins/system/languagefilter/languagefilter.php#L189, you will see that the language filter plugin process that data on onAfterRoute event, so if your system plugin code is triggered before that, the data won't be available
Steps to reproduce the issue
go extension-> langauges- > content langauges & set site name in ' Custom Site Name ' try retrieve site name for language by: $app = JFactory::getApplication(); $site_name = $app->get('sitename'); or $config = JFactory::getConfig(); $site_name = $config->get( 'sitename' );
Expected result
both way render current language site name
Actual result
render default langauge site name
System information (as much as possible)
joomla 4.0.4
Additional comments