I followed the alternative method outlined in the wiki to build a bilingual web site. Everything seems to be working ok, but I am having problems switching between the languages.
I am using the recommended JS method to switch.
< script type="text/JavaScript">
<!--
function switchLanguage(lang) {
u = location.href.split('/');
u[3] = lang;
location.href = u.join('/');
}
//-->
< /script><a href="/en/" title="English">EN</a> |
<a href="/fr/" title="Français">FR</a>{I deleted the o from nclick to make sure that the code would disply in the forum}
When I click on the link trying to switch, the /index.php does not get added to my url. I tried adding the index.php in the line ‘switchLanguage(‘fr/index.php’} which works on the first click but when i switch language again, the index.php gets appended behind my url again.
I dont know JS so I was hoping that someone could let me know what to add to the code to make it switch between languages and also use the index.php.
Hi,
I’m making a multi language site right now…. I just tried the intial way, it’s worrking OK.
Can you tell me what you like better about the php method? What trouble were you running into w/ the other one? Was it about switching langauges?
Trying to avoid trouble down the line w/ the global variable/include method that I’ve chosen….
Thanks,
Phoebe
the js method didnt work right for me as far as switching between the languages goes. I used the php method before with some code that I found on the forums some time ago. I am using that code rather than the code listed in the wiki. Not sure what it does different but it works well for me.
the one issue I have is with the breadcrumb navigation. It’s really difficult to build a working breadcrumb with bilingual site as I cant really use url segments (ex segment_1 etc) to display the breadcrumbs.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.