A few features that are still to come:
Defining which languages are available to translate to
Defining the original language as something other then English
Showing text links instead of flag images
Using translation engines other then Google
Usage:
Result:
Source and binaries are attached, Comments are welcome.
Update: The original binaries were built with JDK 1.6, which does not seem to be backwards compatible. The new plugin binary is built with 1.5, which should allow people to actually run it on most systems.
You mean for the source language? the macro currently allows a "lang=xx" parameter for setting the source language, with English (en) as it's default. I could definitely modify it to use the currently set Locale as the default source language instead.
Right this second I am trying to decide on a syntax to use to specify target languages. Each target language needs three pieces of information - the description (what shows in the text view or on hover), the language code (which gets passed to the translation engine, currently google), and (optionally) the image code if it is not the same as the language code (for instance, ja is the language code for Japanese, but jp is the image country code according to ISO 3166).
The other option of course is for the available target languages to be set through the admin interface, and I may end up doing it that way.
Cool concept.
I installed the translations jar into ClearspaceX version 1.9.0. Using the translation tag, I get the row of flags to appear. However, when clicking on any of the languages, Google translates the login page of the ClearspaceX installation and not the document.
Thanks the plugin...however I have been unable to get it to work. I've installed correctly and see the flags as expected in documents however when sent to Google for translation no actual translation appears...I'm still looking at my doc in english.
Any advice?
@jcook:
This plugin will only work on publicly accessible pages.
@rboutin:
can you give me more info? i.e., what does your address bar show after google fails to translate it?
<i>This plugin will only work on publicly accessible pages.</i>
That would explain it. Thanks for the response.
It would be cool to change this macro to use the value from webwork. You can do this by calling com.opensymphony.xwork.ActionContext.getLocale().
That method returns the locale object which is stored on a thread local variable. The thread locale variable is set by com.jivesoftware.community.action.LocaleInterceptor