Handling UI messages RSF Tools

RSF based tools

RSF has a few ways to handle internationalized messages. The simplest way is to place the message key right in the RSF template. The default location for the Messages.properties file in RSF tools is tool/src/webapp/WEB-INF/messages but this is configurable.

In order to use Sakai's ResourceLoader, the setting of messageSource should be done this way:

<bean id="messageSource"
class="org.sakaiproject.util.ResourceLoaderMessageSource">
<property name="basename" value="classpath:org/sakaiproject/site/tool/participant/bundle/sitesetupgeneric"/>
<property name="cacheSeconds" value="10" />
</bean>

Here is an example of placing the message key in the template:

<span rsf:id="msg=page.user.message.key">This is an internationalized message.</span>

Here is an example of using the UIMessage class:
(From the RSF template)

<span rsf:id="my-rsf-id">This will be an internationalized message.</span>

(From the RSF producer)

UIMessage.make(tofill, "my-rsf-id", "page.user.message.key");

There is more information at the RSF Wiki I18n page