Solved

Multilingual site

Posted on 2006-06-19
3
257 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
Note: This is the second blog post in a series on email clearinghouses (https://www.xmatters.com/alert-management/blog-email-has-failed-us?utm_campaign=70138000000ydLoAAI&utm_source=exex&utm_medium=article&utm_content=blog-post).   Every month t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

939 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