views:

86

answers:

3

Hello,

This is a SEO question :

i've the choice to display a page's title according to the culture of the visitor.

If it's an english :

<title>
  <?php if ($sf_user->getCulture() == 'en') : ?>
     Hello, this is an english website
  <?php else ?>
     Bonjour, ceci est un site français
  <?php endif ?>
</title>

Does the bots/spiders has a culture ?

Does that means that on Google uk my website page will be : "Hello, this is...." and on Google france this will be "Bonjour...."

Thank you

EDIT: Anyone visiting my website will see it in english, except for france, beligum, and maybe canada. It can be done because getCulture() retunrs browser accepted & preferred languages

EDIT2: When a user opens my website (based on HTTP_ACCEPT_LANGUAGE) :

<?php $culture = $request->getPreferredCulture(array('en', 'fr')); 
    $this->getUser()->setCulture($culture); 
    $this->getUser()->isFirstRequest(false); ?>
+2  A: 

A bot views the page in the default localization you've set up, since it's not logged in. (How would your page know which visitor comes from which country? You might be able to hack in something using a geo-ip lookup, if you wanted).

How does your site appear to non-registered in visitors?

Alex JL
it depends on their preffered browser language :if you are anything but french, you'll see the site in englishif you are french, you'll see it in french.i'm talking about non logged-in users
Tristan
So, does symfony extrapolate that from the user agent string, or how does it get this setting on the server side? I haven't been able to find information on that.
Alex JL
In fact, he gives the choice between 2 language look at this : // on the first visit : $culture = $request->getPreferredCulture(array('en', 'fr'));$this->getUser()->setCulture($culture);$this->getUser()->isFirstRequest(false);
Tristan
Symfony says getPreferredCulture() works based on the `HTTP_ACCEPT_LANGUAGE` http header. I can't say for sure whether a bot would send that. My browser doesn't appear to.
Alex JL
so, is there a way to know in what language spiders will see my website ? only in en ? only in fr ? both ? :O
Tristan
unless it's on one of the domains you set for a specific language, I guess it is the default - which is selected when there's no HTTP_ACCEPT_LANGUAGE header sent? You could also set up a listener, and when the user agent has google bot in it, log the headers to see if it sends a HTTP_ACCEPT_LANGUAGE, or log which culture is selected.
Alex JL
A: 

The googlebot indexes the language it finds on your site without any login or registration. Therefore if the default view of your site is English, you'll only have English content in the Google index. This post gives more background on how sites are crawled.

The key is to provide links on your site that the bot can follow which will lead it to your content in all its various languages.

In answer to your question, no, the googlebot will not have culture since this is determined by your application and a user's preference within your application.

Pat
no, it's not a user preferrence, that's why i'm askin in what language spiders will see it :p
Tristan
+3  A: 

Please see working with multi-regional websites from the Official Google Webmaster blog. The best way to handle multiple languages is not to dynamically return different languages, but rather to have distinct domains or distinct URLs for each language. If you want to give visitors a single landing page, consider having that page redirect to the language-specific page. Also, to maximize crawling, consider having links that easily allow a user to switch to different language version of the same page.

Michael Aaron Safyan
I already have distincts URL : as soon as you go on my website, it guess your language by asking your browser in which language it is set-up.my urls look like this : www.example.com/en/article/idwww.example.com/fr/article/idI have 2 domains, 1 in .FR and one in .COM, i though i will redirect the .fr to the .com in order to anybody use the .com Is that a bad idea ? (i don't think i'll use one for english and the other for french.... i guess...)
Tristan
@Tristan, read the article. It has more details.
Michael Aaron Safyan
ok, thanks your article helped me to answer my last question about duplicate content. But i still don't know in what language the spider will see my website.
Tristan
@Tristan: I HATE when a website decides automatically what language I should be looking at. Whatever you go for, allow the user to decide which language to use. The various sections of a multilingual website frequently get out of synch and the result is that some content is available only in one language and not the other. Having an automatic redirection can effectively prevent users from viewing the pages they are looking for and results in involuntary cloaking of the pages (SEs see one page, user sees another). DO NOT redirect. Detect and SUGGEST. "Afficher la version française du site?"
Sylverdrag
@Tristan: Further, you can not assume that the browser's language and the user's language are the same thing. For example, have you ever been to a Cybercafe in a foreign country? Geographical location and browser language allow you to guess what the user language is, but it's only a guess. You really don't *know*, and a wrong guess becomes a complete usability nightmare. If you ever tried to book a plane ticket on an airline website while in a foreign country, you will understand why silent redirection is a really bad idea.
Sylverdrag
Well, the browser's language is the best thing to go off of short of asking the user...What you could do is default to the language of the browser and give the user the choice of changing langauges.Skype.com does this, and makes it easy to change. Google is just really annoying because it defaults to the geo-IP.
NinjaCat