Forum Discussion
Changing interface language explicitly regardless of HTTP header
Hello Everyone,
I would like to change a page's language explicitly - regardless of what is sent in the HTTP header. A practical example is that I need to show English by default and have a link in the page to French language interface. I need this both in the login page, and in the webtop.
I also need to detect what language is being displayed and change URLs based on that.
Any help is appreciated.
Thanks,
Farsheed
2 Replies
- David__Pasch
Altostratus
While I have not tried this, I would think you could use "HTTP::header replace" to modify the "Accept-Language:" portion of the HTTP Header in all requests, specifying ONLY the language you want.
HTTP::header replace []
Good luck!
David
- Kevin_Stewart
Employee
David's right on the money with HTTP::header replace:
HTTP::header replace "Accept-Language" "en"This can be used in a request or response, but in this case you'd be replacing a request header. As for performing URI-switching logic based on the requested language:
when HTTP_REQUEST { switch [HTTP::header "Accept-Language" { "en" { HTTP::uri "/en/something/" } "fr" { HTTP::uri "/fr/something" } ... } }You mentioned a "webtop", so if this is being used with APM, replace HTTP_REQUEST with ACCESS_ACL_ALLOWED.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com