📄 index.html
字号:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"><html><head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR" content="Mozilla/4.5 [zh.GBK] (X11; I; SunOS 5.7 sun4u) [Netscape]"> <title>Java Internationalization and Localization Toolkit 2.0</title></head><body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000"><center><b><font size=+2>Java Internationalization and Localization Toolkit2.0</font></b></center><div align=right><p><b><a href="index_zh.html">(Chinese version</a>)</b></div><p><br><br><br><p><b><font size=+1>Introduction</font></b><p> The global Internet demands global software.Global Software, it means that one same version of a product can be easilyadapted to different local markets. As far as developers are concerned,software globalization(g11n) development means internationlization(i18n)and localization(l10n).<br>Java is a language which "Write Once, Run Anywhere"(TM). It alreadyhas the feature and APIs for internationalization and localization. AlthoughJava Development Kit provides foundation classes for internationalizationand localization work, there are also some rough works for Java applicationsinternationalization and localization development, for example, messagesextraction and translation, encoding conversion, display layout, and formatsof number, date, and currency etc. All of them are time-consuming worksif we do internationalization and localization work solely manually.<br>The Java Internationalization and Localization ToolKit (Java I18n/L10nToolKit) is a toolkit for rapiding Java applications internationalizationand localization development. It will reduce significantly the cost andtime for internationalization and localization development.<p><b><font size=+1>Overview</font></b><blockquote>The toolkit includes five components:<br>- <b>Project Manager </b>can define a project to manage all java sourcefiles and their according resource files.<br>- <b>Internationalization Verifier</b> can do java internationalizationvalidation verification with the aids of policies files, and generate areport.<br>- <b>Message Tool </b>can define resource bundles, convert and extractmessages, generate resource bundle files in different locale, freeze allmessage items which do not need to be internationlized. All functions inVerifier are also included into this tool.<br>- <b>Resource Tool</b> can merge and differ different resources, transformthe type of resource bundle(ListResourceBundle, PropertyResourceBundle),convert the encoding of resource file(convert from native encoding to Unicode).<br>- <b>Translator</b> can translate the resources with the aids of dictionariesor reusable messages.</blockquote><blockquote><b>Architecture</b><br><b> </b>See figure 1.<center><p><img SRC="toolkit_arch.gif" height=291 width=434><br><i><font size=-1>Figure 1 Java Internationalization and LocalizationToolkit architecture</font></i></center><p><br><br><br><br><p><b>Features</b><ul><li>Easy of use</li></ul> The toolkit is an integrated development environmentfor Java applications internationalization and localization development.Developers can do their i18n and l10n work interactively in GUI style orautomatically in command line style.<ul><li>Friendly user interface and documents</li></ul> The GUI of the toolkit is based on Swing components.User manual and help documents are provided. The on-line help is availablein GUI style. An editor is provided in all tools GUI style.<ul><li>Configurable</li></ul> The toolkit can be configured by settingproperties in GUI, or editting the properties file directly.<ul><li>Processing automatically</li></ul> The internationalization validation verification,messages extraction, and messages translation can be done automatically.<ul><li>Pluggable</li></ul> There are APIs provided for integrating the toolkitinto other IDE or SDK tools. User-defined resource bundle, user-defineddictionary, and reusable messages can be plugged into the toolkit.<ul><li>JDK Support</li></ul> Java 2 SDK is highly recommended;<br> jdk1.1.7 or later + Swing 1.1</blockquote><b><font size=+1>Functionalities</font></b><p> This toolkit is an IDE for rapiddingJava applications internationalization and localization development.The toolkit includes a project manager and four tools InternationalizationVerifier, Message Tool, Resource Tool, and Translator. Every tool has aGUI component which provides an edit tool. The edit tool provides all thefunctionalities for editting java source files, such as copying, cutting,pasting, undoing, redoing, searching, replacing, and gotoing etc. It canalso display the tokens in the source file in different colors accordingto the semantic of java language with the support of a parser.<p> Internationalization Verifier, MessageTool, and Translator can also be run in command line style.<ul><li><b>Project Manager</b></li></ul> It is a project container which manages some java sourcefiles and their corresponding resource bundles appending different locales.The structure of a project is saved in a properties file. Any source filesand resource files can be processed by invoking the specified tool in theproject manager. The project manager will be notified automatically bythe specified tool when a resource bundle file is updated or generatedfor the source file in the project manager. The project manager shouldprovide a GUI tool for configuring the properties of a project, such asworking directory and output directory etc. It can also invoke the toolsdirectly in GUI(even though the tools can also be invoked separately).See figure 2.<center><p><img SRC="prjmng.gif" height=354 width=321><br><i><font size=-1>Figure 2 Project manager</font></i></center><ul><li><b>Internationalization Verifier</b></li></ul> This is a tool for the internationalization verificationfor java applications . The verifier can check the java source file tofind all internaionalization concerned items and generate a reportas a result. The report is a plain text file or html file depending onthe settings in the properties file. In this report, all the internationalizationconcerned items will be listed. The detailed information of each item includesthe source file name, item position, corresponding source string, itemstatus, item type, i18n suggestions and so on. There are several levelsof item status: ERROR, WARNING, NOTSURE, FROZEN, NOTE, FINISHED. Thereare several item types: String, Bundle name, Resource bundle, Retrievemethod, and Locale sensitive method. See figure 3.<center><p><img SRC="verifier.gif" height=356 width=441><br><i><font size=-1>Figure 3 Internationalization Verifier</font></i></center><p> Policy files are used as rules for verifying.There are two type of policy files: system policy file and user-definedpolicy file. The format of both policy files is same. In system policyfile, there are some common policies used by default. Users can custmizetheir own policies in the user-defined policy file. One rule in the policyfile should includes the type of this rule(constructor or method), thenumber of parameters, the item type of this rule(same as the item typesat above), the item status of this rule(same as the item status at above),advice for this item and the prototype of parameters.<p> The verifier can run both in GUI style or in commandline style. In GUI style, it can only process one file at one time. Butin command line style, it can process many files and directories at a sametime. When processing multiple files, it can generate only one report file, or generate the report files separately.<ul><li><b>Message Tool</b></li></ul> It is a tool for doing message-specific internationalizationwork. It can convert, revert, freeze, unfreeze a message item in the sourcefile. It can also define a resource bundle definition in the source fileand generate a resource bundle for it automatically. It can also recognizemessage concatenation and generate a message format for it automatically.It supports not only the default types of resource bundles such as ListResourceBundleand PropertyResourceBundle, and also an extended resource bundle ArrayResourceBundledefined by TDC and some other user-defined resource bundles. Every messageitem in the source file can be converted into an item in which the messagecan be extracted from a resource bundle by a key (the original string bydefault). The key used for extracting message can also be defined by userwhen converting. See figure 4.<center><p><img SRC="msgtool.gif" height=372 width=467><br><i><font size=-1>Figure 4 Message Tool</font></i></center><p> This tool also involves most of the functionalitiesof I18n Verifier in GUI style. It reuses the results of I18n Verifier.<p> This tool can convert all the message items whosestatus are ERROR and generate a resource bundle file automatically by commandline style. It is a tool for doing internationalization work.<ul><li><b>Resource Tool</b></li></ul> This tool is used for transforming the type of resourcebundles and the format of the resource bundle files. It can merge and differtwo different resource bundles. It can also transform the type of the resourcebundles among ListResourceBundle, PropertyResourceBundle, and ArrayResourceBundle.It can transform the format of the resource bundle file by using differentencoding, from a native encoding to Unicode or to a native encoding. Seefigure 5.<center><p><img SRC="restool.gif" height=366 width=467><br><i><font size=-1>Figure 5 Resource Tool</font></i></center><p><br><ul><li><b>Translator</b></li></ul> This tool and resource tool are used for doing localizationwork. It can be used for translating the messages in the resource bundlesinto the messages in local languages with the aid of some dictionaries,reusable resource bundles, and message database(maybe). This tool providesa default English to Chinese dictionary. Any other dictionaries or messagedatabase can be used in this tool only if an interface for the dictionarybridge has been implemented. See figure 6.<center><p><img SRC="translator.gif" height=328 width=449><br><i><font size=-1>Figure 6 Translator</font></i></center><p> This tool can export a resource bundle in other localeand save the resource bundle file in Unicode encoding.<p> It can also be run in command line style, andconvert all the messages' value into the messages in local language whichthe messages can be matched in reusable resource bundles or message databaseautomatically.<br> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -