Solved

Multilingual site

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem with Pie chart in Jsp 20 215
Lamba in java 8 9 243
java cyclic graphs 15 209
IE doesn't Invoke servlet in iframe 1 111
The question appears often enough, how do I transfer my data from my old server to the new server while preserving file shares, share permissions, and NTFS permisions.  Here are my tips for handling such a transfer.
February 24, 2017 — On February 23, Travis Ormandy, a vulnerability researcher at Google, reported on Twitter (https://twitter.com/taviso/status/834900838837411840) that massive stores of data have been leaked by CloudFlare, a company that provide…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

777 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