Introduction to globalization

Globalization lets you create application for all of your customers in all the languages that your support. In some cases, globalization can let you accept data input using a different character set than the one you used to implement your application. For example, you can create a website in English that lets customers submit form data in Japanese. Or, you can allow a request URL to contain parameter values entered in Korean.

Your application also can process data containing numeric values, dates, currencies, and times. Each of these types of data can be formatted differently for different countries and regions.

You can also develop applications in language other than English. For example, you can develop your application in Japanese so that the default character set is Shift-JIS, your ColdFusion pages contain Japanese characters, and your interface displays in Japanese.

Globalizing your application requires that you perform one or more of the following actions:

Defining globalization

You will probably find several different definitions for globalization. For this chapter, globalization is defined as an architectural process where you put as much application functionality as possible into a foundation that can be shared among multiple languages.

Globalization is composed of the following two parts:

Importance of globalization ColdFusion applications

The Internet has no country boundaries. Customers can access websites from anywhere in the world, at any time, or on any date. Unless you want to lock your customers into using a single language, such as English, to access your site, you should consider globalization issues.

One reason to globalize your applications is to avoid errors and confusion for your customers. For example, a date in the form 1/2/2002 is interpreted as January 2, 2002 in the United States, but as February 1, 2002 in European countries.

Another reason is to display currencies in the correct format. Think of how your customers would feel when they find out the correct price for an item is 15,000 American dollars, not 15,000 Mexican Pesos (about 1600 American dollars).

Your website can also accept customer feedback or some other form of text input. You might want to support that feedback in multiple languages using a variety of character sets.

How ColdFusion supports globalization

ColdFusion is implemented in Java. As a Java application, ColdFusion can leverage many of the inherent globalization features to be an effective web application server. For example, ColdFusion stores all strings internally using the Unicode character encoding. Because it uses Unicode, ColdFusion can represent any text data from any language.

In addition, ColdFusion includes many tags and functions designed to support globalizing your applications. You can use these tags and functions to set locales, convert date and currency formats, control the output encoding of ColdFusion pages, and perform other actions.

Character sets and locales

When you discuss globalization issues, two topics that you must consider are the character sets recognized by the application and the locales for which the application must format data.

A character set is a collection of characters. For example, the Latin alphabet is the character set that you use to write English, and it includes all of the lower- and upper-case letters from A to Z. A character set for French includes the character set used by English, plus special characters such as "é," "à," and "ç."

The Japanese language uses three alphabets: Hiragana, Katakana, and Kanji. Hiragana and Katakana are phonetic alphabets that each contain 46 characters plus two accents. Kanji contains Chinese ideographs adapted to the Japanese language. The Japanese language uses a much larger character set than English because Japanese supports more than 10,000 different characters.

In order for a ColdFusion application to process text, the application must recognize the character set used by the text. For more information on character sets, see "About character encodings".

A locale identifies the exact language and cultural settings for a user. The locale controls how dates and currencies are formatted, how to display time, and how to display numeric data. For example, the locale English (US) determines that a currency value displays as:

$100,000.00

while a locale of Portuguese (Brazilian) displays the currency as:

R$ 100.000

In order to correctly display date, time, currency, and numeric data to your customers, you must know the customer's locale. For more information on locales, see "Locales".

Comments