开发者

how do i get a domain to trigger i18n in django

开发者 https://www.devze.com 2023-03-09 13:21 出处:网络
So over the last few weeks I have been preparing a few different languages for our platform and was wondering how you go about getting a do开发者_如何学Cmain name to activate a certain language?

So over the last few weeks I have been preparing a few different languages for our platform and was wondering how you go about getting a do开发者_如何学Cmain name to activate a certain language?

For instance, if I have site with 5 languages.

Swedish, English, Norwegian, Danish and Finnish

and one of my users visit the www.domainname.se I want it to trigger the swedish part.

Any tips?


With httpd, just use RequestHeader to frob the Accept-Language header for the virtual host, since Django looks at it to discover language preference.

RequestHeader append Accept-Language sv-se
0

精彩评论

暂无评论...
验证码 换一张
取 消