jTextTranslate: A jQuery Translation Plugin

The double-click functionality in the New York Times was somehow fascinating but also highly discussed because it boldly used the browser functionality to get the definitions of words. Fortunately, the double click now causes not an immediate popout to appear but lets the user confirm by showing an interrogation mark. This inspired me to create […]

jTextTranslate copy

The double-click functionality in the New York Times was somehow fascinating but also highly discussed because it boldly used the browser functionality to get the definitions of words. Fortunately, the double click now causes not an immediate popout to appear but lets the user confirm by showing an interrogation mark.

This inspired me to create a new jQuery plugin for translating text. Imagine, how users that don’t have English as their first language could profit from an integrated functionality to translate e.g. an article.

The plugin works with the Google Language API and can be used to translate a text in all the languages provided by the API.

You can call the plugin like this:

$(element).translate()

And you can configure the plugin in the following way:

  1. original: the language shortage of the initial language (default is “en”)
  2. notfound: the message shown when no translation was found
  3. title: The title of the translation overlay
  4. firstOptionText: the text shown as first option in the languages drop down

DemoDownload

Previous:
Next:

Tagged with:

Cody loves jQuery - he puts the magic into every web application. He is crazy about Curry dishes.

View all contributions by

Website: http://tympanus.net/codrops/author/cody/

Related Articles

CSS Reference

Learn about all important CSS properties from the basics with our extensive and easy-to-read CSS Reference.

It doesn't matter if you are a beginner or intermediate, start learning CSS now.