📄 resourcetool.html
字号:
<HTML><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="GENERATOR" CONTENT="Mozilla/4.02 [en] (X11; U; SunOS 5.7 sun4u) [Netscape]"> <META NAME="Author" CONTENT="Scarlett Hao"> <TITLE> Resource Tool</TITLE></HEAD><BODY BGCOLOR="#FFFFFF"><CENTER><PRE CLASS="ChapTitle"><IMG SRC="image/titleduket.gif" HEIGHT=116 WIDTH=661><IMG SRC="image/coffee.gif" HEIGHT=88 WIDTH=57></PRE></CENTER><CENTER><B><FONT SIZE=+2>Resource Tool</B></FONT></CENTER><CENTER><B></B> </CENTER><CENTER><B></B></CENTER><CENTER><IMG SRC="image/rainbow.gif" HEIGHT=1 WIDTH=100%></CENTER><P><B><FONT SIZE=-1><A HREF="userguide.html">[contents]</A></FONT></B><P><B><A HREF="#Introducing the Resource Tool">Introducing the ResourceTool</A></B><BR><B><A HREF="#Using the Resource Tool">Using the Resource Tool</A></B><UL><B><I><A HREF="#Getting Started with the Resource Tool">Getting Startedwith the Resource Tool</A></I></B><BR><B><I><A HREF="#Menus and Buttons">Menus and Buttons</A></I></B><BR><B><I><A HREF="#Merging Files and Reporting Differences">Merging Filesand Reporting Differences</A></I></B><BR><B><I><A HREF="#Exporting Resource">Exporting Resource</A></I></B><BR> </UL><A NAME="Introducing the Resource Tool"></A><B><FONT SIZE=+1>Introducingthe Resource Tool</FONT></B><P>Handling Java resource bundles, particularly the frequent revisionsof those bundles, is a difficult part of the internationalization/localizationprocess. The Resource tool helps you to handle message files in severalways:<UL><LI>Drawing messages from an existing resource rundle class file, when theJava source code of that resource bundle is not available.</LI><LI>Exporting messages as either a Java resource bundle or a property fileor an array resource bundle.</LI><LI>Merging two resource bundles (either source code or class byte code).</LI><LI>Comparing two resource bundles and find the differences between them.</LI><LI>Creating log files of the differences between two resource bundles (eitherJava source code or class byte code).</LI><LI>Creating source code files from byte code ( class file ) to be reused innew localization iteration.</LI></UL><DIV CLASS="Paragraph"><A NAME="Using the Resource Tool"></A><B><FONT SIZE=+1>Usingthe Resource Tool</FONT></B><P><A NAME="Getting Started with the Resource Tool"></A><B><I>Getting Startedwith the Resource Tool</I></B><P>With GUI method, in the main window of <B>I18n/L10n Toolkit 2.0</B>,select <B>Resource Tool</B>, then you can get <B>Resource Tool</B> mainwindow.<P><A NAME="Menus and Buttons"></A><B><I>Menus and Buttons</I></B><P>The <B>Resource Tool</B> UI includes several buttons and menus. Onlythose unique to this tool are described here.<UL><LI><B>File-Open</B></LI><BR>There are two choices for this menu item: As Master and As Slave. Tomerge two resource file, Resource Tool must firstly open two files. Oneis opened as Master and the other is opened as Slave. The master file shouldbe opened at first. When saving or exporting the merged result, the filename to save or the selections to export is from the Master file by default.<BR> <LI><B>File-Differentiate</B></LI><BR>After opening two resource files, press this menu item, then a ResourceDifferences window appears in the lower area of the <B>Resource Tool</B>main window (figure1).<BR> <LI><B>File-Merge</B></LI><BR>Merging the two resource bundles into one. After you merge two files,you will find the window popup (figure2). You can view the merged filethere.<BR> <LI><B>File-Export</B></LI><BR>Exporting the merged resource into a resource bundle you designate.<BR> <LI><B>View-Differences Report</B></LI><BR>Creating a difference report of the two resource bundles (figure3).<P><IMG SRC="image/res_main.gif" HEIGHT=600 WIDTH=674><H6>Figure1: Resource Tool main window: Differenciate</H6><IMG SRC="image/res_main_merg.gif" HEIGHT=600 WIDTH=674><H6>Figure2: Resource Tool main window: Merge</H6></UL><UL><LI><B>File-Save</B></LI><BR>You can save each of the three to a file, the master resource, themerged resource and the resource differences.<BR> <LI><B>Edit-Options</B></LI><BR>In the miscellaneous panel, check <B>View Value As Unicode</B>, willshow the resource value in ASCII unicode format. Check <B>Merge Comments</B>will keep comments in source code when merging resource.</UL><A NAME="Merging Files and Reporting Differences"></A><B><I><FONT SIZE=+1>MergingFiles and Reporting Differences</FONT></I></B><OL><LI>Open a resource bundle file by choosing <B>File-Open-As Master </B>andselect the file you want from the file and directory list.</LI><LI>Open a resource bundle file by choosing<B> File-Open-As Slave</B> and selectthe file you want from the file and directory list.</LI><LI>At this time, you can either select to merge the files or generate a differencereport.</LI><BR> <UL><LI>Merging Files</LI><BR>Select<B> File-Merge</B>, then the result of combination of the tworesource bundles is displayed in the window as shown in figure2. Click<B>Save</B> or <B>File-Save-Merged Resources</B> to save the result.<BR> <LI>Creating a Difference Report</LI><BR>Select<B> File-Differenciate</B>, a report of the differences betweenthe two resource bundles is displayed in the lower window as shown in figure1.Select <B>File-Save Resource Differences</B> to save the report to a file.Select <B>View-Differences Report </B>to open a report viewer to view thereport.<P><IMG SRC="image/res_diffrept.gif" HEIGHT=351 WIDTH=539><H6>Figure3: Resources Difference Report Viewer</H6></UL></OL><A NAME="Exporting Resource"></A><B><I><FONT SIZE=+1>Exporting Resource</FONT></I></B><P>This function allows a resource bundle to be exported and saved as anotherJava source file or property resource file with optional different bundletype and/or bundle name.<UL><OL><LI>Select <B>File-Export </B>to pop up the exporting resource dialog (figure4).</LI><LI>If there is no resource merged, you can see only the <B>Master Resource</B>is in the list. If there is resource merged, then you will see the <B>MergedResource</B> as well as the Master Resource is in the list with the formerselected.</LI><LI>There are three types of resource bundles the exported resource can bestored as: <I><B>List Resource Bundle</B>,</I> <B><I>Property ResourceBundle</I></B> and <B><I>Array Resource Bundle</I></B>. The former twoare defined in JDK, while the later one is defined in APIs of this Internationalizationtool.</LI><LI>Then you can accept the default resource bundle name (same as the parameterin <I>getBundle</I> method), locale name, and the output directory, oryou can type in or select these values.</LI><LI>After your selection, press <B>OK</B> to export the selected resource tothe resource bundle file according to the above choices and save it relativeto the output directory.</LI><H6><IMG SRC="image/res_exp.gif" HEIGHT=310 WIDTH=480></H6><H6>Figure4: Resources Difference Report Viewer</H6></OL></UL></DIV><IMG SRC="image/rainbow.gif" HEIGHT=6 WIDTH=100%><BR> <CENTER><B><FONT SIZE=-1> <A HREF="#top">Top of file</A> | <A HREF="mailto:i18n-toolkit-comments@Sun.COM">Comments</A>| <A HREF="mailto:i18n-toolkit-comments@Sun.COM">Submit Bug</A></FONT></B></CENTER><CENTER><A HREF="http://www.sun.com"><IMG SRC="image/sun-logo.gif" ALT="Sun Home" BORDER=0 HEIGHT=60 WIDTH=84></A></CENTER><CENTER><FONT SIZE=-2>Copyright © 1995-1999 Sun Microsystems,Inc.</FONT></CENTER><CENTER><FONT SIZE=-2>China Technical Development Center</FONT></CENTER><CENTER><FONT SIZE=-2>All Rights Reserved.</FONT></CENTER><P> <BR> <BR> <BR> <BR> <BR> </BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -