Currently Being Moderated

Translations Macro

VERSION 6

Created on: Oct 25, 2007 5:57 PM by Lokkju - Last Modified:  Sep 4, 2008 5:33 PM by tim.neuwerth

"Translations" is a simple macro that will insert a small div with flags on it into the document.  When you click on of the flags, a new window will open with the translated version of the current page.  Right now, it is using Google as the translation engine, and is fixed at having English as the original language.

 

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.

 

Clearspace 1.X Plugin Files Are Attached Below

Attachments:
Average User Rating
(1 rating)




A.J. Wright A.J. Wright  says:

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

Lokkju Lokkju  says in response to A.J. Wright:

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.

jcook jcook  says:

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.

rboutin rboutin  says:

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?

Lokkju Lokkju  says in response to rboutin:

@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?

jcook jcook  says in response to Lokkju:

<i>This plugin will only work on publicly accessible pages.</i>

 

That would explain it.  Thanks for the response.

Chris Britt Chris Britt  says:

Hi -- Do you plan on making this availble for 2.5?

 

Thanks!

 

Chris

Download Plugin for

Plugin Info

  • translations
  • by Lokkju
  • Compatible with 1.x

More Like This

  • Retrieving data ...