Setting language, including text direction, in HTML

Hey again Melancon, I’ve got a quick HTML/CSS question for you. Translations of the info pamphlet are starting to roll in. I’m going to send Jill new HTML files for them…but the three we’ve gotten so far are Russian, Arabic, and Serbo-Croatian. In other words, I’ll need to make sure fonts are available for Cyrillic and Arabic scripts/formatting. I’m pretty sure all the diacritical marks/special characters needed for Serbo-Croatian are already in the Calibri font you set up for the English, but I might be wrong.

Any advice for me? No stress no rush ofc. Hope you’re doing well.

no particular advice; a widely used font like that should have everything. Should set language and right-to-left in the header metada [i misspoke here; the info should be added directly to the html element]

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language

And https://www.w3.org/International/questions/qa-html-dir

TLDR change the top to: <html lang="ar" dir="rtl">

for Arabic and any other right-to-left language (pretty sure that’s it on your list). Official place to look up language codes so you know Arabic really is ‘ar’ is https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry but any random thing you find online will probably be correct


Some resources that helped me along the way, getting to the more authoritative links above:

https://teamtreehouse.com/community/multilanguage-website-using-html

https://www.w3schools.com/cssref/pr_text_direction.asp