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
Add the language file copy code.
Labels |
Added:
?
|
Title |
|
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.
I did not delete any language file.
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
There is something wrong with your install. There is nothing that should be loading fof30. Probably explains your other issues as well
fof30 comes from akeeba backup, I believe.
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?
Let me reinstall J4 from fresh build and verifiy the issue. Hopefully, it will be resolved.
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.
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.
If the inconsistency is acceptable and by design then you may close the issue.
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.
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.
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 ;-)
@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
Title |
|
||||||
Status | New | ⇒ | Discussion |
Category | ⇒ | com_languages Templates (admin) |
Labels |
Added:
J4 Issue
|
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-06-08 22:05:53 |
Closed_By | ⇒ | Quy |
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-06-08 22:05:53 |
Closed_By | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/23601
Maybe related? #23489