From our monthly sponsor: Create your beautiful portfolio website with Squarespace. Start your free trial.
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:
And you can configure the plugin in the following way:
- original: the language shortage of the initial language (default is “en”)
- notfound: the message shown when no translation was found
- title: The title of the translation overlay
- firstOptionText: the text shown as first option in the languages drop down