0
votes

I have a wordpress multilanguage site.The default language is english and for translations I used gettext and .po files (I have many other languages like japanese,russian,czech etc..). let’s suppose that a French speaker happens to land on http://example.com(default english); now, with one click on a specific link (ex:lang=fr">french">) he can get to http://example.com/?lang=fr where he can view the same content in French.

My wp-config file related to localization is:

<?php if (!session_id())
session_start();

if(isset($_GET['lang']))
{
  switch($_GET['lang'])
  {
    case 'it':
     $my_locale='it_IT';
     break;

    case 'en':
     $my_locale="en_US";
     break;

    case 'ja':
     $my_locale="ja_JA";
     break;

    default:
     $my_locale="en_US";

  }
  define('WPLANG', $my_locale);


  // register the session and set the cookie
  $_SESSION['lang'] = WPLANG;

  setcookie('lang', WPLANG, time() + (3600 * 24 * 30));

}
 else if(isSet($_SESSION['lang']))
 {
 define('WPLANG', $_SESSION['lang']);
 echo "e' definita la sessione";
 }
 else if(isSet($_COOKIE['lang']))
 {
   define('WPLANG', $_COOKIE['lang']);
 }
 else
 { 
   define('WPLANG', 'en_EN');
 }  

How this website is going to be indexed by google? Wich language will be indexed?

Thanks

luca

1

1 Answers

0
votes

That truly depends on the incoming links to the page. Each URL with a different &lang= value will be indexed as a different page by Google (unless you specify a "canonical URL", which it doesn't sound like you're doing).