If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
automatic translation by user-lang browser recognition  XML
Forum Index » Advanced Guestbook Forum
Author Message
parkiet
Newbie

Joined: 31/01/2007 22:56:05
Messages: 3
Offline

Hallo,
I am busy building a new site that is bilangual. I integrated the Advanced Guestbook. I have used a simple php script that recognizes the browser user language and if this is not Dutch it changes to the English items: if ($userlang=="")
{
$userlang=$HTTP_ACCEPT_LANGUAGE;
$userlang=substr($userlang,0,2);
}
if ($userlang=="nl")
{ } else {}
This works, but I do not know how to have Advanced Guest also changing from Dutch to English automatically in this way. I tried several times in template.class.php, but did not succeed. Perhaps it is the wrong file too. Is there anybody who knows how to do this? Should be nice for other languages also.

Parkiet
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

You would have to put the code in templates.class.php where the language files are selected. Or write a cookie using the lang variable. But remember you are now forcing people to view the guestbook dependant on what their browser says and not what they want.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
parkiet
Newbie

Joined: 31/01/2007 22:56:05
Messages: 3
Offline

Dear Carbonize,

Thank you for your fast answer. Since I have been trying again, but without any success. Concerning your remark forcing visitors to see AVGB in their browser language, I do not understand. Because if I do not make the guesbook bilangual, I am forcing them all to see AVGB in Dutch (which is too difficult for most readers), or in English(, that is not too often understood by the people of my home country). I would be very pleased to hear from you or someone else how to change the script. Otherwise I have to give up. Which I should regret because I really like the AVGB.

Parkiet
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

I write and maintain Lazarus which is a fork of AG. I also get requests for this and here is a link to a solution I came up wit http://carbonize.co.uk/Lazarus/Forum/index.php?topic=296.0

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
parkiet
Newbie

Joined: 31/01/2007 22:56:05
Messages: 3
Offline

Carbonize,

Thanks for your help. I have added the javascript to my guestbook and it works great! Still hoping to find a solution for automatic browser language recognition, but I can do with your solution very well!

Parkiet
 
Forum Index » Advanced Guestbook Forum
Go to:   
Based on the open source JForum