Question

@(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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top