Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small language change in manifest #4

Open
shoulders opened this issue Oct 18, 2020 · 3 comments
Open

small language change in manifest #4

shoulders opened this issue Oct 18, 2020 · 3 comments

Comments

@shoulders
Copy link

@ceford I see you just made a change to the xml

p.s. I hope this is not too long.

<menu img="class:default" link="option=com_mywalks">com_mywalks</menu>

I think com_mywalks should be COM_MYWALKS or you can use COM_MYWALKS_MENU if you add the translation.

I have am just getting into building a new Joomla component again but I have looked into the installer quite a lot. If you look at my XML example (still making changes) I have tried to add all the features it does and especially add the translations where possible. Also the <element> tag is referenced on the manfiest page.

For this particular issue if you look a the top of my you will see

<name>com_qwhelloworld</name><!-- Translating this is optional -->
<element>com_qwhelloworld</element><!-- This is not really needed, but overides component destination -->

I am toying with the idea of changing it to the following format, but I need to experiment because Component <name> fields are not properly translated

<name>COM_QWHELLOWORLD</name><!-- Translating this is optional -->
<element>com_qwhelloworld</element><!-- This is not really needed, but overides component destination -->

image

image

image

As you can see in the examples above from #__extensions, modules and plugins '<name'> field can be translated with no issue even though lots of people do not bother :( but the components are either in com_mywalks or COM_MYWALKS format.

When the <name> field is used on its own, it is this reference that you will see in the database and not its translation. It does not matter for the JText:: routines if it is lowercase or uppercase, I think this is also used for Joomla to know where to put it (again i need to experiment). When <element> is present Joomla, it uses this to decide where to put the component etc.. and overrides the <name> field for this purpose but it is not used for translation, the <name> field carries that torch. I think this is why there is an <element> field to allow translation seperate from locating the component. The <name> field in modules and plugins are fully translatable because they have a different method of knowing where to install.

<filename module="mod_helloworld">mod_helloworld.php</filename>
<filename plugin="helloworld">helloworld.php</filename>

maybe joomla should add

<filename component="helloworld">helloworld.php</filename>
@shoulders shoulders changed the title small language in manifest small language change in manifest Oct 18, 2020
@shoulders
Copy link
Author

I have raised a issue on Joomla's Github: joomla/joomla-cms#31144

@ceford
Copy link
Owner

ceford commented Oct 19, 2020

Noted all this. I have been using com_banners as a model of how it should be done. Plus, I read somewhere that, by convention, the name field is in lower case.

@shoulders
Copy link
Author

keep an eye out on that Github issue above I posted as I dont think having them all lowercase is actually correct. It is something that has been overlooked because things still work. Basically JTEXT is case insensitive even though you write translatable strings in upper case. This os the reson for the <element> tag that no-one uses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants