当前位置: 动力学知识库 > 问答 > 编程问答 >

java - not fetching correct value of PLAY_LANG

问题描述:

@(implicit session:play.api.mvc.Session,lang:play.api.i18n.Lang)

@lang.code gives the PLAY_LANG cookie value of language of user,i stored en-US in cookie but it is returning en-IN IN is for India where i am. why it is taking this, how to remove it. and this is happening on a particular template, otherwise on other templates its work fine.

because of this my i18n is not working on template.

I am using scala with play framework 2.2

网友答案:

if @lang.code returning the en-IN, it means its giving you .defaultLang in place of .code, may be you are using a variable of lang name also in your controller.and you confused the play so it is taking .defaultLang, which is returning en-IN.

make sure no variable name should be lang and the problem will be solved.

分享给朋友:
您可能感兴趣的文章:
随机阅读: