?
Solved

Multilingual site

Posted on 2006-06-19
3
Medium Priority
?
264 Views
Last Modified: 2010-04-01
hi experts,

I'm tying to develop a site which will have more then one language. Currently I'm dealing with 2 language. 1. English. 2.Asian Lang.(Right to left)
I like to code which should take care of any language and get me the proper result. By default I want to display english content.

guide me how to have this correctly put up. I'm planing to have 2 databases. one for English and other for Asian Language. Both will have identicial tables and fields only content will be differ.

English Site:-
------------------------------------------------------
 Logo                        (Top Banner)
------------------------------------------------------
            |
            |
 Left      |
 Menus  |
            |
            |
            |
            |
            |
            |
---------------------------------------------------------

Asian Language Site:- (Writes right to left)
------------------------------------------------------|
                             (Top Banner)         Logo    |
------------------------------------------------------|
                                                   |               |
                                                   |               |
                                                   |     Left     |
                                                   |     Menus |
                                                   |               |
                                                   |               |
                                                   |               |
                                                   |               |                                                  
                                                   |               |
                                                   |               |
                                                   |               |
 ---------------------------------------------------------
       
Please if anyone has experience with Multilingual site guide me thru. how to have home page code and all inner pages.
Atleast if someone give me sample code for left menus.(Menus.jsp) what will help a lot.

HomePage.jsp includes <top.jsp> and <menus.jsp>
how can I code when its default or english menus should be on left side. And when its Asianlanauge everything should be right aligned.

Thanks in adavance.
PH


0
Comment
Question by:princehyderabad
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
bpmurray earned 2000 total points
ID: 16943202
Why should Asian languages be right to left? I presume you mean Hebrew and Arabic, which are from the Middle-East. Use the term BiDi instead - this is short for bi-directional, where the local language is written right to left, and embedded English is written left to right. Note that the data is stored in natural order - the display engine changes the direction. This means that a string like this (upper-case is bidi text): "Hello ARABIC and HEBREW world" is displayed as: "Hello CIBARA and WERBEH world".

The main tips are to use the direction attribute, i.e. dir="LTR|RTL". You're using framesets, so this is an issue: from my experience with framesets, the DIR="RTL" doesn't do what you really want. This means that you have to programmatically change the sizes and positions of the frames you're using. This should be fine from within a JSP, where you can use the locale information to determine the directionality, and then print the frameset/frame information depending on what you pick up. The individual frame contents should be fine - the browsers are pretty good at handling BiDi.

So these are the changes you want:

All pages should be tagged as UTF-8, and the text should be Unicode UTF-8:

     <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" ... %>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     <html:form enctype="UTF-8" ...>
     <% request.setCharacterEncoding("UTF-8");%>

Strings on the page should be resourced, i.e. held in bundle files. Use JSTL <fmt:xxx> to manage these:
   <fmt:setBundle basename="stringdata"/>

This then allows you to use <fmt:message> to include translated texts in your pages. For example, this is a typical login page:
    Name:       <input id="UserName" />
    Password:  <input type="password" id="Password" />

To change this to a localized version, you could do something like:
    <fmt:message key="username">:   <input id="UserName" />
    <fmt:message key="password">:   <input type="password" id="Password" />
0
 

Author Comment

by:princehyderabad
ID: 16945267
>>Why should Asian languages be right to left? I presume you mean Hebrew and Arabic, which are from the Middle-East.
One of Indian languages "Urdu" as well write right to left.

Okay requirment are changed now.

English: will have regular Left menu from DB. top banner as Image and Main content page from DB and DHTML.
AsianLanaguge: top banner as Image, Left Menu as Image, main content page from DB and DHTML.

I think now I should have two folder placing english code in one and Urdu code in other folder. Both will have different DB. Few tables may be identitals.

I think now site is pretty straight fwd. anyone having multilingular experice can provided there experices and guide line .....

thx,
PH
0
 
LVL 15

Expert Comment

by:bpmurray
ID: 16945803
Hmm - I thought Urdu was Pakistani/Afghani, not Indian :-)

You have a choice: you can create separate translated wed sites, but that makes it difficult and expensive to maintain, or you can create a single web site that uses external texts that are included using JSTL bundle tags. If you have only 2 or 3 languages, it's probably easier to do the first part, but if you plan on supporting all 14 (?) Indic languages as well as Urdu, you would be much better off using bundle files.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If anyone asked you to network diagram of the internet, it was drawn in the form of a fluffy cloud which further became known as cloud computing. Popularly cloud computing is defined as workloads that run over the internet in a commercial provider’s…
Moore’s Law has proven itself time and time again since it was first introduced. So what’s next? Will Moore’s law continue to remain relevant, or will new technology take over and bring us the next big advancement in computing?
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question