Translate Widget
Update! Version 2.0 is here: Translate Widget 2.0
So, I’ve completed my first bona-fide Wordpress Plugin ![]()
It’s one of those newfandangled widgets, and it adds little flags to your sidebar, which will take you to a translation of the current blog page. It uses google translate, but removes the frame, so it looks quite nice! Once you’re in one language, you can browse around the blog, and everything stays translated. You can just click on the English flag to get back to the original language. You should see it on my sidebar now, and you can give it a trial run. Then, if satisfied, download it here:
Translate Widget
The zip includes a /flags/ folder, and a translate.php file. Both need to be placed in the /wordpress/wp-content/plugins/widgets/ folder. If you want to change the English language flag from the default American to either the British or Canadian (as I have!) flags, they are included, just rename flag_ca.gif, or flag_uk.gif to flag_en.gif. Now you can just go to the widget’s options.
Donations
If you appreciate my plugins, and feel compelled to spread some love, I would certainly appreciate it. No obligation though, of course.
Comments, tips, or problems are welcome, just leave a comment here, or send me an email (Address is in the sidebar.)
Do enjoy!
Update on June 14, 2006: The plugin now supports Arabic, since Google has added that to their list of supported translations. This brings the total to 9 languages.
To those not familiar with Wordpress Widgets, you need to have the Widgets plugin installed before you can use my widget.

Christopher, I have added Arabic to the plugin
I’ve updated the whole thing, so you can get it from the same place.
It’s nice to know that google is updating their translation service.
You are a star. Thank you v v much // Christopher
great plugin, but when i checked my site from a different machine, none of the flags showed…….any suggestions?
Mike,
That is strange…
The only thing I can see that’s different on your site is that google analytics is injecting this into the links:
onclick="javascript:urchinTracker('/outbound/www.google.com');
I have google analytics running on this site too, but that doesn’t show up for me.
Maybe try disabling analytics, and see what happens? It’s up to you.
This plugin intrigued me and I thought I’d give it a go. I encountered a pretty major problem though and that is when i click on one of the flags to get my page translated it loads up google translator okay but it doesn’t result in a translated page (just blank). And yes, i know it’s supposed to be pretty slow. Any suggestions as to what the problem might be? I’ve left the widget activated (as of the date this is posted and prolly for a few more days unless I get no response). You can click on my name to visit my blog.
[…] Et voici mon deuxième Widget: Translate_fr. Il s’agit d’un Widget pour Wordpress qui permet de traduire une page Web écrite en français vers d’autres langues. L’idée Originale vient de Trevor Creech qui a créer le Widget initial pour les site en anglais uniquement. […]
[…] Oh, before I forget, you can get a free WordPress plugin that does the same thing from Trevor Creech - enjoy! […]
Hi, I really like this widget, using it along with babelfish to give readers as many options as possible. I have one question/request though.
I\’m using the King Text widget (found here) with most of the items in my sidebar so that I have better control over php and html surrounding widgets as well as an easy way to make the menu items collapsible (see the right sidebar on my site http://www.ttancm.com). With most plugins/widgets there is a function call or tag that is placed so that the to determine where the plugin/widget is displayed (with the theme switcher widget for example the code is
< ?php if (function_exists(\'wp_theme_switcher\')) { ?>
< ?php wp_theme_switcher(); ?>
< ?php } ?>
and so I am usually able to just paste this function call/tag into the king text widget in order to sort of embed other widgets into the king text widget in order to make them collapsible.
With your widget however I can\’t figure out what I would need to enter into the king text widget to embed this widget or if this is even possible.
[…] Trevor has added Arabic to his Translator Widget. […]
[…] Ho reso il plugin di Travor, Translate Widget nella versione italiana: in quella originale cliccando sulla bandiera italiana, la pagina veniva tradotta da inglese in italiano, mentre cliccando su quella inglese non avveniva affatto una traduzione. Cosa ragionevole se gli articoli sono in inglese (lingua nativa di Trevor, appunto), ma cosa che rende il plugin inutile per gli “scrittori” in italiano. […]
Hi Trevor! Just wanted to drop you a note to let you know your widget is perfection! Installed with no problems the first time and works like a charm. Thanks for sharing your hard work!
Looks very nice. Now if google only would translate to or from dutch
Great plugin Trev! Using it on my site and works like a charm!
I do have one quick question for you though, is it at all possible to center the flags?
They’re currently left aligned in the widget, how would I go about making them centered?
Thanks!
Parm
great plugin! Thnk you very much. I installed it and it works flawless.
Is there a posibility you can make a standard plugin instead of a widget?
That’s exactly what I am looking for.
Just to echo what ttancm wrote above. I never really got widgets to do what I want them to; is there a non-widget way / call to integrate it? Cos apart from relying in widgets (which still doesn’t work universally), it looks excellent!
Thanks for the great widget. Works great here at http://vorpal.us
The only bug I see is that the translated page can’t find the flags.
[…] Translate (Add translate widget on your sidebar) Bookmark to: […]
[…] Home site adds little flags to your sidebar, which will take you to a translation of the current blog page. It uses google translate, but removes the frame, so it looks quite nice! Once you’re in one language, you can browse around the blog, and everything stays translated. You can just click on the English flag to get back to the original language. […]
Nice!
[…] Thanks to the Translate widget by Trevor Creech, you can read this blog in more languages than ever (and it doesn’t matter it’s a new blog and ‘than ever’ referes to like 2 hours time ). To get back to English version, just click on UK flag. […]
Trev:
I was wondering if you could go through the thread and answer a few of the questions within it. There were a few questions that you said you answered via email, but others are probably coming looking for the same answers (i.e. I want to know how to but a break after the title so the flags go below it). It would be good if you could put an FAQ in the Original Post here.
Great widget by the way!
Really great; simple, elegant, functional, and worth the wait for google to do it’s thing…Seriously…great , great job!
Nice widget Trevor.
Now my girlfriend who is learning english can more or less understand my blog
Cheers
Carlos
Wonderful plugin, I love it, great job!
I use the Andreas-09 2.1 theme and the flag pictures are not shown, when I include the widget and activate it. The flag folder and its contents are in the right place (/plugin/widget folder), but it still doesn’t work. Do I have to set any attributes to the folders? I host with dreamhost. What can I do? Thanks!
Nice work Trev!
Is there a bug on line 58, where we can read “.gif.png” ?
$image = get_settings(’siteurl’).”/wp-includes/images/flags/flag_$langcode.gif.png”;
Hi Trevor, this plugin is very interesting… no words…
But, I got a problem… the default idiom (of my blog) is spanish, for this reason, the plugin don’t translate the page in other idioms.
¿What I do?
Thanks!
[…] Translate_me is an evolution of the Translate_fr Widget. Initialy it was designed by Trevor Creech to translate a web page from english to other languages. I, then, adapted it to French with Translate_fr. […]
[…] Hace un tiempo, revisando las estadisticas, encontré que muchos usuarios usaban la herramienta de traducción de Google para leer los artículos publicados en este blog. Decidí instalar un plugin para automatizar esta tarea y únicamente encontré un plugin y un widget sin costo. Para que funcione el widget hay que instalar unos widget-plugins, así que decir probar el plugin, encontrando que éste solo traducía del inglés a otros idiomas. Lo he modificado para conseguir que traduzca del español a otros idiomas, usando los servicios proporcionados por Altavista Babelfish y Worldlingo. Actualmente funciona con 5 idiomas: inglés, alemán, francés, italiano y ruso. […]