incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r830127 - /sling/trunk/contrib/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java
Date Tue, 27 Oct 2009 10:47:20 GMT
Author: bdelacretaz
Date: Tue Oct 27 10:47:19 2009
New Revision: 830127

URL: http://svn.apache.org/viewvc?rev=830127&view=rev
Log:
SLING-1131 - i18n: do not enforce a flat node hierarchy below mix:language - contributed by
Alex Klimetschek, thanks!

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

Modified: sling/trunk/contrib/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java?rev=830127&r1=830126&r2=830127&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java
(original)
+++ sling/trunk/contrib/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java
Tue Oct 27 10:47:19 2009
@@ -42,11 +42,23 @@
 
     private static final String PROP_BASENAME = "sling:basename";
 
-    private static final String QUERY_BASE = "//element(*,mix:language)[@jcr:language='%s'%s]/*";
-
-    private static final String QUERY_LOAD_FULLY = QUERY_BASE + "/(@"
-        + PROP_KEY + "|@" + PROP_VALUE + ")";
-
+    /**
+     * Search the tree below a mix:language node matching a given language...
+     */
+    private static final String QUERY_BASE =
+        "//element(*,mix:language)[@jcr:language='%s'%s]//*";
+
+    /**
+     * ... and find all nodes with a sling:message property set
+     * (typically with mixin sling:Message).
+     */
+    private static final String QUERY_LOAD_FULLY = QUERY_BASE
+        + "[@" + PROP_VALUE + "]/@" + PROP_VALUE;
+
+    /**
+     * ... or find a node with the message (sling:message property) for
+     * a given key (sling:key property).
+     */
     private static final String QUERY_LOAD_RESOURCE = QUERY_BASE + "[@"
         + PROP_KEY + "='%s']/@" + PROP_VALUE;
 



Mime
View raw message