Jump to content
Killersites Forums

2 languages in 1 document


Recommended Posts

Dear Colleagues,

 

Could anybody help with following cross-language issue?

 

It would be needed that the same page display text in different languages e.g. there are some introduction in my native latvian using charset=windows-1257, then there are few sentences in russian using charset=windows-1251, then again latvian and so on.

 

I tried to put charset and lang attributes in different tags (with and without meta charset definition in head), still nothing produced desired results - there are correctly rendered only one language, another being mess of scrawls.

 

I was suggested utf-8 to be some sort of solution, still there are an other problem - for some unknown reason browsers (at least in our country) often does not render it properly. In our practice only proven charsets rendering 100% correct characters so far is windows-1257 for latvian and windows-1251 for russian.

 

I would be very thankful for any ideas.

 

Walc

Link to post
Share on other sites

Be careful with iframes. They have limitations as I have discovered.

They don't validate as XHTML 1.0 Strict, so use a Transitional doctype when creating the page.

The iframe is ignored on most Blackberry portable devices. A minor problem for me since many of my customers use a Blackberry, minimized because the ifame content was non-critical information, just a bonus feature.

Link to post
Share on other sites

Thanks! No biggy, then you only get the default language (in this case English). The spanish one still stays hidden. With that particular script I think you can only do one alternate (don't remember). So if you needed more languages you would need to search out a different script. But the basic premise remains the same.

Edited by Eric
Link to post
Share on other sites

Pretty cool Eric. I do not know JavaScript, but understand the premise. I'm hitting the books again, so to speak and tiring to understand how this will solve walc's problem of needing different languages on the same page. Could you please explain in more detail how this would work in his situation. I see that you have displayed both English and Spanish switching the style sheets, but both pages are using the utf-8 charset. Wouldn't you need to change the charset for each language along with a different style sheet, since the utf-8 is not working for him in his country?

 

Is the utf-8 charset suppose to work with most all languages? There is another resent post by Roman to where he is also having trouble with this charset displaying the text properly. Thanks Mark

Link to post
Share on other sites

I've looked into this a little bit. Aside from my link above, and another static HTML page, there are two other solid ways to do this. One, wih php. Google shows lots of results, they all seem to be doable but not simple - hard infact. Two, and probably the easiest and best of the bunch, "Google Translate". You simply add a small snippit of google supplied code to your site and it automatically translates it to any language. http://www.visibilityinherit.com/projects/multilingual-website-demo2.php

Link to post
Share on other sites

This is nice. Is it written in JavaScript? It looks like it changes the whole page even though it's contained within a division. I wonder if you can set it up only to affect certain divisions or classes on the page? If so, it would work well for walc application.

Link to post
Share on other sites

Not only Google Translate - any kind of automatic translator. They only translate the words but no meaning. A good way, an idea, what do they translate to is content to get something in another language and then back into yours, and you will see clearly what I mean.

 

They probably work well enough to make clear its position, but it is almost guaranteed to hear things a little bit strange.

 

----See what I mean????

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...