No Code Attached Yet J3 Issue
avatar shoulders
shoulders
18 Oct 2020

Steps to reproduce the issue

Install any component with <name>com_helloworld</name> or <name>COM_HELLOWORLD</name> defined in it's manifest file, which is probably 99.9% of components

Expected result

For the purposes of this issue I will just use COM_HELLOWORLD, the same happens for com_helloworld but this is not the standard for translations.

The <name>COM_HELLOWORLD</name> should be translated using the strings found in the admin/language/en-GB.com_helloworld.sys.ini (or it could be en-GB.com_helloworld.ini). It should also use the Joomla installations default language and then fallback to en-GB as a normal translation.

Actual result

  • In the database table #__extensions, the component's name is stored as COM_HELLOWORLD.
  • For modules and plugins, the <name> string is fully translated and stored in the database correctly,
  • I must admit not everyone fully/correctly translates their module/plugin hence why in the examples below there is a mix of names for modules and plugins, however all of the components are a mix of com_helloworld and COM_HELLOWORLD and never their proper name.

image

image

image

System information (as much as possible)

This is an issue on all versions of Joomla upto and including Joomla 4.

My Test Server Specs just incase.

Setting Value
 
PHP Built On Windows NT E6540 10.0 build 19041 (Windows 10) AMD64
Database Type mysql
Database Version 5.5.5-10.4.10-MariaDB
Database Collation utf8mb4_unicode_ci
Database Connection Collation utf8mb4_general_ci
PHP Version 7.3.12
Web Server Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.3.12
WebServer to PHP Interface apache2handler
Joomla! Version Joomla! 3.9.22 Stable [ Amani ] 6-October-2020 15:00 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0

Additional comments

If in my Joomla component I use the following code, the component will install orrectly and use the <name> tag string for the database column name in the #__extensions table. The <element> tag string is filling into the element column in the same table.

<name>Chickens Walk Among Us</name>
<element>com_mywalks</element>

image

This workaround does not allow for multilanguage translation of this <name> tag but I am guessing it might be the reason for the <element> tag in the manifest which is only for components.

My thoughts

  • The <name> tag in a component's manifest file needs to translatable so COM_HELLOWORLD format can be used to match how plugins and modules translate this tag
  • The tag seems a bit pointess except for the workaround I outlined earlier so support should be removed from joomla manifests.
avatar shoulders shoulders - open - 18 Oct 2020
avatar joomla-cms-bot joomla-cms-bot - change - 18 Oct 2020
Title
<name> in component manifest.xml is not translated
in component manifest.xml is not translated
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 18 Oct 2020
avatar shoulders shoulders - change - 18 Oct 2020
The description was changed
avatar shoulders shoulders - edited - 18 Oct 2020
avatar chmst
chmst - comment - 18 Oct 2020

I don't understand your problem. Component names are translated correctly.
If the name of your component is com_helloworld then the name of the language file is not en-GB.com_qwhelloworld.sys.ini.

avatar shoulders
shoulders - comment - 18 Oct 2020

The names are not correct in the database as shown in the images.

During the install the string COM_HELLOWORLD is not translated before it is stored in the #__extensions table, name column. Hence all component names are in the format COM_HELLOWORLD or com_helloworld

The translation happens correctly for modules and plugins.

Also ignore the typo you noted I will go, and change that now.

avatar shoulders shoulders - change - 18 Oct 2020
The description was changed
avatar shoulders shoulders - edited - 18 Oct 2020
avatar brianteeman
brianteeman - comment - 18 Oct 2020

The names are not correct in the database as shown in the images.

During the install the string COM_HELLOWORLD is not translated before it is stored in the #__extensions table, name column. Hence all component names are in the format COM_HELLOWORLD or com_helloworld

It should NOT be translated in the database. It should only be translated when it is output.

What you are proposing would mean that it will always be stored as a language value and not a language key. Therefore it can not be translated

avatar shoulders
shoulders - comment - 18 Oct 2020

Then why is that happening for modules and plugins? I am on about the name and not element

You can clearly see in the images above this is happening for plugins and modules, it always has. It is just components that this does not work for.

Would you like me to re-upload my example images and add some annotations on them to make it easier to see the issue?

This table might help.

Extention Type <name> String Database name column
module MOD_HELLOWORLD Helloworld
plugin PLG_HELLOWORLD Helloworld
Component COM_HELLOWORLD COM_HELLOWORLD

thanks

avatar brianteeman
brianteeman - comment - 18 Oct 2020

image

avatar shoulders
shoulders - comment - 18 Oct 2020

@brianteeman The image you have sent doesnt really help me. Is it a Joomla dump or a database dump?

If you look at eXtplorer though, you can see it has a translated name field. You will probably find it is using the <element> tag in its manifest. This is assuming this ouput matches the database fields.

If you look at the images I posted you can see Translated and non translated name fields.

avatar shoulders
shoulders - comment - 18 Oct 2020

compare the function storeExtension() in:

They are different in how they handle the storing of the name.

avatar richard67
richard67 - comment - 18 Oct 2020

They are different in how they handle the storing of the name.

The only difference i can see is that the handling of discovery installation happens at different places. But regarding storing the name I see no difference.

avatar shoulders
shoulders - comment - 18 Oct 2020

I am not an expert but:

module

$this->extension->name = $manifest_details['name'];

component

$this->extension->name    = $this->name;

The manifiest has probably already been parsed with the translator code.

avatar richard67
richard67 - comment - 18 Oct 2020
$this->extension->name = $manifest_details['name'];

Is only done for the module when a discover installation.

For normal installations it looks the same as for the component, $this->extension->name = $this->name;.

You should also have a look on the if conditions around the assignment statements.

avatar shoulders
shoulders - comment - 18 Oct 2020

ok, I will find the code and paste it here as long as this issue doesnt get closed becasue no-one thinks this issue exists 😄

avatar richard67
richard67 - comment - 18 Oct 2020

ok, I will find the code and paste it here as long as this issue doesnt get closed becasue no-one thinks this issue exists 😄

Thanks, maybe that could help.

But if the issue exists, then your approach or expectation to save the translated text in database is wrong, as already elaborated. It would never be possible to see the translation changing when changing backend language if we do that.

avatar shoulders
shoulders - comment - 18 Oct 2020

But if the issue exists, then your approach or expectation to save the translated text in database is wrong, as already elaborated.

It already happens, see my images above which no-one seems to look at 😒

It would never be possible to see the translation changing when changing backend language if we do that.

I never said that. It is upon the intial install, that the component's default language translation of COM_HELLOWORLD is used for the name column. No further updates are done to it, i.e. changing the default language in joomla.

I will find where the name is getting parsed in modules/plugins and why this is not happening with components using my trusty debugger.

avatar brianteeman
brianteeman - comment - 18 Oct 2020

I still dont know what the issue that you are trying to resolve is?

avatar shoulders
shoulders - comment - 18 Oct 2020

I am debugging the code to track what I need down. I think it will be easier if I find the code to help explain.

avatar shoulders
shoulders - comment - 18 Oct 2020

I have gone back to my orginal post before everyone was saying they could not see the issue.

A component will only install correctly if the name tag in the manifest is in one of the following formats. It must be the components element name either in lowercase or uppercase, perhaps a mixed version would also work.

<name>com_helloworld</name>
<name>COM_HELLOWORLD</name> 

unless you have the following tag which will overrides the name tag for the purposes of installing. in which case you can change the <name> tag to something else. ie <name>COM_HELLOWORLD_NAME</name>

<element>com_helloworld</element>

If you do not follow the rules above, the component appears to install but the menus are corrupt and they dont work, see below where I changed the name tag to <name>com_chicken</name> when the name of the component is com_qwdemobar. It should also be noted that the extension installed into administrator/components/com_chicken

image

image

Modules and plugins

  • Modules and plugins do not have this limitation so you can use any <name> translation string you want without affecting the installation.
  • Modules and plugins manifest have some extra code in the which I guess handles the element side of things.
<filename module="mod_helloworld">mod_helloworld.php</filename>
<filename plugin="helloworld">helloworld.php</filename>

so maybe joomla should

Use a string similiar to modules and plugins.

<filename component="helloworld">helloworld.php</filename>

So you cannot use any translation string you want in the <name> field unless you have the <element> configured.

The <element> field is only present in a component, so in the <name> tag issue is changed/fixed you could potential remove the need for <element> which no-one seems to use anyway and would bring all of the install types closer together.

I hope I have madew things a little clearer. It certainly helps when you dig into the code.

Thanks JCommunity

avatar brianteeman
brianteeman - comment - 18 Oct 2020

So if I understand correctly you want the core of joomla to be changed so that an extension will install that doesnt follow the documentation??

avatar shoulders
shoulders - comment - 18 Oct 2020

actually what I am asking for is for the documentation to be followed:

see https://docs.joomla.org/Manifest_files

The following elements can be used to insert metadata. None of these elements are required; if they are present, they must be a child of the root element.

Note: The <name> and <description> tags are also translatable fields so that the name and description of the extension can be shown to the user in their native language.

  • In the case of components you must use one of the 2 formats I outlined above for the component to install correctly. This means that the <name> tag does more that represent the translatable name.
  • it is true the strings outlined above can be translated
  • If the code was correct I should be able to use anything I want such as <name>COM_HELLOWORLD_NAME</name>
  • If you use the <element> tag you can then use any translation string you want in the <name> tag. This is not mentioned in the documentation.
  • Modules and plugins do not use the <element> tag, they dont need to and it is component only.
  • all translatable fields in Joomla do not define what the string must be called except in a component manifest.
  • the <name> tag should not be involved in the file installation of the component.

At the very least the <element> tag should be made mandatory and the <name> tag should have nothing to do with the install procedure just like modules and plugins, and the documentation updated to reflect this.

I am sure this would be a small change to the installer code without much repercussion.

avatar jwaisner jwaisner - change - 2 Nov 2020
Title
<name> in component manifest.xml is not translated
in component manifest.xml is not translated
Labels Added: J3 Issue
avatar jwaisner jwaisner - labeled - 2 Nov 2020
avatar brianteeman
brianteeman - comment - 26 Aug 2022

Thank you for raising this issue.

Joomla 3 is now in security only mode with no further bug fixes or new features.

As this issue doesn't relate to Joomla 4 it will now been closed.

If we are mistaken and this does apply to Joomla 4 please open a new issue (and reference this one if you wish) with updated details for testing in Joomla 4.
cc @zero-24

avatar richard67 richard67 - close - 26 Aug 2022
avatar richard67
richard67 - comment - 26 Aug 2022

Closing for the reason stated above.

avatar richard67 richard67 - change - 26 Aug 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-08-26 19:06:50
Closed_By richard67
Labels Added: No Code Attached Yet
Removed: ?

Add a Comment

Login with GitHub to post a comment