homepage Welcome to WebmasterWorld Guest from 54.197.211.197
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
How can different languages be displayed on the same web page
ikeen107

5+ Year Member



 
Msg#: 3387041 posted 4:32 pm on Jul 5, 2007 (gmt 0)

Hi all,

I would like to dispay three different languages on a web page? Could you please advice how to do that.

Thank you in advance for all experts here!

Cheers

Ikeen107

 

Marshall

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3387041 posted 4:55 pm on Jul 5, 2007 (gmt 0)

You could use meta tags for each language:

<META HTTP-EQUIV="Content-Language" content="EN">

or inline tags such as:
<p lang="en">Her super-powers were the result of &gamma;-radiation, he explained.</p>

-or-

<p>Some text <span lang="en">Her super-powers were the result of &gamma;-radiation</span>, he explained.</p>

Marshall

penders

WebmasterWorld Senior Member penders us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



 
Msg#: 3387041 posted 4:59 pm on Jul 5, 2007 (gmt 0)

You could use meta tags for each language:
<META HTTP-EQUIV="Content-Language" content="EN">

But just 1 "Content-Language" meta tag per page though?!

ikeen107

5+ Year Member



 
Msg#: 3387041 posted 5:02 pm on Jul 5, 2007 (gmt 0)

Thanks for your quick response. But I am not sure what you mean. Can you give examples of how to display text in Russian and Chinese?

Cheers

Ikeen107

ikeen107

5+ Year Member



 
Msg#: 3387041 posted 5:04 pm on Jul 5, 2007 (gmt 0)

Using meta tags may be for displaying the same language on the same page. What is about displaying two or three different languages on the same pages?

I appreciate your advice.

Cheers

ikeen107

Marshall

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3387041 posted 5:08 pm on Jul 5, 2007 (gmt 0)

Unless I am misunderstanding you, put an inline language tag like I put above. In your case say:
<p lang="ru">Some Russian text</p> (not sure if the "ru" is the correct abbreviation)

Is this what you mean?

Marshall

ikeen107

5+ Year Member



 
Msg#: 3387041 posted 5:14 pm on Jul 5, 2007 (gmt 0)

I think there might be another way to display different languages on the same page using uni codes something like that in a meta tag? I am not sure as I did not have enough time researching on that. It might be quicker to get responses from all you guys experts.

I appreciate any advice.

Cheers

Ikeen107

Marshall

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3387041 posted 5:22 pm on Jul 5, 2007 (gmt 0)

Are you talking about actually writing the language on the page?

Marshall

ikeen107

5+ Year Member



 
Msg#: 3387041 posted 5:26 pm on Jul 5, 2007 (gmt 0)

Yes. Let say one webpage allow to write or display different languages. How can they use Uni codes in Meta tag to do that?

Cheers

Petra Kaiser

5+ Year Member



 
Msg#: 3387041 posted 6:41 pm on Jul 5, 2007 (gmt 0)

For pages with russian elements we use charset=windows-1251
and encode every character &#1073;&#1086;&#1088;&#1082;&#1091;
as well for body content and also for tags
For date and time in php we use setlocale(, 'ru_RU');
Seems a fail safe way to do

tedster

WebmasterWorld Senior Member tedster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3387041 posted 7:43 pm on Jul 5, 2007 (gmt 0)

Unicode is not an html-only solution - the web server must also actually SERVE unicode. A meta tag alone will not work if the server doesn't say it's sending unicode in the header that it sends out.

londrum

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 3387041 posted 7:52 pm on Jul 5, 2007 (gmt 0)

to make your server send the correct header, include this at the top of your page:

<?php
header('Content-Type: text/html; charset=UTF-8');
?>

phranque

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 3387041 posted 11:11 pm on Jul 5, 2007 (gmt 0)

if your content is stored in a database, the text in the db will also have to be in unicode.
this reference on latin1 to utf8 conversion [oreillynet.com] contains some useful information that will help you set up for multiple language support.

[edited by: encyclo at 11:17 pm (utc) on July 5, 2007]
[edit reason] fixed link [/edit]

ikeen107

5+ Year Member



 
Msg#: 3387041 posted 11:26 pm on Jul 5, 2007 (gmt 0)

Many thanks for prompt responses. So if I like to write a webpage with supporting multiple languages (in another word, a web page that can display different languages such as English, Russian, Chinese, Japanese, etc.), I will need to

-include a piece of uni code utf8 in a meta tag
-configure the web server to interpret/render HTML codes as text with relevant language?

Could anyone give a sample codes of how to do that, let say I want a single web page to display English, Russian and Chinese texts at the same time?

I appreciate any advice from all of you.

Cheers

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved