lenya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andr...@apache.org
Subject cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/publication DefaultDocumentBuilder.java
Date Tue, 05 Aug 2003 14:53:31 GMT
andreas     2003/08/05 07:53:30

  Modified:    src/java/org/apache/lenya/cms/publication
                        DefaultDocumentBuilder.java
  Log:
  using only 2 last letters for language suffix
  
  Revision  Changes    Path
  1.9       +5 -6      cocoon-lenya/src/java/org/apache/lenya/cms/publication/DefaultDocumentBuilder.java
  
  Index: DefaultDocumentBuilder.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/publication/DefaultDocumentBuilder.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DefaultDocumentBuilder.java	30 Jul 2003 15:03:24 -0000	1.8
  +++ DefaultDocumentBuilder.java	5 Aug 2003 14:53:27 -0000	1.9
  @@ -129,13 +129,12 @@
        * @return A string.
        */
       protected String getLanguage(String urlWithoutSuffix) {
  -        int startOfLanguage = urlWithoutSuffix.lastIndexOf('_');
  +        
           String suffix = "";
  -
  -        if ((startOfLanguage > -1) && !urlWithoutSuffix.endsWith("_")) {
  -            suffix = urlWithoutSuffix.substring(startOfLanguage + 1);
  +        String url = urlWithoutSuffix;
  +        if (url.length() >= 3 && url.charAt(url.length() - 3) == '_') {
  +            suffix = url.substring(url.length() - 2);
           }
  -
           return suffix;
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org


Mime
View raw message