Jump to content

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>

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.