Re: coming along nicely

Attila Szegedi <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
On 2008.11.03., at 7:07, Luther Baker wrote:

>
> All of this works just fine ... but when I echo values from the  
> resourceBundle in the template, it doesn't work for anything nested  
> one or more level deep:
>
> IE:
>
> # Contact.properties
> [email protected]
> [email protected]
>
> Contact.ftl
>         <ul>
>             <li>${msg.faq}</li>
>             <li>${msg.email.tutorial}</li>
>         </ul>
>
>
> Now, <li>${msg.faq}</li> shows up just fine but <li>$ 
> {msg.email.tutorial}</li> is a problem:
>
> No such key: email
> The problematic instruction:
> ----------
> ==> ${msg.email.tutorial} [on line 13, column 29 in support/ 
> Contact.ftl]

Namespace of properties inside of a resource bundle is not  
hierarchical -- dot is just another character. $ 
{msg["email.tutorial"]} will work. You could write a model class that  
pre-reads the bundle and builds a hiearchy of maps though; we don't  
provide this functionality out of the box though.

Attila.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.