You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by "Daniel Dekany (JIRA)" <ji...@apache.org> on 2015/11/01 11:34:27 UTC

[jira] [Resolved] (FREEMARKER-2) Option to set request locale from the given servlet request

     [ https://issues.apache.org/jira/browse/FREEMARKER-2?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Dekany resolved FREEMARKER-2.
------------------------------------
    Resolution: Fixed

> Option to set request locale from the given servlet request
> -----------------------------------------------------------
>
>                 Key: FREEMARKER-2
>                 URL: https://issues.apache.org/jira/browse/FREEMARKER-2
>             Project: Apache Freemarker
>          Issue Type: Improvement
>            Reporter: Woonsan Ko
>            Priority: Minor
>             Fix For: 2.3.24
>
>
> Currently templates are executed with a specific global locale all the time because FreemarkerServlet.deduceLocale() uses config.getLocale().
> This can result in wrong date/currency formatting issue for instance (when using JSTL tags).
> It should be able to read HttpServletRequest#getLocale().
> Normally web application frameworks sets the request locale before rendering a view.
> Daniel's remark on this in old ML:
> {quote}
> Then, I think, the default implementation of deduceLocale() should take the a new init-param into account, let's call it "LocaleFromRequest". The default of that should be false for backward compatibility. But if someone sets that setting to true, and the request locale isn't null, we use that instead of the Freemarker Configuration setting. And here again, you could override what the
> *default* is.
> Just like with "OverrideResponseContentType", the default can depend
> on the IcI on the long run.
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)