You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Fabrizio Scarcello <fa...@gmail.com> on 2010/06/12 17:01:39 UTC

Localized content loading problem

Hi again,
i have some difficult to use the Internationalization support: i load some
content in an xml document, within the /apps node; the content is loaded,
but when i ask to the request ResourceBundle the actual message relative to
a key, it responds with the key itself (as the default implementation in
SlingHttpServletRequestImpl, according to the doc at
http://sling.apache.org/site/internationalization-support-i18n.html).
The sling.i18n bundle is active (i'm using the last version from svn), i
checked the class of the ResourceBundle returned from the
SlingHttpServletRequest and it's a
 org.apache.sling.i18n.impl.JcrResourceBundle, but when i invoke the
getString(key) method it returns just the key parameter, not the relative
message.

I think the problem is content loading (the ResourceBundle getKeys() method
returns an empty Enumeration), but i cannot see the error. Here is the very
simple content i'm loading:

<node>
    <name>i18n</name>
    <node>
    <name>it</name>
    <mixinNodeType>mix:language</mixinNodeType>
    <property><name>jcr:language</name><value>it</value></property>
    <node><name>m1</name>
     <property><name>sling:key</name><value>hello</value></property>
     <property><name>sling:message</name><value>Ciao</value></property>
     </node>
</node>
<node>
     <name>en</name>
    <mixinNodeType>mix:language</mixinNodeType>
    <property><name>jcr:language</name><value>en</value></property>
    <node><name>m1</name>
     <property><name>sling:key</name><value>hello</value></property>
     <property><name>sling:message</name><value>Hello</value></property>
     </node>
</node>
</node>

Also i noted that, specifying a sling:message mixin type (or a
sling:messageEntry primary node type), the content is not loaded and the log
shows an exception starting
with: org.apache.sling.jcr.contentloader.internal.Loader Cannot load initial
content for bundle com.hictech.hicsling : {
http://sling.apache.org/jcr/sling/1.0}messagejavax.jcr.nodetype.NoSuchNodeTypeException:
{
http://sling.apache.org/jcr/sling/1.0}message
 at
org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.getEffectiveNodeType(NodeTypeRegistry.java:996)....

Where my error can be?

Thanks and greetings,
Fabrizio Scarcello.