Jump to content

Multiple languages on one page


Helmet

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/98841-multiple-languages-on-one-page/
Share on other sites

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.