You can programmatically set the language of Joomla with the following code:

$lang = JFactory::getLanguage();
$bla = $lang->setLanguage('fr-FR');

But when you try to get sitename, it's not translated:

$app = JFactory::getApplication('site');
$sitename = $app->get('sitename');  // <--- Still in English

Did I miss something? Does load() need an argument to load the translation of sitemap?

Edit: One solution, using raw database query to get it: https://stackoverflow.com/questions/19511362/get-joomla-sitename-in-different-language

  • It's not translated because your only geting the site name from the global configuration
    – Lodder
    Jul 12 '17 at 16:13
  • Not true, the site name is stored in the __languages table, too. Jul 12 '17 at 22:15

(Tested in Joomla 3.7.x)

In the Joomla backend:

Extensions -> Languages -> Content -> edit your installed languages -> tab "sitename".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.