nutch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Nutch Wiki] Update of "AddingNewLocalization" by Mike Dawson
Date Sat, 20 Jun 2009 19:08:47 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Nutch Wiki" for change notification.

The following page has been changed by Mike Dawson:
http://wiki.apache.org/nutch/AddingNewLocalization

------------------------------------------------------------------------------
- ===Adding a New Language to Nutch===
+ = Adding a New Language to Nutch.... =
  
- If you want to have Nutch in your language - hopefully the below helps.  I just Googled
around.
+ If you want to have Nutch in your language - hopefully the below helps.  I have been Googling
around and digging in some source code...
  
   * Unzip Nutch 1.0 to any folder
  
@@ -25, +25 @@

  ant generate-docs
  }}}
  
-  * Work in progress - I now find that when doing the search it still comes back in English...
for some reason it seems like the JSP loads the resource bundle according to the language
passed by the browser headers, not according to the lang parameter...
+  * It seems like some changes are needed to search.jsp to make it behave as users would
expect.  The original appears to expect the language of the browser to take precedence over
the language selected...  After out.flush() at about line 160 add the following in src/web/jsp/search.jsp:
  
+ {{{
+ 
+   //see what locale we should use
+   Locale ourLocale = null;
+   if(!queryLang.equals("")) {
+ 	ourLocale = new Locale(queryLang);
+ 	language = new String(queryLang);
+   }else {
+ 	ourLocale = request.getLocale();
+   }
+ 
+ }}}
+ 
+ Then change the line:
+ 
+ {{{
+ <i18n:bundle baseName="org.nutch.jsp.search"/>
+ }}}
+ 
+ to:
+ 
+ {{{
+ <i18n:bundle baseName="org.nutch.jsp.search" locale="<%=ourLocale%>"/>
+ }}}
+ 
+ * Now we are ready to build it:
+ 
+ {{{
+ ant war
+ }}}
+ 
+ * Copy the .war file to your servlet container's webapp directory.  If everything went well
you will see your language code in the bottom, then you can select it, and the search interface
will come back with the localisation you just put in.
+ 

Mime
View raw message