Karen Liddy
asked on
PHP Language translation for website
Hi there,
I have a property listing site, i want to be able to change the languages of the site via a button without having to rewrite the whole site again.
Can anyone tell me how this would be done or of any good tutorials for it. I searched google, phpfreaks, etc, but couldn´t find much
Kind regards,
MsKazza
I have a property listing site, i want to be able to change the languages of the site via a button without having to rewrite the whole site again.
Can anyone tell me how this would be done or of any good tutorials for it. I searched google, phpfreaks, etc, but couldn´t find much
Kind regards,
MsKazza
Sometimes the best thing to do is use one that already exists and is well tested.
For example google language tool or babelfish - you can create a link on your pages which passed the UR and desired language to one of these third party sites. These sites then transform the language and display it for the user.
For example google language tool or babelfish - you can create a link on your pages which passed the UR and desired language to one of these third party sites. These sites then transform the language and display it for the user.
take a look here
http://www.portalino.it/nuke/modules.php?name=News&file=article&sid=6591
http://www.developer.com/java/web/article.php/3393841
http://www.codeproject.com/aspnet/localization_websites.asp <<--- ASP.NET, but is pretty much the same
http://www.portalino.it/nuke/modules.php?name=News&file=article&sid=6591
http://www.developer.com/java/web/article.php/3393841
http://www.codeproject.com/aspnet/localization_websites.asp <<--- ASP.NET, but is pretty much the same
ASKER
Thanks for those replies.
I have seen in places (for e.g. ZenCart) when the page references and external txt file that has the translations already done. And the page inserts the translated words or paragraphs depending on the values called on the page.
How could this be done using PHP?
Thanks for the links, but non of them had quite what i was looking for. I want people to be able to add additional languages when and if needed simply by adding the txt file with the translated words, and adding the command on the index page.
The site i'm working on is a property listing site that real estate agents will buy and then go adding modules on to it, including one for language, but i want them to be able to either purchase additional languages or translate them themselves. So it needs to be really easy, hence the external translated file.
Thanks for help
MsKazza
I have seen in places (for e.g. ZenCart) when the page references and external txt file that has the translations already done. And the page inserts the translated words or paragraphs depending on the values called on the page.
How could this be done using PHP?
Thanks for the links, but non of them had quite what i was looking for. I want people to be able to add additional languages when and if needed simply by adding the txt file with the translated words, and adding the command on the index page.
The site i'm working on is a property listing site that real estate agents will buy and then go adding modules on to it, including one for language, but i want them to be able to either purchase additional languages or translate them themselves. So it needs to be really easy, hence the external translated file.
Thanks for help
MsKazza
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you. i think that will be the easiest way to do it, and then just have form to insert the paragraphs into the database when they want to add another language.
one last question. on the index page where i´ll be putting the flag to switch language, i would use this command?
lang=en (english flag)
lang=es (spanish flag)
lang=ge (german flag)
or something along those lines.
thanks
one last question. on the index page where i´ll be putting the flag to switch language, i would use this command?
lang=en (english flag)
lang=es (spanish flag)
lang=ge (german flag)
or something along those lines.
thanks
client side script transition would need to involve javascripts
you would need to have session, query string or parameter to trigger the changes of the languages.
example:
$_GET["lang"] = "en";
if(!empty($_GET["lang"])){
switch($_GET["lang"]){
case "en":
$type = "English words";
break;
case "cn":
$type = "Chinese Words";
break;
}
}
you may check out how "XAMPP" work out from http://www.apachefriends.org/en/xampp.html