Welcome to WebmasterWorld Guest from 107.20.59.213

Forum Moderators: incrediBILL

Message Too Old, No Replies

How can different languages be displayed on the same web page

     

ikeen107

4:32 pm on Jul 5, 2007 (gmt 0)

10+ Year Member



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

4:55 pm on Jul 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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

4:59 pm on Jul 5, 2007 (gmt 0)

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



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:02 pm on Jul 5, 2007 (gmt 0)

10+ Year Member



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:04 pm on Jul 5, 2007 (gmt 0)

10+ Year Member



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

5:08 pm on Jul 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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:14 pm on Jul 5, 2007 (gmt 0)

10+ Year Member



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

5:22 pm on Jul 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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

Marshall

ikeen107

5:26 pm on Jul 5, 2007 (gmt 0)

10+ Year Member



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

6:41 pm on Jul 5, 2007 (gmt 0)

5+ Year Member



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

7:43 pm on Jul 5, 2007 (gmt 0)

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



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

7:52 pm on Jul 5, 2007 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



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

11:11 pm on Jul 5, 2007 (gmt 0)

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



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

11:26 pm on Jul 5, 2007 (gmt 0)

10+ Year Member



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

 

Featured Threads

Hot Threads This Week

Hot Threads This Month