J4 Issue ?
avatar Ninja-007
Ninja-007
20 Jan 2019

What needs to be fixed

Template language file does not get loaded.

The file is present in administrator\templates\atum\language\en-GB\en-GB.tpl_atum.ini
J4 searches in /administrator/language/en-GB/en-GB.tpl_atum.ini

Build: 20 Jan nightly build

Why this should be fixed

How would you fix it

Add the language file copy code.

Side Effects expected

avatar Ninja-007 Ninja-007 - open - 20 Jan 2019
avatar joomla-cms-bot joomla-cms-bot - change - 20 Jan 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 Jan 2019
avatar ReLater
ReLater - comment - 20 Jan 2019

Maybe related? #23489

avatar Ninja-007 Ninja-007 - change - 21 Jan 2019
Title
J4 Template language file does not get loaded/missing
J4 admin Template language file does not get loaded/missing
avatar Ninja-007 Ninja-007 - edited - 21 Jan 2019
avatar Ninja-007
Ninja-007 - comment - 21 Jan 2019

Thanks @ReLater The issue is about frontend.
My raised issue is about admin template.

avatar ReLater
ReLater - comment - 21 Jan 2019

Maybe I misunderstand your description.

The priority of language files is the same in backend. First search in administrator/language/. Only if file not found then search in template folder.

Did you delete the files in administrator/language/ ? If yes and the language files from template folder are not loaded then that's a bug.

avatar Ninja-007
Ninja-007 - comment - 21 Jan 2019

I did not delete any language file.

avatar infograf768
infograf768 - comment - 21 Jan 2019

it works fine on dev branch. please set debug language on in global config. Post here a screenshot of the loaded language files from debug

avatar Ninja-007
Ninja-007 - comment - 21 Jan 2019

unable-to-load-template-lang-file

avatar brianteeman
brianteeman - comment - 21 Jan 2019

There is something wrong with your install. There is nothing that should be loading fof30. Probably explains your other issues as well

avatar Ninja-007
Ninja-007 - comment - 21 Jan 2019

fof30 comes from akeeba backup, I believe.

avatar infograf768
infograf768 - comment - 21 Jan 2019

In any case, the atum language file IS loaded from atum language folder and everything looks translated at looking at your screenshot.
Can you close the issue?

avatar Ninja-007
Ninja-007 - comment - 21 Jan 2019

Let me reinstall J4 from fresh build and verifiy the issue. Hopefully, it will be resolved.

avatar Ninja-007
Ninja-007 - comment - 21 Jan 2019

This is fresh install of today nightly build.

  • Just installed
  • Enabled debug
  • Took screenshot

Am I only facing the problem?

unable-to-load-template-lang-file-21-jan-build

avatar mbabker
mbabker - comment - 21 Jan 2019

What is the issue you are aiming to address?

The core lookup pattern is to search in /administrator/language for a language file, then the extension if a file is not found in the administrator/language directory (so in this case, /administrator/templates/atum/language). So you will always have a missing file in that list for any extension which does not place their files in the /administrator/language or /language directories. Callers to $language->load() aren't checking if a file exists first, the Language API is doing that check.

If you're attempting to report that the Atum language files do not exist in the administrator/language directory, then you are correct that is an inconsistency in the current code base.

avatar Ninja-007
Ninja-007 - comment - 21 Jan 2019

Well if the template language file is only supposed to be in /administrator/template/atum/language folder then it is not an issue.
My understanding is /administrator/template/atum/language fallback path and /administrator/language primary path. As J4 has one admin template, may it will be better if we place the language file in /administrator/language path or stop searching there.

avatar Ninja-007
Ninja-007 - comment - 21 Jan 2019

If the inconsistency is acceptable and by design then you may close the issue.

avatar mbabker
mbabker - comment - 21 Jan 2019

As J4 has one admin template, may it will be better if we place the language file in /administrator/language path or stop searching there.

The core behavior for all extensions is to first search the application's global language directory /administrator/language for the admin app, /language for the site app, /installation/language for the install app if it were to ever support the notion of extensions) then to search in the extension for a language directory (so /templates/<foo>/language for a frontend template, /administrator/components/<foo>/language for a backend component). The first search is ALWAYS performed and the second search is ONLY performed if the first search does not find a file to be processed.

So, for any extension (not just those in the core package) which does NOT place their language files in the global language directory, there will always be a line like the one you are highlighting. That is the system design.

avatar infograf768
infograf768 - comment - 21 Jan 2019

The lang files, for core templates, should be in both places.
In core folders as they have to be translated and present in the TTs lang packs. And also in the templates language folder as the templates can be copied and the code needs the lang files there.

avatar ReLater
ReLater - comment - 21 Jan 2019

So we're landing here: #23493 (comment)

and this issue is one because the files are missing.

As long as it will not become a must to use the core language folder in custom templates and copying them will still function as usual I can live with any solution ;-)

avatar infograf768
infograf768 - comment - 22 Jan 2019

@ReLater

@Bakual and myself looked at the way template copy works. We found that it is the the template folder as a whole which is copied, and then some modifications for some files ($newName).

Nowhere during that copy are language files copied separately, which means we can't have a conditional which would look first in a place (the template folder) and then in the corresponding core folder.

Code is here:
https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_templates/Model/TemplateModel.php#L732

This means we need to patch the model code in order to also look in the core folder IF no language files are found in the template/language/ folder and if it is the case, copy the files found to the copied template/language/ temp folder before returning fixTemplateName

avatar joomla-cms-bot joomla-cms-bot - edited - 4 Mar 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Mar 2019
Title
J4 admin Template language file does not get loaded/missing
[4.0] admin Template language file does not get loaded/missing
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 28 Mar 2019
Category com_languages Templates (admin)
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Apr 2019
Labels Added: J4 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 4 Apr 2019
avatar brianteeman
brianteeman - comment - 8 Jun 2019

This should be closed as the reported issue is not a bug but by design. All the off topic comments should be continued in #23493

avatar Quy Quy - change - 8 Jun 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-06-08 22:05:53
Closed_By Quy
avatar joomla-cms-bot joomla-cms-bot - change - 8 Jun 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-06-08 22:05:53
Closed_By joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 8 Jun 2019
avatar joomla-cms-bot
joomla-cms-bot - comment - 8 Jun 2019

Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/23601

Add a Comment

Login with GitHub to post a comment