If you’re having problems with your Google Ajax Translate plugin not working the plugin authors have now fixed the bugs and it’s fully working with WordPress 2.8.5.
I don’t know about you but I’ve tried to get Google AJAX Translation working on WordPress and am really not having much luck. It’s not, from what I can see, that I’m doing anything other than download the plugin and copying the uncompressed folder to my plugins directory – like I’ve done with all the other plugins I use.
I tick all the correct boxes, saved the changes and… nothing happens.
I’m currently working out why this is happening and will post back when I can find out what it is that isn’t happening.
Just so that you know the base template was created with Artisteer (with some hand midifications to the PHP for sidebars and footer) and I’ve updated to WordPress 2.8.5 (the most current as of this post).
These are my page settings:
My only clue on how to solve this is a link to a site provided by the author that does work, so all I can think of is to have a look at the code on that site to see if I can dig out the solution:
The date and time is now 22nd October 2009 14:30 Universal time, will post back ASAP.
Ok, this is the code that calls up the translate style sheet at http://orrmarshall.com/wp/
If I select the translate button and select say for example Hindi the code returned to the page is exactly the same – in the working version! The text is still in it’s original language and the HTML displayed above remains unchanged. I think that explains the AJAX part. What I suspect is happening here is that the content of a post is contained within a <div class=”entry”>My post text to be translated here</div>.
At the moment my suspicions are that the translate function will pass the content between the div tags to Google Translate, to be seamlessly returned in the language of choice.
Okay, after some digging round and testing the problem in a nutshell is – It’s your theme! My suspicions have been confirmed. If, like many bloggers, you have used Artisteer to create your theme Google Translate breaks. That’s because as fab as Artisteer might be for knocking up quick themes they have not stuck to WordPress standards.
Artisteer have chosen to wrap the content of a post in a div class called:
Instead of the correct label:
Is there a way to make it work?
Yes there is, but be prepaired to get your hands dirty. You won’t have to be a video games programmer to work your way around this problem just a bit of search and replace that will modify your template.
Backup your template folder NOW!
That’s the one it will only take a minute and it will safegauard you against any missadventure. Your template folder is in wp-content/themes/yourtemplatename
Just back the whole lot up to your desktop (or preferably somewhere more sensible)
If you now change your default theme to WordPress’ default theme and view your site you will see the Google AJAX Translate working just fine.
I have seen posts on the Artisteer website here that blame Google, but the way I see it is, if it works just fine with the default WordPress template ‘Kubrick’ then why not with any Artisteer template?
Anyway pointing a bony finger and apportioning blame is hardly constructive but as a video games programmer and a web designer I can honestly say that it’s entirely Artisteer’s fault – LOL! They also have exactly the same problem with their Joomla! and Drupal templates, although with Drupal the theamer has far more control over the page layout. However I would far rather spend my time working out a solution. There must be one this isn’t a magic show you know.
I will get to the bottom of this and post a solution below for you when I have one. Bookmark this page or leave a comment and I’ll get back to you when it’s done.
It’s getting there. Have a quick look at one of my posts here in the comments section below you will see the [Translate] function working perfectly! This is with a standard Artisteer template (at least I think so, let me know otherwise)
This is good news, it means that the Artisteer template DOES work with Google AJAX Translate. It means the plugin IS working and so I suggest you try it on you own blog straight away! That’s step one complete…