advertisement

Search Tips
Articles  |   Tutorials  |   Reviews  |   Dev Tools  |   by Category  |   by Date  |   by Name  |   Submit  |   Source Code  |  

Browse DevX
DevX Updates - Sign Up Here


Partners & Affiliates












advertisement

Articles : Advanced Topics in Java :
Internationalization :

Contents
Introduction
Naming Resource Bundles
Creating Resource Bundles by Direct Subclassing
Using ListResourceBundle
Using PropertyResourceBundle
Compiling Resource Bundles

Introduction

Internationalization is the process of designing an application so that it can be adapted to different languages and regions without requiring engineering changes. Sometimes the term internationalization is abbreviated as i18n, because in the English language there are 18 letters between the first "I" and the last "n."

Localization is the process of adapting internationalized software for a specific region or language by adding locale-specific components and translating text.

In an internationalized program with the addition of localization data, the same executable can run worldwide. The textual elements such as status messages and the GUI component labels are not hard-coded in the program. Instead, they are stored outside the source code and retrieved dynamically. This allows quick localization by maintaining a single source code base for all language versions, and also facilitates translations because all localizable resources are identified and isolated.

Java resources are a little different from Windows resource -RC files and resource-only dynamic link library -DLLs and Macintosh resource forks resources. A windows exe will store resources such as menus and icons in a separate section that can be inspected and updated with a resource editor. In Java all resource data must be stored in a class either as static variables or return values of method calls. This means that usually you must code and compile a new source file each time support for an additional Locale is needed.

So what's a Resource Bundle?

Localizing an application consists basically making a set of classes that describe the locale specific items (messages, labels etc) for each locale that you want supported. Each of these classes follows a specific predefined pattern that helps the VM locate and identify the particular resource.

The options are more or less limited to:
Subclass java.util.ResourceBundle
Use the specialized classes java.util.ListResourcebundle and java.util.PropertyResoucebundle.

We will look at these classes later but first some conventions.

NEXT


Sameer Tyagi is a Software Engineer with several years of programming experience in iNet application development and has conducted multiple training workshops in Java. Besides holding an Engineering degree in Electronics he is a Sun Certified Java 1.1 Programmer.
Email: sameertyagi@usa.net

How to Add Java Applets to Your Site

New on the Java Boutique:

New Review:

Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling API boasts simplicity, ease-of-integration, a well-rounded feature set, and it's free!

New Applet:

Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA sequences into three useful formats.

Elsewhere on internet.com:

WebDeveloper Java
Lots of Java information on webdeveloper.com

WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.

ScriptSearch Java
Hundreds of free Java code files to download.

jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.

internet.com logo


JavaBytes
Internet Cyclone
This powerful, easy-to-use, internet optimizer is for Windows 95, 98, ME, NT, 2000 and XP. It's designed to automatically optimize your Windows settings, boosting your Internet connection up to 200%.
Blackmail Applet
This applet prints out text that looks like letters cut out of a newspaper. You can specify the text, the width and height of the applet and the delay after each letter. Future versions will have more parameters.
JB User Poll
What is your primary tool for learning Java?
The JavaBoutique Top 15:
1. Little_Wizard
2. Pool
3. Castles
4. applets.rdf
5. articles.rdf
6. Birdbrain
7. KaaBlitz
8. puzzles
9. linx
10. ZTBanner
11. quickserv
12.
13. animateButton
14. J-Cad
15. AScroll2
Want more? Check out our Top 100!

Refer-It
Affiliate Program and Referral Directory.
New on internet.com
Google IM Not Talking to Other Jabbers
Newly-launched Google Talk IM service doesn't connect to other open source Jabber servers and users -- at least not yet.

Printer Sets Good Example for Small Business Security
While surveys suggest that small businesses aren't prepared for ever-present security dangers, this Boston-area printer has maintained a pristine operation since a scare six years ago.

VoIP Gizmo Comes to Universities
As student gear up for back to school, a SIP-based initiative aims to VoIP-enable universities around the world for free calling.


Access FREE BIRT Developer Tools from Actuate:
Download:
Visual Report Development Tool
Download:
Spreadsheet Report Writer
Webinar:
Point-and-click, Visual Report Development


Copyright 2002 INT Media Group, Incorporated. All Rights Reserved.
Legal Notices,  Licensing, Reprints, & Permissions,  Privacy Policy.
http://www.internet.com/