Helmet Posted March 31, 2008 Share Posted March 31, 2008 Hi, I'm wondering if anyone knows if it's possible to have multiple languages (and fonts, ie chinese + russian+ english) on a single page? I haven't delved into this before so I don't know the considerations. I would prefer to use actual font text as opposed to images of text for seo purposes, though I realize this could be a tall order. Any pointing in the right direction would be appreciated. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/98841-multiple-languages-on-one-page/ Share on other sites More sharing options...
bronzemonkey Posted March 31, 2008 Share Posted March 31, 2008 Yeah that's possible. Make sure your server has the appropriate charset set (utf-8 is a safe bet), that your html head element also uses the same charset, and that where ever you use a different language you include the lang attribute in the containing element. You can even specific the text direction should the language read right-to-left. /*server charset must be utf-8*/ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> </head> <body> <div id="blah" lang="en">Blah blah</div> <div id="blah" lang="he" dir="rtl">Blah blah</div> <!-- makes the text direction right-to-left --> <div id="blah" lang="fr">Blah blah</div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/98841-multiple-languages-on-one-page/#findComment-505865 Share on other sites More sharing options...
Helmet Posted March 31, 2008 Author Share Posted March 31, 2008 Thanks Bronzemonkey, for your reply. Does this mean that the font itself is chosen by the browser automatically? To my knowledge modern operating systems have a variety of preinstalled foreign fonts, so this is not a difficult or risky thing to implement? Quote Link to comment https://forums.phpfreaks.com/topic/98841-multiple-languages-on-one-page/#findComment-505891 Share on other sites More sharing options...
haku Posted April 1, 2008 Share Posted April 1, 2008 That's what it means, but you can set your preferred fontsets using CSS. Here's an article that can start you off: http://www.w3.org/International/questions/qa-css-lang Quote Link to comment https://forums.phpfreaks.com/topic/98841-multiple-languages-on-one-page/#findComment-506149 Share on other sites More sharing options...
Helmet Posted April 1, 2008 Author Share Posted April 1, 2008 Awesome, thank you.. I have my bearings now! Quote Link to comment https://forums.phpfreaks.com/topic/98841-multiple-languages-on-one-page/#findComment-506190 Share on other sites More sharing options...
Helmet Posted April 1, 2008 Author Share Posted April 1, 2008 For anyone who's interested, here's a list of country codes for the lang attribute: http://www.iana.org/assignments/language-subtag-registry Quote Link to comment https://forums.phpfreaks.com/topic/98841-multiple-languages-on-one-page/#findComment-506705 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.