Sunday, August 31, 2008

Partial Draft Thesis

The Partial Draft Thesis is due this Friday (Sept 5th)

I've written most of this up, I probably just have a couple of more days work to put into it before I can get back to the actual development side of things.

The core of the draft will be as follows:

Chapter 2: Background
  • i) Current i18n via Message Sources & JSTL
  • ii) OpenACS solution, ACS-Lang Package, Message Key Translation Interface
  • iii) Google-Translate-Java-API
  • iv) Encoding
  • v) Databases
  • vi) Translation Management Services/Applications
Chapter 3: Own Work
  • MessageTag Extension - Spring.TLD
  • Sessions - login with 'translator mode'
  • XML I/O
  • Error messages
  • Consider Tiles for layout ability

Tuesday, August 19, 2008

Minor Breakthrough / Idea ??

One of the issues I was having is how I was going to be able to provide links to a page for each message key that are only available when translator mode is enabled.

A possible solution that I'm looking into is either rewriting or extending the Spring MessageTag definition so that if the user role is 'translator' or translator mode is toggled on then each message key will effectively be marked up.

Each message item will end up with a link to a translation page which is passed the particular message key reference.

I will probably just write my own and point Spring.tld to that.

If this all goes as planned the final step of this stage will be to update the relevant with what is input on the translation page.

Sunday, August 17, 2008

Old-School i18n

In order to get a better understanding of the current/traditional Spring i18n technique I implemented it in my ELEC5619 tutorial application.

The application already had a messagesource in the form of
<bean id="messageSource" class="">
<property name="basenames">

I had to declare an interceptor and then a resolver.

<bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="siteLanguage">

<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver"></bean></bean>

and add the interceptor to the urlMapping

The project already had so I added a new localised message-set for French as

Then add the spring taglib to include.jsp
<%@ taglib prefix="spring" uri="/WEB-INF/spring.tld" %>

and finally update the jsp so use the spring taglib instead of jstl. So for example
<spring:message code="title"></spring:message>

Changing the language setting inside the browser to French resulted in the output being localised for Fr_fr -> SUCCESS!

Now I need to move forward onto a translation interface, however I'm seeing a few complications as I'm not sure how to go about a few things. Namely, I need to be able to add links of some form to all the message.keys in translator mode. When translator mode is enabled the controller could redirect to a different jsp and manually add a traditional link for each message.key but this is going to result in a lot of tedious re-coding. I'm hoping to just be able to render the jsp and add the link somehow without requiring a different jsp for when translator is enabled.

The other issue I need to consider is how to interface to simply localise any text pulled from a database.

Monday, August 11, 2008

Moving towards Draft Treatise submission

Friday 5th September, 2008 Hand in your partial treatise draft

The draft submission consists primarily of Chapters 1+ 2, Introduction + Background. I have some work to do to complete my Introduction based on the plan submitted a couple of weeks ago and then develop the full Background chapter.

Other developments:

Completed introductory Spring readings and ELEC5619 lab. This enables me to start playing around with other Spring examples so that I can begin designing my own solution.

I will look closely at examples implementing Security and also read the chapters on Security and Web in Spring in Action. This should enable me to understand interceptors and how it might be possible to intercept a JSP, translate it and output a new version to the browser.

I am interested in the potentials of integrating Google's translator. There is a Java client available as per