Add the HTML lang attribute

The Roblox site is currently missing a global lang attribute in the html tag.


The consequences of the attribute being missing are not easily noticed, but they do exist. More specifically, they are mainly related to CJK handling.

This is explained very well by FAQ - Chinese and Japanese but I’ll also give a quick tl;dr: many characters are shared between Japanese and Chinese, and people from different countries will write them with a different standard. That is, Japan, Taiwan, and China (as well as Hong Kong, Korea, etc., to a “lesser” extent) all have their own standards of writing a character.

Modern operating systems ship with multiple CJK fonts, each with their own preferred “standard” being followed, according to the target audience. Browsers rely on the lang attribute being present within the html tag to determine which fonts to fall back to. Otherwise, things get spooky really fast. If you know Japanese, imagine Japanese being rendered with SimSun… it’s not good.

The Roblox client already handles this very well by shipping Noto Sans CJK and switching between the different standards according to the language code that gets passed in upon startup (presumably via the voodoo magic GSUB table feature within OpenType). The only missing piece is the website, now.


It seems that the language code of the user’s locale is already stored in a meta tag called locale-data, but the site prefers underscores over dashes. My guess is that this would probably be somewhat easy to do.

image

In the <html> tag, add the lang attribute. Replace the underscores from the locale-data language code with dashes and use that as the value for the attribute, like <html lang="zh-tw">.

12 Likes