In your freemarker template:
${i18n['my.edit.button.key']} - for this and more example, have a look at the
FreemarkerHelperTest [1] (starting with
testSimpleI18NMessageCanBeUsedInTemplates()) and the javadoc of MessagesWrapper
[2]
This will by default use the message bundle linked with your template/paragraph
(i18nBasename)
... but I also believe that this how the edit bar works by default. Simply pass
your key in the editLabel property of the tag.
hth,
-g
[1]
http://svn.magnolia-cms.com/view/community/magnolia/trunk/magnolia-core/src/test/java/info/magnolia/freemarker/FreemarkerHelperTest.java?view=annotate
[2]
http://dev.magnolia-cms.com/ref/4.1/magnolia-core/apidocs/info/magnolia/freemarker/MessagesWrapper.html
----- Original Message -----
From: Bert Leunis
[mailto:[email protected]]
To: Magnolia User-List
[mailto:[email protected]]
Sent: Fri, 31 Jul 2009 15:41:52
+0200
Subject: RE: [magnolia-user] jstl taglib not loaded using
freemarker
>
> Hi Grégory,
>
> Thanks for the answer. Sometimes on editbars it is much more clear to have a
> label like "Edit polaroid collection" instead of just "Edit". For a
> multilingual approach this message should come from a messages.properties
> file. So I want to get that property, and put it as the label on the button.
> Much as the example I referred to, and as mentioned in the jira 1401.
>
> If you can suggest a freemarker-ish way that works better, you are most
> welcome!
>
> Regards, Bert
>
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Grégory Joseph
> Sent: vrijdag 31 juli 2009 15:19
> To: Magnolia User-List
> Subject: Re: [magnolia-user] jstl taglib not loaded using freemarker
>
>
> a two-fold response:
> 1) there is most likely a more freemarker-ish approach to do whatever it is
> you're trying to do ;) Which tag do you need to use? to do what ?
> 2) i don't remember the specifics by heart, but there are some quirks with
> taglib uris sometimes - I knew Chris Miner tackled that quite some time ago
> - have a look at MAGNOLIA-1401 [1], there's even an example where he seems
> to be succesfully using the jstl/fmt taglib !
>
> Regarding the page you're mentioning - i think it's quite outdated; we don't
> use jstl anywhere in Magnolia anymore, afaik.
>
> Cheers,
>
> -g
>
> [1] http://jira.magnolia-cms.com/browse/MAGNOLIA-1401
>
>
> ----- Original Message -----
> From: Bert Leunis
> [mailto:[email protected]]
> To: Magnolia User-List
> [mailto:[email protected]]
> Sent: Fri, 31 Jul 2009 15:00:25
> +0200
> Subject: [magnolia-user] jstl taglib not loaded using freemarker
>
>
> > Hello,
> >
> > Inspired by this page:
> > http://wiki.magnolia-cms.com/display/WIKI/I18n+Developer+Information
> >
> > I try to use the jstl/fmt taglib in freemarker, but the taglib is not
> > recognized or loaded.
> >
> > To load the taglib I use this line:
> > [#assign fmt=JspTaglibs["http://java.sun.com/jstl/fmt"]]
> >
> > I placed the jstl-1.1.2.jar in WEB-INF/lib so freemarker can load it.
> > The error I get is:
> >
> > Error on line 1, column 1 in tcn/panels/visuals/polaroid_container.ftl
> > JspTaglibs["http://java.sun.com/jstl/fmt"] is undefined.
> > It cannot be assigned to fmt
> > The problematic instruction:
> > ----------
> > ==> assignment: fmt=JspTaglibs["http://java.sun.com/jstl/fmt"] [on line 1,
> > column 1 in tcn/panels/visuals/polaroid_container.ftl]
> > ----------
> >
> > Java backtrace for programmers:
> > ----------
> > freemarker.core.InvalidReferenceException: Error on line 1, column 1 in
> > tcn/panels/visuals/polaroid_container.ftl
> > JspTaglibs["http://java.sun.com/jstl/fmt"] is undefined.
> > It cannot be assigned to fmt
> >
> > What can I do to work with this taglib?
> >
> > Regards, Bert
> >
> >
> > ----------------------------------------------------------------
> > For list details see
> > http://www.magnolia-cms.com/home/community/mailing-lists.html
> > To unsubscribe, E-mail to: <[email protected]>
> > ----------------------------------------------------------------
> >
> >
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
>
>
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
>
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------