Hi Sachin!

On May 1, 2008, at 1:45 PM, Sachin Naik wrote:
> I wanted to get feedback on the changes I made so far for i18n of
> OpenNMS (web U/I).

Let me be the first to say "wow" and "thank you!"  This is truly  
awesome.

> 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'):

I'll let others who are Springier than I weigh in, but I personally  
see  no issues with this approach.

> 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.

Great!

> 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).

Ben Reed recently checked in a change to our web.xml that should  
obviate the need for specifying UTF-8 encoding in each JSP file.   
Would you mind verifying this?  You can find the updated web.xml at 
https://opennms.svn.sourceforge.net/svnroot/opennms/opennms/branches/1.6/opennms-webapp/src/main/webapp/WEB-INF/web.xml
 
.

> 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'm sure that there are plenty of strings in opennms-webapp/src/main/ 
java, since having a real MVC approach is a fairly recent development  
compared to the age of the web app.  Even in MVCified code you'll  
probably find some places where we've been very bad.  In those latter  
places, the right answer is probably moving the strings into the view  
JSP (which lives under opennms-webapp/src/main/webapp/WEB-INF/jsp  
and .../jspf).

> 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.

If you would like, create an enhancement bug at bugzilla.opennms.org  
and attach a patch to it.  By the way, are you working against trunk  
or against one of the existing tags or branches?

Thanks for your enthusiasm and your hard work!  I'm looking forward to  
seeing what you've accomplished so far and what's yet to come.

-jeff

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

Reply via email to