multiligual menu

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
yuvallb
Beginner
Beginner
Posts: 2
Joined: Thu Dec 07, 2006 2:03 pm

multiligual menu

Post by yuvallb »

Hi,
I want to do a multilingual menu, where the menu is displayed in english,
and whene you rollover a menu item it displayes in spanish.
Is that possible with milonic???
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Yes you can do something like that. But if you are asking if the menu on its own can be told to translate something to Spanish on mouseover, no that's not possible. Well, it's probably possible if you could write a function which had all the English words in it and designed it so that the function said, when mouseover of Hello, change text to Hola and so on for every item.

However, for what you want, it's pretty easy to do. There is a function called mm_swapText which you can use. Just as an example, your aI string would be something like this [you'd use your own text, of course]

Code: Select all

aI("text=Welcome to my house;align=center;onfunction=mm_onText('Bienvenidos a mi casa');offfunction=mm_offText();itemwidth=200;");
There is a demo for this explaining how to set it up here

http://support.milonic.com/demos/swap_text/index.htm

Your other option would be to use tooltips, this would not change the text but instead would popup whatever tooltip you had created when the person moused over the item. So, the text would be the same but a tooltip with whatever Spanish you wanted would popup onmouseover.


To get tooltips to work you need the tooltip module from the bolt on modules page. There is also a link there to the tooltips menusample, the module is about the middle of the page.

http://milonic.com/menumodules.php
yuvallb
Beginner
Beginner
Posts: 2
Joined: Thu Dec 07, 2006 2:03 pm

Post by yuvallb »

thanks!
thats exactly what i was looking for!
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Hi,

Just for the record here is a multi country menu that we are working on:



Code: Select all

fixMozillaZIndex=true; //Fixes Z-Index problem  with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps
_menuCloseDelay=500;
_menuOpenDelay=150;
_subOffsetTop=2;
_subOffsetLeft=-2;


with(menuStyle=new mm_style()){
bordercolor="#999999";
borderstyle="solid";
borderwidth=1;
fontfamily="Verdana, Tahoma, Arial";
offbgcolor="#eeeeee";
offcolor="#000000";
onbgcolor="#ddffdd";
oncolor="#000099";
padding=4;
separatorsize=1;
subimage="arrow.gif";
}


current_menu_country="Spanish"; // This is the current country you want to display results for - this needs to change based on the users country
menu_countries=[// List of the different countries you want to provide for "must be in the same order"
,"English"
,"French"
,"German"
,"Spanish"
,"Italian"
]; 


function _cValue(){ //parameter must match menu_countries[] above, for example: valueByCountry("English","French","German","Spanish","Italian");
v=arguments;var mc,ma;mc=0;ma=new Array(v);for(var a=1;a<menu_countries.length;a++)if(current_menu_country==menu_countries[a])return v[a-1];return v[0];
}

with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
style=menuStyle;
aI("text="+_cValue("No","Non","Nein","No","No")+";url=http://milonic.com/;");
aI("text="+_cValue("Yes","Oui","Ja","sí","sí")+";url=http://milonic.com/;");
aI("text="+_cValue("Hello","Bonjour","Hallo","Hola","Ciao")+";url=http://milonic.com/;");
aI("text="+_cValue("Good Bye","Au revoir","Auf Wiedersehen","Adiós","Arrivederci")+";url=http://milonic.com/;");
aI("text="+_cValue("Link By Country","Lien Pour Le Pays","Verbindung Für Land","Acoplamiento Para El País","Collegamento Per Il Paese")+";url="+_cValue("/index.php?c=English","/index.php?c=French","/index.php?c=German","/index.php?c=Spanish","/index.php?c=Italian")+";");
}

drawMenus();


Hope this helps,
Andy
Post Reply