Advertisement

[solved]Administration menu items translations

Need help with the Administration of your Joomla! 1.5 site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
Muuurgh
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Thu Jun 11, 2009 1:24 pm

[solved]Administration menu items translations

Post by Muuurgh » Tue Jul 13, 2010 5:13 pm

Several hours later, I have the solution. It's at the bottom of the post.

-----

Hi All

I'm upgrading my component Menu Module Clone to Joomla! 1.6, and I've run into the same problem I bypassed with 1.5. Namely, providing translation of menu items. I want to have 3 menus in the components menu, the parent, instructions and menu compare. And I also want these to change depending on the language of the site, so I've put the names I want in the language file (currently only en-GB).

When I install, it doesn't pick them up, it becomes commenumoduleclonetitle instead of the language string COM_MENUMODULECLONE_TITLE. Even the standard string is being lower cased and spaces removed, so something odd is going on.

I've copied how to do it from phocafavicon, which is Joomla 1.6 ready and their menus translate (in Beta 5 anyway). I'm obviously missing something, but what is it??? I spent several hours on the previous version not getting this to work, and now I'm having the same problem after copying an example that works. My Googling has turned up nothing, so I'm asking the question in the hope that someone can give me an idea of what I'm doing wrong.

I'm working on a Mac, developing in Eclipse Helios and I'm using CleanArchiver to zip the files up. Any suggestions gratefully received.

Code: Select all

<administration>
        	<languages folder="admin">
            	<language tag="en-GB">language/en-GB/en-GB.com_menumoduleclone.ini</language>
            	<language tag="en-GB">language/en-GB/en-GB.com_menumoduleclone.sys.ini</language>
            </languages>      
               
            <!-- Administration Menu Section -->
            <menu img="components/com_phocafavicon/assets/images/icon-16-pf-menu.png" link="option=com_menumoduleclone">COM_MENUMODULECLONE_TITLE</menu>
            <submenu>
            	<menu link="option=com_menumoduleclone" img="class:content"	alt="Menu Module Clone/Instructions">COM_MENUMODULECLONE_VIEW_INSTRUCTIONS_MENU_TITLE</menu>
				<menu link="option=com_menumoduleclone&view=compare_menus" view="compare_menus" img="class:menu" alt="Menu Module Clone/Compare Menus">Compare Menus</menu>
            </submenu>
Ben


---

In 1.6 (Beta 5 at least), it is the alt attribute that determines the language. It's a 4 step process to find the required translation, based on my testing.
1) Check for an alt attribute in the menu tag. If none found, go to step 4.
2) It goes to the .sys.ini language file, and looks for a match for the language string provided in the alt attribute with a key in the file. If one is found, that's the translation.
3) If it can't find one that matches the alt attribute, it then takes the name of the component (com_menumoduleclone), appends the view to it, and searches for that key (i.e. for the view menucompare it looks for the key COM_MENUMODULECLONE_MENUCOMPARE).
4) If it can't find any of them, it uses the menu value, lowercased and with spaces removed.

I think that's right anyway. Hope that helps somebody else, as I've spent a lot of hours figuring that out. Here's the current XML.

Code: Select all

<menu img="class:component" link="option=com_menumoduleclone">Menu Module Clone</menu>
           	<submenu>
           		<menu view="instructions" alt="COM_MENUMODULECLONE_INSTRUCTIONS" img="class:content">Instructions</menu>
           		<menu view="comparemenus" alt="COM_MENUMODULECLONE_COMPAREMENUS" img="class:menu">Compare Menus</menu>
           	</submenu>

Advertisement
Advertisement
Locked

Return to “Administration 1.5”