You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set lang and dir attributes on tweet bodies (#170)
Tweets can be written in different languages. Language metadata is
essential for browsers to correctly render multilingual texts because
the different language uses different shapes of glyphs for the same
Unicode codepoints, and the browsers must select fonts based on the
intended language[^1].
Twitter API infers the primary language of each tweet, and this patch
sets the `lang` attribute to the inferred language for the tweet
bodies. `dir="auto"` is also necessary for proper rendering of texts
in the right-to-left languages, such as Arabic, Hebrew, and Persian.
[^1]: Regarding font selection in CJK languages: <https://heistak.github.io/your-code-displays-japanese-wrong/>.
0 commit comments