No Code Attached Yet
avatar brianteeman
brianteeman
5 Dec 2021

Shouldnt the child template either copy the parent language files or use the language files of the parent? Currently neither happens.

image
image

It does however appear to fall back to the parent language file for the template styles

image

avatar brianteeman brianteeman - open - 5 Dec 2021
avatar joomla-cms-bot joomla-cms-bot - change - 5 Dec 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 5 Dec 2021
avatar dgrammatiko
dgrammatiko - comment - 5 Dec 2021

@brianteeman the code is loading the parent language file (unless you override them locally in the child), what I mean is that they should follow the general inheritance model of all the other files. The code that deals with it is (per model):

// Load the core and/or local language file(s).
$lang->load('tpl_' . $template, $client->path)
|| (!empty($data->parent) && $lang->load('tpl_' . $data->parent, $client->path))
|| (!empty($data->parent) && $lang->load('tpl_' . $data->parent, $client->path . '/templates/' . $data->parent))
|| $lang->load('tpl_' . $template, $client->path . '/templates/' . $template);

What's the URL for this screenshot?

avatar brianteeman
brianteeman - comment - 5 Dec 2021

First screenshot is from the template code view. The second is from the template style view

avatar dgrammatiko
dgrammatiko - comment - 5 Dec 2021

Ok, so,

// Load the core and/or local language file(s).
$lang->load('tpl_' . $template->element, $client->path) ||
$lang->load('tpl_' . $template->element, $client->path . '/templates/' . $template->element);

should be

$lang->load('tpl_' . $template->element, $client->path)
||	(!empty($template->xmldata->parent) && $lang->load('tpl_' . $template->xmldata->parent, $client->path))
||	$lang->load('tpl_' . $template->element, $client->path . '/templates/' . $template->element)
||	(!empty($template->xmldata->parent) && $lang->load('tpl_' . $template->xmldata->parent, $client->path . '/templates/' . $template->xmldata->parent));
avatar dgrammatiko
dgrammatiko - comment - 5 Dec 2021

There's a PR: #36219

avatar brianteeman brianteeman - change - 5 Dec 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-12-05 17:09:32
Closed_By brianteeman
avatar brianteeman brianteeman - close - 5 Dec 2021

Add a Comment

Login with GitHub to post a comment