No Code Attached Yet bug
avatar smarta-lab
smarta-lab
1 Nov 2026

What happened?

  1. Install the German language pack and set the administrator language to German (de-DE).
  2. Open a site module of type Menu for editing (Cassiopeia is the default site template).
  3. Open the Advanced tab and look at the Layout field.

Version

6.2

Expected result

The Cassiopeia layout collapse-metismenu is shown as "Dropdown einklappbar"
(TPL_CASSIOPEIA_MOD_MENU_LAYOUT_COLLAPSE-METISMENU in language/de-DE/tpl_cassiopeia.sys.ini).

Actual result

It is shown as "Collapsible Dropdown", the en-GB string. The same happens for every
layout name that a template translates in its .sys.ini.

System Information

Joomla 6.2.0, PHP 8.4. The code involved is unchanged in 6.2-dev, 6.3-dev and
7.0-dev; 5.4-dev has the same logic (without the language fallback chain added in 6.x).

Additional Comments

Two calls load tpl_<template>.sys.ini in the same request:

  1. The position field translates the position names via
    ModulesHelper::getTranslatedModulePosition()
    (administrator/components/com_modules/src/Helper/ModulesHelper.php). It loads
    the file in the current language with $default = false, so the en-GB file is
    not loaded:

    $lang->load('tpl_' . $template . '.sys', $path, null, false, false)
  2. Later, ModulelayoutField (libraries/src/Form/Field/ModulelayoutField.php)
    loads the same file with $default = true:

    $lang->load('tpl_' . $template->element . '.sys', $client->path)

    Language::load() first loads the en-GB file, which has not been loaded yet;
    array_replace() in loadLanguage() overwrites the German strings. The de-DE
    file is then skipped because it is already in $this->paths, so the English
    strings remain.

Minimal reproduction without the backend (run from the Joomla root):

<?php
define('_JEXEC', 1);
define('JPATH_BASE', __DIR__ . '/administrator');
require JPATH_BASE . '/includes/defines.php';
require JPATH_BASE . '/includes/framework.php';

use Joomla\CMS\Language\Language;

$key  = 'TPL_CASSIOPEIA_MOD_MENU_LAYOUT_COLLAPSE-METISMENU';
$lang = new Language('de-DE');

$lang->load('tpl_cassiopeia.sys', JPATH_SITE, null, false, false); // ModulesHelper
echo $lang->_($key), "\n";                                          // Dropdown einklappbar

$lang->load('tpl_cassiopeia.sys', JPATH_SITE);                      // ModulelayoutField
echo $lang->_($key), "\n";                                          // Collapsible Dropdown

Possible fixes: load the file with $default = true in ModulesHelper (as the
other callers do), or make Language::load() re-apply the requested language
after it has loaded the default language for an already loaded file.

avatar smarta-lab smarta-lab - open - 1 Nov 2026
avatar smarta-lab smarta-lab - change - 1 Nov 2026
Labels Added: bug
avatar smarta-lab smarta-lab - labeled - 1 Nov 2026
avatar joomla-cms-bot joomla-cms-bot - change - 1 Nov 2026
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 1 Nov 2026
avatar brianteeman
brianteeman - comment - 1 Nov 2026

See #36984

avatar brianteeman
brianteeman - comment - 1 Nov 2026

See #36984

avatar brianteeman
brianteeman - comment - 1 Nov 2026

See #36954

avatar smarta-lab
smarta-lab - comment - 1 Nov 2026

Thanks, but I think #36954 addresses a different problem: it is about module titles stored in English in #__modules at installation (#35587). This issue is about the option names in the Layout field, which come from the template's .sys.ini and are translated correctly on the first load, but overwritten with en-GB at runtime when ModulelayoutField loads the file a second time (see the analysis and the reproduction script above). #36954 does not touch Language, ModulesHelper or ModulelayoutField, so the layout names would still be shown in English with that PR applied.

avatar brianteeman
brianteeman - comment - 3 Nov 2026

yes sorry I misunderstood your report as being for something completely different

Add a Comment

Login with GitHub to post a comment