AnsweredAssumed Answered

I18N in Freemarker template

Question asked by geert on Apr 10, 2008
Latest reply on Oct 7, 2008 by joshna
Hello,

I am trying to make my  webscripts available in different languages.
On the wiki I found some information on the message(String) method, but when I try to use it I always get the following error:


Error during processing of the template 'Expression message('error') is undefined on line 25, column 82 in /webclientextension/imagebrowser/image_upload.post.html.status.ftl.'. Please contact your system administrator.

freemarker.core.InvalidReferenceException - Expression message('error') is undefined on line 25, column 82 in /webclientextension/imagebrowser/image_upload.post.html.status.ftl.
   
   freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
   freemarker.core.Expression.getStringValue(Expression.java:118)
   freemarker.core.Expression.getStringValue(Expression.java:93)
   freemarker.core.DollarVariable.accept(DollarVariable.java:76)
   freemarker.core.Environment.visit(Environment.java:196)
   freemarker.core.MixedContent.accept(MixedContent.java:92)
   freemarker.core.Environment.visit(Environment.java:196)
   freemarker.core.Environment.process(Environment.java:176)
   freemarker.template.Template.process(Template.java:232)
   org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:201)
   org.alfresco.web.scripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:286)
   org.alfresco.web.scripts.AbstractWebScript.sendStatus(AbstractWebScript.java:355)
   org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:193)
   org.alfresco.repo.web.scripts.RepositoryContainer$1.execute(RepositoryContainer.java:311)
   org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:236)
   org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:166)
   org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:322)
   org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:266)
   org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:240)
   org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:139)
   org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:111)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   org.alfresco.web.app.servlet.MTWebScriptAuthenticationFilter.doFilter(MTWebScriptAuthenticationFilter.java:102)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
   org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
   java.lang.Thread.run(Thread.java:595)

I use the message tag as follows in my ftl file:
${message('error')}

When I leave the message methods everything works perfect so normally my webscript configuration is correct.
I am using Alfresco Community 2.9.0C.

If you need more information, feel free to ask.

Thanks in advance!

Geert

Outcomes