GTranslate Pro not changing language attrib. in Wordpress

Popular automatic website translation tool

GTranslate Pro not changing language attrib. in Wordpress

Postby nanni75 » Sun Oct 16, 2011 7:23 am

Hi Edward,

I am playing with your great plugin in wordpress and it's working just fine.

One thingh tough, which I think is a serious issue, is that translated pages in my wordpress install keep the original language definition.

On the website I am working on, the default language is italian and the wordpress tag that print the language in the header.php are the following:

<html xmlns="" dir="<?php bloginfo('text_direction'); ?>" xml:lang="<?php bloginfo('language'); ?>">
<meta http-equiv="Content-language" content="<?php bloginfo('language'); ?>" />

Now, when I move into a translated page, let's say or, the above wordpress functions are still printing italian as the default language page.

Do you know how it would be possible to print the correct language attribute in the translated pages?!?

I couldn't sort it out by myself but I think it's an important point from SEO perspective.

Posts: 5
Joined: Sun Oct 16, 2011 7:09 am

Re: GTranslate Pro not changing language attrib. in Wordpres

Postby Edvard » Mon Oct 17, 2011 2:54 pm


You can remove xml:lang, and meta content-language from your template. They are not important.

But if you want to set appropriate language code, you can read this: url-language-code-t320.html and use
Code: Select all
<?php echo $_GET['glang']; ?>

instead of
Code: Select all
<?php bloginfo('language'); ?>

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Site Admin
Posts: 4403
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

  • Related Topics
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest