Invalid lang tags on "underlined" locales


(Mingye Wang) #1

Locales like zh_CN and zh_TW seems to simply copy to the root-level HTML lang attribute, causing malformed values with underlines in it. The practical downside to it is that the CSS :lang(zh) selector simply won’t work, as it expects locale names with hyphens (-) instead of underlines (_). Can someone just make a fix to force-reformat the lang attribute to have hyphens instead of underlines?


For zh_CN and zh_TW specifically, there are some additional locale name changes required per https://www.iana.org/assignments/lang-tags/zh-Hans-CN. Missing that doesn’t break too many things though.


(Gerhard Schlager) #3

FIX: HTML lang attribute expects hyphen instead of underscore · discourse/discourse@cc851af · GitHub


(Gerhard Schlager) #4