Closed cappuccinonet closed 7 months ago
All language files within the element should be copied to the /api/language folder.
Not really. It was like that long time ago.
Nowaday all language files should be within component:
for Site components/com_example/language
,
for API api/components/com_example/language
,
for Administrator administrator/components/com_example/language
,
Same for Plugins and Modules
@Fedik sorry that is not correct
@cappuccinonet Could you post the content of the manifest XML of that component?
@richard67 Just fixed the markup to show up the code. Before opening this thread I posted the question on Stackexchange
Where in the zip file of the package are the language files located? Reading this answer on Stackexchange I would assume they are located inside the "api" folder in the zip, not in a subfolder of that. Or do you have them inside folder "api/language" in the zip, and the "api" folder is at the first level inside the zip? Then your XML should be:
<api>
<files folder="api">
<folder>src</folder>
</files>
<languages folder="api/language">
<language tag="en-GB">language/en-GB/com_mycomponent.ini</language>
<language tag="en-GB">language/en-GB/com_mycomponent.sys.ini</language>
</languages>
</api>
Not sure if that will work, but that's how I understand that answer on Stackexchange.
They are located here:
<extension>
...
<namespace path="src">MyCompany\Component\MyExtension</namespace>
...
<administration>
<files folder="admin">
...
</files>
<languages folder="admin">
<language tag="en-GB">language/en-GB/com_mycomponent.ini</language>
<language tag="en-GB">language/en-GB/com_mycomponent.sys.ini</language>
</languages>
<administration>
...
<api>
<files folder="api">
<folder>src</folder>
</files>
<languages folder="api/language">
<language tag="en-GB">language/en-GB/com_mycomponent.ini</language>
<language tag="en-GB">language/en-GB/com_mycomponent.sys.ini</language>
</languages>
</api>
...
</extension>
```<hr /><sub>This comment was created with the <a href="https://github.com/joomla/jissues">J!Tracker Application</a> at <a href="https://issues.joomla.org/tracker/joomla-cms/41944">issues.joomla.org/tracker/joomla-cms/41944</a>.</sub>
The files itself are located inside the zip like this:
/admin/language/en-GB
/api/language/en-GB
<languages folder="api/language">
<language tag="en-GB">en-GB/com_mycomponent.ini</language>
<language tag="en-GB">en-GB/com_mycomponent.sys.ini</language>
</languages>
@brianteeman I tried that too, but it failed to work.
Fedik sorry that is not correct
I mean, it what is prefered. You just place your language under component, and all works:
<administration>
<files folder="admin">
<folder>language</folder>
...
</files>
<administration>
<api>
<files folder="api">
<folder>language</folder>
...
</files>
</api>
<files folder="site">
<folder>language</folder>
...
</files>
There was a discussion here some years ago, but it will be hard to find. No practical reasons to place extension language files globally.
I tried that too, but it failed to work.
What @brianteeman suggested should work, maybe one of paths is incorect, you also can try other way around:
<api>
<files folder="api">
<folder>src</folder>
</files>
<languages folder="api">
<language tag="en-GB">language/en-GB/com_mycomponent.ini</language>
<language tag="en-GB">language/en-GB/com_mycomponent.sys.ini</language>
</languages>
</api>
But I would suggest to try what I wrote in previous comment, it much more clean and easy.
@cappuccinonet Could you please test #43152?
Closing as having a pull request. Please test #43152 . Thanks in advance.
Steps to reproduce the issue
When programming a component for an API in Joomla 4, the config contains the following language file definitions:
The component installs without errors, but the language files in the folder /api/language/en-GB/* of the component aren't copied to the folder /api/language/en-GB/ as described here https://www.dionysopoulos.me/book/com-lang.html.
When I copy the language files manually, they are interpreted correctly. Languages other than en-GB do not seem to work.
Expected result
All language files within the element should be copied to the /api/language folder.
Actual result
System information (as much as possible)
Joomla 4.3.4
Additional comments