I am trying to create a component. I have the following manifest file:
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.4" method="upgrade">
<name>COM_EXAMPLE_TITLE</name>
<libraryname>example</libraryname>
<creationDate>January 2017</creationDate>
<author>inf3rno</author>
<authorEmail>[email protected]</authorEmail>
<license>MIT</license>
<version>0.0.1</version>
<description>COM_EXAMPLE_DESCRIPTION</description>
<scriptfile>installer.php</scriptfile>
<files>
<filename>example.php</filename>
<folder>views</folder>
<folder>src</folder>
<folder>language</folder>
<folder>media</folder>
</files>
<administration>
<menu link="option=com_example">COM_EXAMPLE_TITLE</menu>
<files>
<filename>example.php</filename>
<folder>src</folder>
<folder>language</folder>
<folder>media</folder>
</files>
</administration>
</extension>
In the language folder I have 4 ini files:
- en-GB.com_example.ini
- en-GB.com_example.sys.ini
- hu-HU.com_example.ini
- hu-HU.com_example.sys.ini
and I have the constants COM_EXAMPLE_TITLE
and COM_EXAMPLE_DESCRIPTION
in these files. I don't want to use the MVC classes Joomla provides and I want to reuse the src folder, which contains my classes.
The main problem that Joomla does not replace the constant names with the values, so when I install this component the registered component will be COM_EXAMPLE_TITLE
instead of example
and the name it displays in the admin menu will be com-example-title
instead of e.g. Example Component
or whatever I store in the COM_EXAMPLE_TITLE
constant.
I don't understand why it does not work. I tried out with the <languages>
element too and with en-GB
and hu-HU
subfolders too. Nothing worked, no matter what I changed. I installed Joomla 3.4.3 on localhost, but I have the same version on the production server. On the production server with the <languages>
element I managed to make this work. Is there a configuration option or whatever which turned off the inclusion of these constants? Can this feature be turned off, or something else is going on here?
edit:
I checked my old more or less working code. Is there a chance it never worked properly? I have these multilingual texts in the admin menu and in the site menu, but by install I cannot have for example multilingual extension name and description. Now that is interesting, since this example tells me it is possible. Maybe by the later versions only, I don't know.
I tested further, with the <folder>language</folder>
it works too if the files are in the ln-LN
subfolders, but the package name and description does not work, just the admin menu. The same is on the production server, so this is not a config option, it simply is not supported. Probably the version is too old.