EDIT: This just doesn’t work due to Facebook proxy making language to be en_US all the time. Please read “Multilingual Facebook Welcome page based on user language” instead
Today, i’ve created the Facebook page of a new online service i’m working on. It could sounds a bit early since it’s not gonna be released before a few months but i want to share with people how it evolves, ask feedback, get momentum asap. Will see how it work…
So to be the more attractive as possible, i need a sexy Welcome tab, with a like-button call to action. Not a big deal, i just type “coca” in searchbox and make a screenshot of their welcome page. Now i have the good width of window to optimize mine.
It’s a service dedicated to find bike rental station in my hometown (which you can already find in Paris as “Vélib“). Lille is located between Paris (55min by train), Brussels in Belgium (35min by train) & London (1h20min by train via EuroTunnel). It’s also a massive studient area with a lot of exchanges from all around the world. EuraTechnologies, a huge startup incubator, has a partnership with Stanford for more than a year.
So it’s pretty clear that this service must be in both french and english, same for its FB fanpage welcome page. The problem is: i can only enter FBML or HTML. Since FBML is deprecated, all i have is HTML. No javascript allowed. No prob, let’s just use a big image file but how to detect user language?
Here is how i did this: Using a PHP script as an image ressource. First, link image to your script:

Then, just use a simple PHP script to detect browser language so it can choose which image ressource to load:
<?php
$lg = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);
$lg = strtolower(substr(chop($lg[0]),0,2));
$lg = ($lg=='fr')?'fr':'en'; // only to provide a 'en' fallback for non french.
$f = file_get_contents('facebook-welcome_'.$lg.'.jpg');
header("Content-type: image/jpeg");
echo $f;
?>
nb: of course, you need to put a ‘facebook-welcome_fr.jpg’ & ‘facebook-welcome_en.jpg’ in the same directory…
Here is the final result:


Live demo on fanpage itself: VLille-map on Facebook
Have fun!




source: 
