portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morci...@apache.org
Subject cvs commit: jakarta-jetspeed/xdocs changes.xml
Date Tue, 20 May 2003 19:11:49 GMT
morciuch    2003/05/20 12:11:48

  Modified:    docs/site changes.html usejetspeed.html
               src/java/org/apache/jetspeed/services/customlocalization
                        CustomLocalizationTool.java
               src/java/org/apache/jetspeed/services/jsp/tags
                        JetspeedL10NTag.java
               xdocs    changes.xml
  Log:
  More fixes to JetspeedL10NTag, by Fabio Latrofa (see Bugzilla bug # 18510)
  
  Revision  Changes    Path
  1.144     +4 -3      jakarta-jetspeed/docs/site/changes.html
  
  Index: changes.html
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/docs/site/changes.html,v
  retrieving revision 1.143
  retrieving revision 1.144
  diff -u -r1.143 -r1.144
  --- changes.html	19 May 2003 23:23:13 -0000	1.143
  +++ changes.html	20 May 2003 19:11:47 -0000	1.144
  @@ -5,7 +5,6 @@
           
   <!-- start the processing -->
       <!-- ====================================================================== -->
  -    <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
       <!-- Main Page Section -->
       <!-- ====================================================================== -->
       <html>
  @@ -15,7 +14,6 @@
                           
              
                                       
  -                        
               <title>Jetspeed - Jetspeed Changes Log</title>
           </head>
   
  @@ -137,6 +135,9 @@
   </li>
   -->
   <li>
  +  Add -   Bug # 18510 - 2003/05/20 - More fixes to JetspeedL10NTag, by Fabio Latrofa (MO)
  +</li>
  +<li>
     Add -               - 2003/05/19 - added ability to run unit tests with a different set
of properties (DST)
   </li>
   <li>
  @@ -960,7 +961,7 @@
                   </td></tr>
                   <tr><td colspan="2">
                       <div align="center"><font color="#525D76" size="-1"><em>
  -                    Copyright &#169; 1999-2003, Apache Software Foundation
  +                    Copyright &#169; 1999-2002, Apache Software Foundation
                       </em></font></div>
                   </td></tr>
               </table>
  
  
  
  1.38      +1 -3      jakarta-jetspeed/docs/site/usejetspeed.html
  
  Index: usejetspeed.html
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/docs/site/usejetspeed.html,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- usejetspeed.html	19 May 2003 23:23:13 -0000	1.37
  +++ usejetspeed.html	20 May 2003 19:11:47 -0000	1.38
  @@ -5,7 +5,6 @@
           
   <!-- start the processing -->
       <!-- ====================================================================== -->
  -    <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
       <!-- Main Page Section -->
       <!-- ====================================================================== -->
       <html>
  @@ -15,7 +14,6 @@
                           
              
                                       
  -                        
               <title>Jetspeed - Use Jetspeed</title>
           </head>
   
  @@ -246,7 +244,7 @@
                   </td></tr>
                   <tr><td colspan="2">
                       <div align="center"><font color="#525D76" size="-1"><em>
  -                    Copyright &#169; 1999-2003, Apache Software Foundation
  +                    Copyright &#169; 1999-2002, Apache Software Foundation
                       </em></font></div>
                   </td></tr>
               </table>
  
  
  
  1.2       +45 -13    jakarta-jetspeed/src/java/org/apache/jetspeed/services/customlocalization/CustomLocalizationTool.java
  
  Index: CustomLocalizationTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/customlocalization/CustomLocalizationTool.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CustomLocalizationTool.java	14 Nov 2002 20:30:24 -0000	1.1
  +++ CustomLocalizationTool.java	20 May 2003 19:11:47 -0000	1.2
  @@ -1,8 +1,7 @@
  -package org.apache.jetspeed.services.customlocalization;
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
  + * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -51,22 +50,26 @@
    * individuals on behalf of the Apache Software Foundation.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
  - *
  - * @author Dessė Massimiliano
  - * desmax74@yahoo.it
  - * massimiliano.dessi@gruppoatlantis.it
  - * massimiliano.dessi@gruppoatlantis.com
  - * version 1.0  10-2002
  - * jdk 1.4.1
    */
  -import java.io.PrintStream;
  -import java.util.*;
  +package org.apache.jetspeed.services.customlocalization;
  +
  +import java.util.Locale;
  +import java.util.ResourceBundle;
  +import java.util.MissingResourceException;
   import org.apache.turbine.services.pull.ApplicationTool;
   import org.apache.turbine.util.Log;
   import org.apache.turbine.util.RunData;
   
   
   
  +/**
  + * Custom localization tool.
  + *
  + * @author <a href="mailto:desmax74@yahoo.it">Dessė Massimiliano</a>
  + * @author <a href="mailto:massimiliano.dessi@gruppoatlantis.it">Dessė Massimiliano</a>
  + * @author <a href="mailto:massimiliano.dessi@gruppoatlantis.com">Dessė Massimiliano</a>
  + * @version $Id$
  + */
   public class CustomLocalizationTool implements ApplicationTool
   {
   
  @@ -82,13 +85,42 @@
               String s = CustomLocalization.getString(getBundleName(null), getLocale(), key);
               return s;
           }
  -        catch(MissingResourceException noKey)
  +        catch (MissingResourceException noKey)
           {
               Log.error(noKey);
           }
           return null;
       }
   
  +    /**
  +     * Gets localized key from the default bundle and the provided locale.
  +     * Returns <code>null</code> if the resource is missing.
  +     *
  +     * @param key string to translate.
  +     * @param locale prefered locale for translation.
  +     * @return localized key.
  +     */
  +    public String get(String key, Locale locale)
  +    {
  +        if (locale == null)
  +        {
  +            locale = getLocale();
  +        }
  +
  +        String s = null;
  +        try
  +        {
  +            s = CustomLocalization.getString(getBundleName(null), locale, key);
  +        }
  +        catch (MissingResourceException noKey)
  +        {
  +            Log.error(noKey);
  +        }
  +
  +        return s;
  +    }
  +
  +
       public Locale getLocale()
       {
           return locale;
  @@ -101,7 +133,7 @@
   
       public final void init(Object data)
       {
  -        if(data instanceof RunData)
  +        if (data instanceof RunData)
           {
               locale = CustomLocalization.getLocale((RunData)data);
               bundleName = getBundleName(data);
  
  
  
  1.4       +5 -4      jakarta-jetspeed/src/java/org/apache/jetspeed/services/jsp/tags/JetspeedL10NTag.java
  
  Index: JetspeedL10NTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/jsp/tags/JetspeedL10NTag.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JetspeedL10NTag.java	1 May 2003 22:01:08 -0000	1.3
  +++ JetspeedL10NTag.java	20 May 2003 19:11:47 -0000	1.4
  @@ -1,5 +1,3 @@
  -package org.apache.jetspeed.services.jsp.tags;
  -
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  @@ -53,6 +51,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    */
  +package org.apache.jetspeed.services.jsp.tags;
   
   // Servlet API
   import javax.servlet.jsp.JspException;
  @@ -70,6 +69,7 @@
   // Jetspeed support
   import org.apache.jetspeed.services.rundata.JetspeedRunData;
   import org.apache.jetspeed.services.customlocalization.CustomLocalizationTool;
  +import org.apache.jetspeed.services.customlocalization.CustomLocalization;
   
   /**
    * Supporting class for the localization (l10n) tag.
  @@ -128,7 +128,8 @@
   
               try 
               {
  -                String translation = this.tool.get(key);
  +                String translation = this.tool.get(key, CustomLocalization.getLocale(data));
  +								
                   translation = translation == null ? def : translation;
                   result = new StringElement(translation);            
               }
  
  
  
  1.163     +4 -1      jakarta-jetspeed/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/xdocs/changes.xml,v
  retrieving revision 1.162
  retrieving revision 1.163
  diff -u -r1.162 -r1.163
  --- changes.xml	19 May 2003 23:23:21 -0000	1.162
  +++ changes.xml	20 May 2003 19:11:48 -0000	1.163
  @@ -24,6 +24,9 @@
   </li>
   -->
   <li>
  +  Add -   Bug # 18510 - 2003/05/20 - More fixes to JetspeedL10NTag, by Fabio Latrofa (MO)
  +</li>
  +<li>
     Add -               - 2003/05/19 - added ability to run unit tests with a different set
of properties (DST)
   </li>
   <li>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message