Jump to content


Photo

How to retrieve ModuleSingularLabel in multilevel Menu

translation multilevel Menu

  • Please log in to reply
8 replies to this topic

#1 k1000o

k1000o

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts
  • LocationMadrid

Posted 30 November 2011 - 08:27 PM

1. I created two modules (Sizes and Colors) with no menu definition

public static function getDefaultMetadata()
{
	$metadata = array();
	$metadata['global'] = array(
		'tabMenuItems' => array(
			)
.......

2. Create a third module called Libraries who's only function (for the moment) is to build the menu to group the libraries.

.........
'tabMenuItems' => array(
	array(
			'label' => 'Libraries',
			'right' => self::RIGHT_ACCESS_COLORS,
			'items' => array(
				array(
					'label' => 'Color Management',
					'right' => self::RIGHT_CREATE_COLORS,
					'items' => array(
						array(
							'label' => 'Create ColorsModuleSingularLabel',
							'url'   => array('/colors/default/create'),
							'right' => self::RIGHT_CREATE_COLORS,
						),
						array(
							'label' => 'ColorsModulePluralLabel',
							'url'   => array('/colors/default'),
							'right' => self::RIGHT_ACCESS_COLORS
						),),),
				 array(
					'label' => 'Sizes Management',
					'right' => self::RIGHT_CREATE_SIZES,
					'items' => array(
						array(
							'label' => 'Create SizesModuleSingularLabel',
							'url'   => array('/sizes/default/create'),
							'right' => self::RIGHT_CREATE_SIZES,
						),
						array(
							'label' => 'SizesModulePluralLabel',
							'url'   => array('/sizes/default'),
							'right' => self::RIGHT_ACCESS_SIZES
						),),),),),),
.....

3. The result is as expected I got the following menu but with no translations, any idea on how to fix it? It is not due to the lack of messages/es as you can see the image below even working in English the plurals are not retrieved.
ZurmoSubMenu.png

4. If the code in the colors module is modified so it has his own menu the color local menu works fine.
ZurmoSubMenu2.png

Attached Thumbnails

  • ZurmoSubMenu.png
  • ZurmoSubMenu2.png


#2 Jason

Jason

    Administrator

  • Administrators
  • 864 posts
  • LocationChicago

Posted 30 November 2011 - 08:44 PM

What module's message folder did you put ''Create SizesModuleSingularLabel' in? Libraries or Sizes?

Jason Green
Zurmo Team
Need support? Upgrade now


#3 k1000o

k1000o

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts
  • LocationMadrid

Posted 30 November 2011 - 09:18 PM

In the Libraries module, in the class LibrariesModule

#4 Jason

Jason

    Administrator

  • Administrators
  • 864 posts
  • LocationChicago

Posted 01 December 2011 - 03:48 AM

You should try to clear the cache by adding &clearCache=1 into the URL of any page you go to. Also did you check it into your repository? I could take a peek and see what is wrong.

Jason Green
Zurmo Team
Need support? Upgrade now


#5 k1000o

k1000o

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts
  • LocationMadrid

Posted 01 December 2011 - 04:44 AM

The cache has no effect. Yes I committed into the repository.

#6 Jason

Jason

    Administrator

  • Administrators
  • 864 posts
  • LocationChicago

Posted 01 December 2011 - 04:25 PM

i looked here:
https://bitbucket.or.../es/Default.php

I don't see the Create SizesModuleSingularLabel defined. Did you put it somewhere else?

Jason Green
Zurmo Team
Need support? Upgrade now


#7 k1000o

k1000o

    Advanced Member

  • Members
  • PipPipPip
  • 112 posts
  • LocationMadrid

Posted 01 December 2011 - 05:12 PM

Sorry forgot to push, now it's up to date. (still not working)
But remember I am working in English for the moment.

#8 Jason

Jason

    Administrator

  • Administrators
  • 864 posts
  • LocationChicago

Posted 01 December 2011 - 06:55 PM

I am going to clone the repo and see if i can figure out what is going on.

Jason Green
Zurmo Team
Need support? Upgrade now


#9 Jason

Jason

    Administrator

  • Administrators
  • 864 posts
  • LocationChicago

Posted 01 December 2011 - 07:16 PM

I now see what is wrong. I need to add translation recursively for menu items, currently the translation is only one level deep. I will do that in the main branch and let you know when it is completed so you can pull.

Also make sure you name LibrariesModule with a capital L, i see your file is a lower case l.

Additionally, where you have 'Sizes Management' should be 'SizesModulePluralLabel Management'. This will then ensure it works properly for translation and if you happen to change the name of the module via the designer tool.

Jason Green
Zurmo Team
Need support? Upgrade now






Also tagged with one or more of these keywords: translation, multilevel, Menu

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users