In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the relevant knowledge of "Nginx how to configure page jump according to different browser languages". The editor shows you the operation process through an actual case. The method of operation is simple and fast, and it is practical. I hope this article "Nginx how to configure page jump according to different browser languages" can help you solve the problem.
Simplified and traditional Chinese judgment
I would like to provide simplified or traditional documents according to the accept-language decision of the first part of http. In chrome, chrome://settings/languages can set the preferred language, and the browser will set the accept-language header accordingly. The better way to handle this is to parse the field, get the qvalue, and choose the most appropriate language according to the priority. But only to support simplified and traditional Chinese, I want to use a trick: ignore priority, as long as the words zh-hant, zh-tw, zh-hk and other words appear in accept-language, return traditional Chinese, otherwise return simplified Chinese.
Map $http_accept_language $lang {default zhs; ~ zh-hant zht; ~ zh-tw zht; ~ zh-hk zht;}
I use hexo to generate the website, and the source files are written in traditional Chinese. For the 2015-10-06-nginx-accept-language-zhs-zht.html generated by hexo generate, the simplified version: 2015-10-06-nginx-accept-language-zhs-zht.html.zhs.html is obtained by opencc conversion. Other files need to be converted as appropriate, such as atom.xml and popular.json, which provides the "read most articles" feature.
# zshcd ~ / maskray.me/publicopencc-c t2s.json-I atom.xml-o atom.xml.zhs.xmlfor I in * * / * .cml`; do # Select the file that needs to be supported in simplified and traditional Chinese, I} / / [^%] /} # calculate the number of occurrences of the substring `.html` if (($c)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.