Java Localization Improve Computer Literacy Sri Lanka Computer Science Essay

Abstract- Computer users all over the universe have come to anticipate their package to “ speak ” to them in their ain linguistic communication. In order to carry through this demand for different users across the Earth, internationalisation & A ; localisation render a great service. In short, Localization ( L10N ) is the procedure of accommodating a merchandise ( a package in this instance ) , to a specific venue such as to its linguistic communication, criterions and cultural norms every bit good as to the demands and outlooks of a specific mark market. But in the context of Java there is really small support for Sinhala or Tamil while there is broad support for most European linguistic communications which is a encouragement for package applied scientists in those states to compose package in native linguistic communications or in a mode that supports both English and their female parent lingua. Therefore our attack was to present a localised application model extension in Sinhala, which can be integrated with the Java platform to make GUI applications, so that developers can use the model in order to develop customized/localized applications to function the local community in Sinhala.


World is acquiring smaller. Large organisations are spread outing their range across continents and civilizations. Even little, family-owned companies are happening new client bases and supply concatenation spouses in parts of the universe that they would non hold antecedently considered. The Internet which provides the communicating anchor for the increasing planetary interconnection and with the English linguistic communication moving as the common communicating medium have brought together admirations in the modern universe. However, under no semblance can one forget or undervalue the importance of localisation and native linguistic communications. This is true particularly in states such as France, Japan, China where about all communicating is done in native linguistic communications.

In Sri Lanka, even though English is an official linguistic communication of the province and normally used in twenty-four hours today activities in urban countries, when it comes to rural countries, the use of English lessenings dramatically. Because of Sri Lanka is an agribusiness oriented state and a big per centum of population life in rural countries, merely a really limited per centum of the public are English literate. If the province of English literacy in Sri Lanka even with the advantage of long term sustained free instruction is any indicant, this is a common issue non merely in Sri Lanka but throughout all developing states.

The deficiency of English literacy is a major hurdle when it comes to distributing information engineering in Sri Lanka because, unlike in contexts such as Europe where users are given ample installations to interact with computing machines in their local linguistic communications, there ‘s still really small use of the native linguistic communications in Sri Lanka – Sinhalese and Tamil, in this respect. This unequal distribution of IT literacy is shown really clearly when we study stats in Fig. 1, which depicts the distribution of computing machine literacy by states in Sri Lanka, which in bend is approximately relative to the distribution of English literacy in the state

Fig. 1 Computer literacy of family population by state in Sri Lanka [ 3 ]

To get the better of the issue of deficiency of English literacy in Sri Lanka, we can take two obvious paths.

1 ) Increase the degree of English literacy all over the state

2 ) Supply more entree to computing machines through local linguistic communications such as Sinhala and Tamil

The first solution is a long-run one, which must be done, with a monolithic attempt from the authorities to better larning chances in rural countries of the state. Unfortunately, if we wait till English literacy approaches an acceptable degree in Sri Lanka, it ‘s likely that most people will lose the opportunity of larning computing machine accomplishments and the universe will be traveling in to the following phase go forthing us far behind, doing the procedure of catching up with the universe even more hard. Therefore, we decidedly have to see the second option which is to enable more entree to computing machines in native linguistic communications in add-on to the first option.

But unluckily the use of local linguistic communications to interact with computing machines in Sri Lanka and in fact through out most of the South Asia is really low at the minute. This issue is clearly highlighted in the undermentioned commendation from the survey “ Challenges of enabling IT in the Sinhala Language ” [ 1 ] .

“ The Sinhala linguistic communication is spoken by about 15 million people and is the national linguistic communication of Sri Lanka which has a high literacy rate of over 90 % . Computers are in moderately broad usage in the state, particularly in offices ” .

“ However, even today, there are no important databases, really few web sites or other online paperss, and about no usage of electronic mail and messaging in Sinhala. This is in blunt contrast to European linguistic communications, such as Swedish, with far fewer talkers. ”

However unlike bettering English literacy degrees in the state, bettering entree to computing machines through native linguistic communications is something that IT pupils and people working in the IT industry can assist with. To do a part to this end, we decided that it would be highly utile if we can supply support for Sinhala in Java, as Java is one of the most popular computing machine linguistic communications in the universe today.


Bettering support for a peculiar linguistic communication is non something that can be done by a individual individual or overnight. When it comes to bettering support for Sinhala, there has been a considerable sum of work done by assorted parties that has made it possible to utilize Sinhala in assorted runing systems.

Because of the figure of runing systems in usage this peculiar country is a big one in which rather a figure of undertakings are ongoing. As one of the most used operating systems Windowa„? from Microsoft has received peculiar attending and therefore has been provided with the support that enables the typewriting of Sinhala and Tamil in any Unicode enabled application. This merchandise is called the Sinhala and Tamil Kit and is available for download online [ 5 ] while being a belongings of the ICTA ( Information and Communication Technology Agency of Sri Lanka ) . This package needs the service battalion 2 of Windows XP to be installed in order to work decently. The Microsoft Vista runing system besides has a hole provided by Microsoft Corporation enabling similar functionality in Vista OS.

Other runing systems such as Ubuntu or any other Debian based GNU/LINUX have Sinhala support and by making some little alterations such as the utilizing of a Sinhala Unicode fount, can back up the reading and authorship of Sinhala. Red Hat Enterprise Linux from version 5 comes with Sinhala support and even allows the installing in Sinhala.

When it comes to net and browser support to Sinhala, both IE 7 and 8 on the Windowss Vista runing system shows Sinhala without any other extra package. Besides Internet Explorer 6 and 7 on Windows XP runing system will expose Sinhala right one time the Sinhala / Tamil kit is installed in Windows XP.

One of the favourite Open Source browsers in the universe – Mozilla Firefox has a Sinhala version that non merely presents Sinhala right but besides has its bill of fare and actions in Sinhala [ 4 ] .

Technologies USED

Choosing a proper engineering is indispensable for any IT undertaking to win with minimum attempt and best public presentation. The consistent and sole usage of Unicode together with the constitutional libraries for resource files and venues make it easy to make internationalized applications in Java.

Java supports for Sinhala Unicode which lays in the scope between hexadecimal values 0D80 to 0DFF, which on occasion used to look into if there ‘s Sinhala Unicode founts installed in a peculiar system. The corresponding characters for the relevant Unicode values are shown in the undermentioned Fig. 2.

When it comes to Java categories and models, there are several major subjects that need to be looked at.

Fig. 2 Sinhala Unicode character chart

Java Locale Class

An internationalized plan can expose information otherwise throughout the universe. For illustration, the plan will expose different messages in French, Japanese or English ( UK/US ) depending on your constellations. If the localisation procedure has been fine-tuned, the plan will expose different messages in New York and London to account for the differences between American and British English and this is done by citing a Locale object.

A Locale object is an identifier for a peculiar combination of linguistic communication and part. Harmonizing to the definition by Java locale tutorial, if a category varies its behaviour harmonizing to Locale, it is said to be locale-sensitive. The existent work, such as data format and observing word boundaries, is performed by the methods of the locale-sensitive categories.

Java Locale-Sensitive Servicess SPI ( Services supplier Interface )

This characteristic enables the circuit board of locale-dependent informations and services. In this manner, 3rd parties are able to supply executions of most locale-sensitive categories in the java.text.spi and java.util.spi bundles.

The execution of SPIs is based on abstract categories and Java interfaces that are implemented by the service supplier. At runtime the Java category lading mechanism is used to dynamically turn up and lade categories that implement the SPI.

Java ResourceBundler Classes

Locale-specific informations must be tailored harmonizing to the conventions of the terminal user ‘s linguistic communication and part. When you need a locale-specific object you fetch it from a ResourceBundle, which returns the object that matches the terminal user ‘s Locale.


If your application contains Stringing objects that need to be translated into assorted linguistic communications, you can hive away these String objects in a PropertyResourceBundle, which is backed up by a set of belongingss files. Since the belongingss files are simple text files, they can be created and maintained by your transcribers.


The ListResourceBundle category, which is a subclass of ResourceBundle, manages locale-specific objects with a list. A ListResourceBundle is backed by a category file, which means that you must code and roll up a new beginning file each clip support for an extra Locale is needed. However, ListResourceBundle objects are utile because unlike belongingss files, they can hive away any type of locale-specific object.

Java Input Method Framework

The input method model enables the coaction between text redacting constituents and input methods in come ining text. Input methods are package constituents that let the user enter text in ways other than simple typing on a keyboard. They are normally used to come in Eastern linguistic communications such as Nipponese, Chinese, or Korean that consist of 1000s of different characters with far fewer keys. However, the model can be used to input methods for other linguistic communications and the usage of wholly different input mechanisms, such as script or address acknowledgment.


To supply Sinhala locale sensitive support for freshly introduced Java locale sensitive services SPI, we should be sub-classing abstract categories from java.util.spi or java.text.spi bundles to supply our ain execution of these categories and supply linguistic communication specific information. When this is built as an extension Java runtime will acknowledge it as a service and load the extension dynamically.

With the purpose of leting scalability in the hereafter to let more linguistic communications used in Sri Lanka such as Tamil, we have defined a generic category set located in net.locale bundle that straight sub-class from Java SPI service categories and another set of categories that provide Sinhala linguistic communication information to the Java runtime that resides within the bundle net.locale.sinhala in our extension as shown in Fig. 3.

Fig. 3 Sinhala locale service providing categories

When it comes to Sinhala Input Method ( IM ) for Java, A detailed in-depth survey was carried out in order to clear up the boundaries of bing Java Input Method Framework. Supported Input manners on the ensuing IMF extension and the integrating of antecedently developed simulation algorithm ( i.e. Sinhala Phonetic transcriber ) were taken in to account and detailed requirements/designs were farther clarified.


With Java 1.6 release it has introduced an SPI called Locale-Sensitive Services SPI [ 2 ] which is a characteristic that enables the circuit board of locale-dependent informations and services. Therefore, 3rd parties are able to supply executions of most locale-sensitive categories in the java.text and java.util bundles.

This SPI is based on several abstract categories that correspond to Java criterion categories that change harmonizing to different venues ( i.e. Currency, TimeZone ) and Java interfaces that are implemented by the service supplier. At runtime the Java category lading mechanism is used to dynamically turn up and lade categories that implement the SPI.

But alternatively of straight making a set of categories to subclass java.util.spi.LocaleServiceProvider which is the ace category of this SPI, we have created a set of interim generic categories ( which reside in net.locale subpackage in our extension ) which subclasses SPI categories in java.util.spi and java.text.spi bundles. Then in net.locale.sinhala bundle we have been given all Sinhala linguistic communication related services by sub-classing net.locale generic categories and these categories are named in the format To supply information on Sinhala venue we have created one depository category incorporating all locale info about Sinhala called ( Ref. Subheading B ) which is a subclass of net.locale.LocaleInfo. In this category construction, one can really easy widen this extension to other linguistic communications used in Sri Lanka. For illustration if one wants to widen this extension to back up Sri Lankan Tamil venue, he/she can really easy make a bundle called net.locale.tamil and make all locale specific service categories by sub-classing these generic categories in net.locale bundle.

The declaration/implementations of cardinal classes/interfaces in this extension are as follows.

public interface LocaleInfo extends Serializable {

nothingness checkLocaleSupported ( Locale venue ) ;

Stringing [ ] [ ] getCountryTuples ( ) ;

Stringing getCurrencyFormat ( ) ;

Stringing getCurrencySymbol ( ) ;

} Net.locale. LocaleInfo Interface

This interface should be adopted by the root category that provides Language specific inside informations ( for illustration in this instance ) .

Net.locale.sinhala. Class

category Sinhala implements LocaleInfo {

private inactive concluding Locale si_LK_LOCALE = new Locale ( “ Si ” , ” LK ” ) ;

private inactive concluding Locale [ ] SUPPORTED_LOCALES = { si_LK_LOCALE } ;

private inactive concluding String [ ] ERAS = { “ a¶sa·Sa¶»a·’.a¶?a·- . ” , “ a¶sa·Sa¶»a·’.a·ˆ . ” } ; … …


This is the one cardinal category of this extension that provides all Sinhala linguistic communication particular inside informations to Locale-Sensitive Services. This category is an execution net.locale.LocaleInfo and implements all methods specified by the interface. Class

public abstract category LocaleLocaleNameProvider extends LocaleNameProvider {

public abstract LocaleInfo getLocaleData ( ) ;

@ Override

public Locale [ ] getAvailableLocales ( ) {

return getLocaleData ( ) .getSupportedLocales ( ) ;

} … ..


This is one of the generic categories that subclasses Java locale sensitive categories in java.util.spi and java.text.spi bundles. This peculiar generic category works as the intermediate to supplying Java runtime what are the venues supported by this extension.

Net.locale.sinhala. Class

public category LocaleNameProvider_si_LK extends LocaleLocaleNameProvider {

inactive concluding private LocaleInfo localeData = new Sinhala ( ) ;

@ Override

public LocaleInfo getLocaleData ( ) {

return localeData ;



This peculiar category is a set of low degree categories that provide Sinhala venue services to the Java Locale sensitive SPI. This peculiar category informs Java SPI that our extension supports si_LK venue.


Harmonizing to the Java extension mechanism [ 6 ] and Services SPI, we are required to provide a form for each category that works as a localised service. This form supports Java runtime to place services provided by certain extensions dynamically and should be structured as shown in Fig. 4.

Fig. 4 Descriptor construction for the extension

F Implementation of Java Input Method Framework Extension for Sinhala Support

By utilizing this extension, Swinging text constituents can manage the input method composing on-the-spot, or inline. In other words, the text being composed is instantly visually and logically inserted into the text backup shop. Swinging text constituents carry through this on-the-scene redaction manner utilizing the client API in the Input Method Framework.

To implement this we have used a twine replacing a technique that has been researched by other institutes and tribute must be paid to research workers who have spent clip to come up with successful phonic English to Sinhala techniques that have been used here.

Get down

Declare Variables

Vowels and qualifiers

vowelsUni [ 0 ] = ” a¶? ” ; vowels [ 0 ] = ” oo ” ;

vowelModifiersUni [ 0 ] = ” a·- ” ;

vowelsUni [ 1 ] = ” a¶• ” ; vowels [ 1 ] = ” o ) ” ;

vowelModifiersUni [ 1 ] = ” a·? ” ;

vowelsUni [ 2 ] = ” a¶• ” ; vowels [ 2 ] = ” oe ” ;

vowelModifiersUni [ 2 ] = ” a·? ” ;

vowelsUni [ 3 ] = ” a¶† ” ; vowels [ 3 ] = ” aa ” ;

vowelModifiersUni [ 3 ] = ” a·? ” ;

vowelsUni [ 4 ] = ” a¶† ” ; vowels [ 4 ] = ” a ) ” ;

vowelModifiersUni [ 4 ] = ” a·? ” ;

Particular consonants

specialConsonantsUni [ 0 ] = ” a¶‚ ” ; specialConsonants [ 0 ] = ”
” ;


consonantsUni [ 0 ] = ” a¶¬ ” ; consonants [ 0 ] = ” nnd ” ;

consonantsUni [ 1 ] = ” a¶? ” ; consonants [ 1 ] = ” nndh ” ;

consonantsUni [ 2 ] = ” a¶Y ” ; consonants [ 2 ] = ” nng ” ;

Replace Special consonants if there any, in the text country, with matching Sinhala Special harmonic Unicode characters.

E.g. : Replace With

specialConsonants [ 0 ] = ”
” ; specialConsonantsUni [ 0 ] = ” a¶‚ ” ;

specialConsonants [ 1 ] = ” h ” ; specialConsonantsUni [ 2 ] = ” a¶z ” ;

3. Replace Consonants + SpeciaChar combinatioins with curresponding Sinhala ConsonantsUni + SpecialCharUnicode characters.

4. Replace Consonants + R + Vowels with ConsonantsUni + “ a·Saˆ?a¶» ” + vowelModifiersUni

5. Replace Consonants + Vowels with ConsonantsUni + vowelModifiersUni

6. Replace Consonants + HAL with consonantsUni + “ a·S ”

7. Replace Vowels with vowelsUni



To measure the freshly created Sinhala Locale, an application was done to prove each functionality offered by the Locale as shown in the Fig. 5 below.

The proving application has 7 check named Locale Info, TimeZone, Date & A ; Time, Date Symbols, Currency, Numbers and Decimals in order to divide different maps provided by the venue and trial each one of them.

For illustration, there is a check to demo how the constituents of day of the month are being presented in Sinhala venue in a Java interface. The “ Data Symbols ” check shows the list of yearss displayed in Sinhala as shown in Fig. 5.

Fig. 5 Date Symbols locale scenes

Apart from that, unit trial instances have been written covering the whole Sinhala venue which guarantees the quality of the extension.


As the undertaking was of research type we did n’t hold a peculiar solution at the beginning. All we needed to cognize was how far Java can be used to implement localised applications and how it can be farther enhanced. At the terminal of the undertaking we have ended up with several results.

A Sinhala Sinhala venue for Java

Sinhala IME

Sing the hereafter of new Sinhala venue extension and Sinhala phonic Input Method Editor ( IME ) , they will necessitate user inputs from the Sinhala IT community to better and heighten their functionalities. Besides to maintain in par with the continuously germinating Java linguistic communication, the undertaking will necessitate the part of more subscribers and therefore came the necessity to make a GitHub undertaking named Java_sinhalization in the URL – hypertext transfer protocol: //

By developing this sort of a Java SPI extension to supply Sinhala & A ; Tamil we expect to supply a accelerator to Sri Lankans who are interested in larning Java in his/her ain linguistic communication. This would be an advantage to developers as it would do it easy to develop Java applications in Sinhala. Further, it would be a room access for Sri Lankans to come in to Information Technology universe with their ain individuality.


Writers of this paper would wish to thank all research workers, institutes, and geeks who have spent their clip and attempt into paving implicit in support for Sinhala in computing machines so others wo n’t hold to reinvent the wheel. Last but non least they are thankful to the staff at LK domain register office for supplying valuable support and necessary stuffs.