Guest walc Posted March 7, 2010 Report Share Posted March 7, 2010 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 Quote Link to comment Share on other sites More sharing options...
Wickham Posted March 7, 2010 Report Share Posted March 7, 2010 You could put the second language on separate html page(s) which have the correct meta tag charset and include it/them in iframe(s). Quote Link to comment Share on other sites More sharing options...
TiggersBounce Posted March 7, 2010 Report Share Posted March 7, 2010 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. Quote Link to comment Share on other sites More sharing options...
krillz Posted March 7, 2010 Report Share Posted March 7, 2010 Doesn't UTF-8 cover most symbols in the world? Check whether UTF-8 would cover the symbols needed to display all those languages. If so they you would only need one page. Quote Link to comment Share on other sites More sharing options...
PicnicTutorials Posted March 8, 2010 Report Share Posted March 8, 2010 I'm going to code up a style sheet switcher for this in the morning. I'll post back if it's something usable. Quote Link to comment Share on other sites More sharing options...
PicnicTutorials Posted March 8, 2010 Report Share Posted March 8, 2010 Bam! http://www.visibilityinherit.com/projects/multiple-language-demo.php Quote Link to comment Share on other sites More sharing options...
virtual Posted March 8, 2010 Report Share Posted March 8, 2010 Fantastic Eric, I often have to do sites in different languages. Just a question, what happens if they have javascript disabled? Quote Link to comment Share on other sites More sharing options...
PicnicTutorials Posted March 8, 2010 Report Share Posted March 8, 2010 (edited) 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 March 8, 2010 by Eric Quote Link to comment Share on other sites More sharing options...
dms Posted March 9, 2010 Report Share Posted March 9, 2010 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 Quote Link to comment Share on other sites More sharing options...
PicnicTutorials Posted March 9, 2010 Report Share Posted March 9, 2010 (edited) It is pretty cool huh. Sadly I know little to none of character sets. Maybe Kyle (or likes) will chime in with their expereirnce. I also know little JS. I'm just good at piecing things together. Edited March 9, 2010 by Eric Quote Link to comment Share on other sites More sharing options...
PicnicTutorials Posted March 16, 2010 Report Share Posted March 16, 2010 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 Quote Link to comment Share on other sites More sharing options...
dms Posted March 16, 2010 Report Share Posted March 16, 2010 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. Quote Link to comment Share on other sites More sharing options...
virtual Posted March 16, 2010 Report Share Posted March 16, 2010 I would be wary of the Google Translate, as sometimes when you translate it back you get surprises. Quote Link to comment Share on other sites More sharing options...
Andrea Posted March 16, 2010 Report Share Posted March 16, 2010 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???? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.