[ 
https://issues.apache.org/jira/browse/FREEMARKER-2?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14973269#comment-14973269
 ] 

ASF GitHub Bot commented on FREEMARKER-2:
-----------------------------------------

GitHub user woonsan opened a pull request:

    https://github.com/apache/incubator-freemarker/pull/7

    FREEMARKER-2 adding 'OverrideResponseLocale' init param option

    in FreemarkerServlet

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/woonsan/incubator-freemarker 
feature/FREEMARKER-2-option-request-locale

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-freemarker/pull/7.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #7
    
----
commit 1e4c64f1c0230ec9f6ddc70fed6e142d3b8199ca
Author: Woonsan Ko <[email protected]>
Date:   2015-10-25T14:41:04Z

    FREEMARKER-2 adding 'OverrideResponseLocale' init param option in
    FreemarkerServlet

----


> 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)

Reply via email to