<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>multilingual on nanmu42</title><link>https://nanmu.me/en/tags/multilingual/</link><description>Recent content in multilingual on nanmu42</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>i@nanmu.me (nanmu42)</managingEditor><webMaster>i@nanmu.me (nanmu42)</webMaster><copyright>Copyright &amp;copy;{year} LI Zhennan</copyright><lastBuildDate>Sun, 15 Mar 2020 14:07:48 +0800</lastBuildDate><sy:updatePeriod>weekly</sy:updatePeriod><sy:updateFrequency>weekly</sy:updateFrequency><atom:link href="https://nanmu.me/en/tags/multilingual/index.xml" rel="self" type="application/rss+xml"/><item><title>Hugo i18n Automatic Language Redirection</title><link>https://nanmu.me/en/posts/2020/hugo-i18n-automatic-language-redirection/</link><pubDate>Sun, 15 Mar 2020 14:07:48 +0800</pubDate><author>i@nanmu.me (nanmu42)</author><atom:modified>Tue, 06 Aug 2024 10:39:07 +0800</atom:modified><guid>https://nanmu.me/en/posts/2020/hugo-i18n-automatic-language-redirection/</guid><description>Hugo has really neat support for i18n. Unfortunately, it does not provide a straitforward way to redirect your visitors automatically according to their web browser language preferences. The good news is that Hugo authors leave a window open for solving this problem.
The Problem My site is running on two languages: English and Chinese. I have defaultContentLanguageInSubdir set to true and defaultContentLanguage set to en. When visitors came to root / of my site, their web browsers got following response:</description><dc:creator>nanmu42</dc:creator><category>hugo</category><category>i18n</category><category>multilingual</category><category>Notes and Discussions</category></item></channel></rss>