Bi-lingual site and PHP to call equivalent page in second language
Hi
My website will need to be bi-lingual (French and English) and I'd like to use the same language button on all my pages. The English button would have the text "Français" and the French pages would have the same button with the text "English".
How would I trigger a php script to call the equivalent page in the other language? I'm going to use another directory and another xar website file to handle the second language. I guess I'll need a lookup table to handle the name translation. For example, a page called "links.html" in English would be "liens.html" in French. It would also be nice to have a global php variable called $language that would be = "EN" or "FR" so that I could simplify the logic.
Will this be possible or worth it to do this in Xara or will I just need to have separate buttons with hard-coded links on every page in both sites?
Thanks again
Elliot
1 Attachment(s)
Re: Bi-lingual site and PHP to call equivalent page in second language
I don't think you need a special script Elliot
Create your two sites as two separate Xara documents. Publish the primary site to your server.
On the server create a new folder, for example Français. Publish your French version to this sub-folder as if it is the primary site--index.htm page, index_html_files folder etc. In the publish settings, add this sub folder along with any specific sub-folder your web host requires. For example if you publish your files to a subfolder called public_html, then add a slash and the sub folder public_html/French
Use the actual physical link for both versions. If your site is mysite.com and the English version is in the root directory of the server, then this is the link for the English version. Link the French version to the folder, for example mysite.com/French
Does this make sense?
Re: Bi-lingual site and PHP to call equivalent page in second language
Hi gw,
I'm probably being blind as usual :) but I don't understand how this will help me. I do plan to publish my French site to a different sub folder on the server. However how is this going to solve the linking problem of going from a particular page on the English site to the corresponding page with a different name on the French site?
Using the same example a before, I'm on mysite.com/links.htm and I need to get to mysite.com/french/liens.htm. How to do it without putting in a different link for each language button on each page?
Thanks :confused:
Re: Bi-lingual site and PHP to call equivalent page in second language
Quote:
will I just need to have separate buttons with hard-coded links on every page in both sites?
This would be the simplest solution. The alternative will need a script and database and both will need to be maintained by hand.
Re: Bi-lingual site and PHP to call equivalent page in second language