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' );
both way render current language site name
render default langauge site name
joomla 4.0.4
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
@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.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-10-29 04:31:12 |
Closed_By | ⇒ | joomdonation |
@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
@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
You must enable the language filter plugin