Hello,
I wanted to get feedback on the changes I made so far for i18n of
OpenNMS (web U/I).
1) Added resources for translatable strings. I moved the
'messageSource' bean from dispatcher-servlet.xml to
applicationContext-common.xml (since the resources are required at the
app context level), and added another basename for the translatable
strings (I added 'resources'):
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basenames">
<list>
<value>/WEB-INF/messages</value>
<value>/WEB-INF/resources</value>
</list>
</property>
<property name="cacheSeconds"><value>2</value></property>
</bean>
2) Added resources_en_US.properties (in src/main/webapp/WEB-INF/ directory)
3) Extracted strings from several JSPs to the resources file. Replaced
hard-coded strings with <spring:message> tags.
4) Other JSP changes;
Added XML header at top, specifying encoding. Also added doctype:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
For JSPs that include other JSPs with localizable string parameters,
added:
<%
request.setCharacterEncoding("UTF-8");
%>
Otherwise, the included JSP will show "?????" for UTF-8 strings (if
they're in Chinese for example).
Other than the JSPs, where else should I look to translate strings? I
did a few from the Spring config files (for the nav bar), replacing them
with the message keys (and then using the <spring:message> tags to get
the translated strings back when those beans are displayed).
I've done about 10-15 JSPs so far. What is the procedure to get the
changes reviewed and checked in? It would be great if we can get this
checked in, so we don't have to re-do the work again.
Thanks,
Sachin
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ
opennms-devel mailing list
To *unsubscribe* or change your subscription options, see the bottom of this
page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel