Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 08-14-2009, 10:01 AM   #1
Clean_Franck
So Fucking Banned
 
Join Date: Jan 2007
Posts: 399
Automatic translation of pages that recognise IP locations

I am throwing this out there, but is there such a service that translates your web pages automatically for you when a surfer logs on from a different country?

For example the type of thing google has, it recognizes where the user is from throws them to the french site http://www.google.fr and the google page is in French.

Can this type of thing be done or does everything have to be translated manually?
Clean_Franck is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-14-2009, 10:11 AM   #2
mpahlca
Confirmed User
 
mpahlca's Avatar
 
Industry Role:
Join Date: Feb 2004
Location: Vancouver
Posts: 1,821
not sure of a service, but you could do it in php with smarty and lang files using that it would auto transalte on whatever variable you so desired.
__________________
I could give two shits wether you read this sig or not.
mpahlca is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-14-2009, 10:25 AM   #3
acctman
Confirmed User
 
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
but what if an english reading person is traveling overseas or military person is viewing the page outside of the of the country he's from.

i guess it would work for majority of the viewers.
acctman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-14-2009, 10:40 AM   #4
borked
Totally Borked
 
borked's Avatar
 
Industry Role:
Join Date: Feb 2005
Posts: 6,284
IMO you should never present language-localised pages based on IP address, but based on the browser language settings. I'm in France, but I prefer to read English, so I set my browsers to default to En-en.

Web pages should respect my choice and not diss up French pages based on my IP address location.
__________________

For coding work - hit me up on andy // borkedcoder // com
(consider figuring out the email as test #1)



All models are wrong, but some are useful. George E.P. Box. p202
borked is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-14-2009, 10:52 AM   #5
Pete-KT
Workin With The Devil
 
Industry Role:
Join Date: Oct 2004
Location: West Bloomfield, MI
Posts: 51,532
you should never translate by ip, you should translate based on the surfers language setting in there browser
Pete-KT is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-15-2009, 07:51 PM   #6
Clean_Franck
So Fucking Banned
 
Join Date: Jan 2007
Posts: 399
Thanks for the advice regarding browser settings. To clarify however, this can be done automatically and I don't need to go through my pages with a translator having to do each and everyone of them popping them on a new page?

Are there any pages on how to set this up? I would not really know what to look for.
Clean_Franck is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-16-2009, 06:10 AM   #7
Clean_Franck
So Fucking Banned
 
Join Date: Jan 2007
Posts: 399
If someone could quickly help out old franck
Clean_Franck is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-16-2009, 10:23 AM   #8
SmokeyTheBear
►SouthOfHeaven
 
SmokeyTheBear's Avatar
 
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
What i would do is log your visitors languages and get an idea of the top languages , then work on getting some "real" translations for the major ones

make a file called languagelog.txt upload to root , chmod then drop this pgp into your index, this will log the different languages.
Code:
<?php
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
$fh2 = fopen("languagelog.txt", 'a+');
fwrite($fh2, "$lang\n");
fclose($fh2);
?>
it all depends on the type of site you have in how you would implement translation integration.

Could be as simple as a welcome message
if ($lang == "en"){ $welcomemessage = "Welcome to my site";}
if ($lang == "fr"){ $welcomemessage = "Bonjour tete a la merde";}
__________________
hatisblack at yahoo.com
SmokeyTheBear is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-16-2009, 10:36 AM   #9
SmokeyTheBear
►SouthOfHeaven
 
SmokeyTheBear's Avatar
 
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
another idea is just to redirect certain languages to an online translator like babelfish that translates the page you're on
Code:
<?php
$mypage = "www.gfy.com/index.php";
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
if ($lang == "de"){
$url = "http://babelfish.yahoo.com/translate_url?doit=done&tt=url&intl=1&fr=bf-home&trurl=http%3A%2F%2F$mypage&lp=en_$lang&btnTrUrl=Translate";
header("Location: $url");
exit;
}

?>
__________________
hatisblack at yahoo.com

Last edited by SmokeyTheBear; 08-16-2009 at 10:40 AM..
SmokeyTheBear is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-16-2009, 10:39 AM   #10
SmokeyTheBear
►SouthOfHeaven
 
SmokeyTheBear's Avatar
 
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
what i would do is simply translate the words "translate this page" then put a link near the top that leads to an online translation service like babelfish.
__________________
hatisblack at yahoo.com
SmokeyTheBear is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-16-2009, 10:48 AM   #11
SmokeyTheBear
►SouthOfHeaven
 
SmokeyTheBear's Avatar
 
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
something like this
Code:
<?php
$mypage = "www.gfy.com/index.php";
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
$url = "http://babelfish.yahoo.com/translate_url?doit=done&tt=url&intl=1&fr=bf-home&trurl=http%3A%2F%2F$mypage&lp=en_$lang&btnTrUrl=Translate";
if ($lang == "fr"){
$message = "Translate this page <- this should be in french";
}
if ($lang == "de"){
$message = "Translate this page <- this should be in german";
}
$translatelink = "<a href=\"$url\">$message</a>";
echo $translatelink;

?>
__________________
hatisblack at yahoo.com
SmokeyTheBear is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-16-2009, 12:02 PM   #12
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,270
I have this method setup in wordpress
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-16-2009, 12:07 PM   #13
Clean_Franck
So Fucking Banned
 
Join Date: Jan 2007
Posts: 399
Thankyou Smokey for your help.
I like the idea of real translations for visitors from the major countries who visit me site.

For the other countries though, what method would be best for my translated pages to appear based on their browser settings automatically and a page of mine created for that langauge.

E.g. the page is mysite.com/porn.html
And someone from Poland logs on with polish settings in his browser. I would then want a page created for him in polish that is under the url mysite.com/porn.html&pl

I am not sure whether that is the second or third method you posted and whether the online services allow this.
Clean_Franck is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-16-2009, 12:13 PM   #14
GT-Omar
DM at Performive.com
 
GT-Omar's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Atlanta, G.A.
Posts: 2,968
Smokey hits nail on head!

Hey Smokey. When ever you have a chance can you hit me up. Would like to discuss a few things with with regards to this. See sig.

Clean Frank. If you're looking to translate into different languages let me know. We would be more than happy to help.
__________________


Email me

Skype me
GT-Omar is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-16-2009, 02:11 PM   #15
Clean_Franck
So Fucking Banned
 
Join Date: Jan 2007
Posts: 399
Hey for the moment I would like to just get automatic setup. Once I have some spare cash then I can go down the proper route. But just need to know how to go about it.
Clean_Franck is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-17-2009, 12:01 AM   #16
SmokeyTheBear
►SouthOfHeaven
 
SmokeyTheBear's Avatar
 
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
Quote:
Originally Posted by Clean_Franck View Post
Hey for the moment I would like to just get automatic setup. Once I have some spare cash then I can go down the proper route. But just need to know how to go about it.
ok heres what this does

It grabs an glob of text like a welcome message from a txt file

en.txt for english
fr.txt for french
etc etc
if you dont have a txt file for that language it displays a link to translate the page in place of where the message would be ( KEEP IN MIND THE WORDS "TRANSLATE THIS PAGE" ARE IN ENGLISH )

Code:
<?php
$pageURL = 'http';
 if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 $pageURL .= "://";
 if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
 } else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
 }
$pageURL = urlencode($pageURL);
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
$lang = strtolower($lang);
$file="$lang.txt";

if (file_exists($file)) {
$message = file_get_contents("$file");
} else {
$message = "<a href=\"http://babelfish.yahoo.com/translate_url?doit=done&tt=url&intl=1&fr=bf-home&trurl=$pageURL&lp=en_$lang&btnTrUrl=Translate\">TRANSLATE THIS PAGE</a>";

}

echo $message;

?>

using this method you could add a txt file message for each language as you add them without altering those code.

the drawback is they must be able to read the words "translate this page" in english to understand they can translate the page.
------------------------------------------------
below is some diff code , this will automatically redirect the user to the babelfish translator if you dont have a message .txt for that language

Code:
<?php
$pageURL = 'http';
 if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 $pageURL .= "://";
 if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
 } else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
 }
$pageURL = urlencode($pageURL);
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
$lang = strtolower($lang);
$file="$lang.txt";

if (file_exists($file)) {
$message = file_get_contents("$file");
} else {
$message = "<script>top.location.href = \"http://babelfish.yahoo.com/translate_url?doit=done&tt=url&intl=1&fr=bf-home&trurl=$pageURL&lp=en_$lang&btnTrUrl=Translate\";</script>";

}

echo $message;

?>
p.s. i havent tested either of these out, if you have a problem just let me know.


so for example on gfy where it says "where the industry meets" if you put this code right where it says that then made a txt file called en.txt for english and put "where the industry meets" then made a few more with proper translation for popular languages , if someone visited this page they would see the messagein their language, unless gfy didnt have their particular language translated then it would send them to the babelfish translator

below is an example of the babelfish page translator.. translating gfy.com to french

http://babelfish.yahoo.com/translate...rUrl=Translate
__________________
hatisblack at yahoo.com
SmokeyTheBear is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-17-2009, 10:23 AM   #17
Clean_Franck
So Fucking Banned
 
Join Date: Jan 2007
Posts: 399
Thanks very much Smokey, Will get on this right now
Clean_Franck is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.