PHP Joomla! 6 Joomla! 5 Joomla! 3 (Legacy) Template Basic

List All Published Content Languages with LanguageHelper

Returns active content languages (lang_code, sef, title_native) to build custom switchers or hreflang markup.

Updated on 24 November 2026 24 copies 99 views
templates/seu_template/html/mod_languages/default.php
<?php

declare(strict_types=1);

use Joomla\CMS\Language\LanguageHelper;

$languages = LanguageHelper::getContentLanguages([1], true, null, 'ordering', 'asc');

foreach ($languages as $lang) {
    echo strtoupper($lang->sef) . ' (' . $lang->lang_code . '): ' . $lang->title_native . "\n";
}
Returns objects keyed by lang_code with sef and title_native fields.
templates/seu_template/html/mod_languages/default.php
<?php
$languages = JLanguageHelper::getLanguages('lang_code');
Legacy Joomla 3 version using JLanguageHelper::getLanguages().

Technical explanation and best practices

LanguageHelper::getContentLanguages() returns all published Joomla Content Languages in configured order, exposing each language tag, SEF prefix and native title.

Direct Engineering

Have a Joomla project or technical challenge in mind?

From architectural diagnosis to production deployment, directly with the engineer.