Connecting Java Menu and language file?

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Connecting Java Menu and language file?
MrFluffy
CZ Newbie
germany.gif
Age: 57
Gender: Male
Website:
Status: Offline
Joined: Oct 21, 2003
0.00 posts per day
Posts: 4
Points: 402
   ICQ Number
Hi,

i put a java menu to my page and it worked out quiet well.
Unfortunately i am totally unable to get language variables in the .js file to support my bilingual site.

I'm calling the scripts in includes/my_header.php and the menu is read from a file called custom.js, entries looking like this:

addMainItem("forums.html","Forum",145,"center","","Zu den Foren",0,0,"");
   
   defineSubmenuProperties(150,"left","left",0,0);
   
   addSubmenuItem("forum-cat1.html","Allgemeines","","");
   addSubmenuItem("forum-cat2.html","Technik","","");
   addSubmenuItem("forum-cat3.html","Links & Fun","","");


Could anybody give me a hint how i could solve that?

Thanks a lot...



_________________
cu,
MrFluffy icon_wink.gif
Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
Have you tried setting up language definations in the js file? Maybe add a small section at the top with your language definitions.



<?php

// Some language for the menu
define("_ALLGEMEINES","Allgemeines");
define("_TECHNIK","Technik");
define("_LINKSFUN","Links & Fun");

?>

then the rest of the js file here..........

addMainItem("forums.html","Forum",145,"center","","Zu den Foren",0,0,"");
   
   defineSubmenuProperties(150,"left","left",0,0);
   
   addSubmenuItem("forum-cat1.html",""._ALLGEMEINES."","","");
   addSubmenuItem("forum-cat2.html",""._TECHNIK."","","");
   addSubmenuItem("forum-cat3.html",""._LINKSFUN."","","");



Or just moving the defanitions into the lang files.

Telli



_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   
MrFluffy
CZ Newbie
germany.gif
Age: 57
Gender: Male
Website:
Status: Offline
Joined: Oct 21, 2003
0.00 posts per day
Posts: 4
Points: 402
   ICQ Number
Thanks.

I thought about that , too. But however i store the different language strings, i still need to branch the code at my_header-level...
Simplest would be i think to have a german (default) custom.js and an english custom_en.js.
But i can't find a variable to use in the my_header file, $language and $currentlang are empty at that point. I thought about reading the cookie, but then i will have the same issue with the username i guess.




_________________
cu,
MrFluffy icon_wink.gif
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum