[
https://issues.apache.org/jira/browse/FREEMARKER-2?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14975255#comment-14975255
]
Daniel Dekany commented on FREEMARKER-2:
----------------------------------------
Thanks! Looks good so far, but I will review it more closely later, and add it
to the version history.
> 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
>
> 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)