incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r711247 - /incubator/sling/trunk/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java
Date Tue, 04 Nov 2008 13:30:28 GMT
Author: fmeschbe
Date: Tue Nov  4 05:30:27 2008
New Revision: 711247

URL: http://svn.apache.org/viewvc?rev=711247&view=rev
Log:
SLING-717 Use node name as the message key if the sling:key
property is missing.

Modified:
    incubator/sling/trunk/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java

Modified: incubator/sling/trunk/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java?rev=711247&r1=711246&r2=711247&view=diff
==============================================================================
--- incubator/sling/trunk/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java
(original)
+++ incubator/sling/trunk/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java
Tue Nov  4 05:30:27 2008
@@ -30,6 +30,7 @@
 import javax.jcr.query.Query;
 
 import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceUtil;
 
 public class JcrResourceBundle extends ResourceBundle {
 
@@ -121,6 +122,10 @@
                 String jcrPath = (String) row.get(JCR_PATH);
                 String key = (String) row.get(PROP_KEY);
 
+                if (key == null) {
+                    key = ResourceUtil.getName(jcrPath);
+                }
+                
                 Map<String, Object> dst = rest;
                 for (int i = 0; i < path.length; i++) {
                     if (jcrPath.startsWith(path[i])) {



Mime
View raw message