Hi,

This is stuff we're pretty much used to deal with on a daily basis, here in 
Belgium. We have 3 national languages : Dutch, German, and French.

Not only do we do this on websites but also in regular software in which 
dynamic switching between languages should be possible, or printing in French 
while the interface is displayed in Dutch.

Here you were talking about displaying the content simultaneously in Englisg 
and German. This is definitely easier to manage than dynamic language switching.

The way I used to deal with this issue was to store all my content in a 
database and extract the text from one field or another (msg_fr, msg_de, or 
msg_en) based on the current language of the user. You can also achieve the 
same thing via external text files that you include in your main page (for 
example you have a page called mypage.php ... and this would include the 
content of mypage.php.de.txt if German is what you need or mypage.php.en.txt if 
English is required.

The language of the user is usually stored in a cookie and you should apply a 
default language to a page.

When you display the information, please mark your paragraphs with the 
appropriate lang attribute: either <p xml:lang="de">...</p> (XHTML 1.1) or <p 
lang="de"> (HTML 1.0). Please notice that your main page should be marked with 
a language attribute too :

<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en"> (XHTML 1.1)

or

<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"> (XHTML 1.0)

Mark the paragraphs with their language attribute only if they differ from the 
default language of the page.

You can easily decide to hide text in a certain language via CSS: *[lang="en"] 
{ display:none }. But this will NOT work with IE unfortunately.

By using the lang attribute on your paragraphs, you will ease the pain of the 
search engines.

If you want to implement dynamic language switching, you will have to implement 
a mechanism such as a link to a page that will update the cookie of the user: 
changelang.php?lang=en or changelang.php?lang=de. What thsi page does is very 
simple : it updates the cookie of the user and then gets back to the HTTP 
referrer (the page we're coming from so that it gets redisplayed). However, 
this can create some accessibility problems because it breaks the "back" 
sequence. Also, there may be some issues to solve with caching.


Hope this helps

Pat


-----Original Message-----
hi all

this is the first time I've done anything like this but I'm wondering what it 
takes to display two languages (and therefore two charsets) on the same page? - 
English and German

the content will be a side-by-side translation of each language

thanx
barry.b

PS: no doubt I'll have more questions later but I'm starting from the display 
and working backwards  to the content storage (ensuring the database can 
support unicode, etc) and then the content "capture" (a form in either English 
and German)
******************************************************
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
****************************************************** 

******************************************************
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
******************************************************

Reply via email to