⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msgtool.html

📁 是一个加快Java应用程序国际化和本地化开发的工具集。它将大大减少国际化和本地化开发的所消耗的时间和资源。
💻 HTML
📖 第 1 页 / 共 2 页
字号:
class name of the user-defined resource bundle. The <b>Method type</b>is the type of extracting message method. There are four type of the methodswhich are described in the above table. If the extracting message methodhas a parameter which is a <tt>Locale</tt> object, the <b>Locale variable</b>should be specified.<p><a NAME="Operating on Messages"></a><b><i>Operating on Messages</i></b><p><b><font size=-1>Converting Messages</font></b><p>To translate message items into internationalized form, if there isa specified resource bundle variable, do as follows:<ul><li>Select <b>message -> convert</b></li><li>From the popup menu select <b>convert.</b></li></ul>to convert the active message item. Through the popup menu in the messageslist, you can select multiple message items for converting, but the itemsmust come from the same package class.<p><b><font size=-1>Reverting Messages</font></b><p>To restore the converted messages, do as follows:<ul><li>Select <b>message -> revert</b></li><li>From the popup menu select <b>revert</b></li></ul>to revert the active message item. Through the popup menu in the messageslist, you can select multiple message items for reverting.<p><b><font size=-1>Freezing Messages</font></b><p>To keep message items from being converted, do as follows:<ul><li>Select <b>message -> freeze</b></li><li>From the popup menu select <b>freeze</b></li></ul>to freeze the active message item. Through the popup menu in the messageslist, you can select multiple message items for freezing.<p><b><font size=-1>Unfreezing Messages</font></b><p>To allow the message items to be converted, do as follows:<ul><li>Select <b>message -> unfreeze</b></li><li>From the popup menu select <b>unfreeze</b></li></ul>to unfreeze the active message item. Through the popup menu in the messageslist, you can select multiple message items for unfreezing.<p><b><font size=-1>Converting All</font></b><p>To convert all unfreezed message items, select <b>message -> convertall</b>.<p>Note: in the case multiple package classes in a same source file, ifthere is not the active resource bundle variable defined in a package class,the first bundle var will be selected for converting or new bundle varwill be defined in the action.<p><b><font size=-1>Reverting All</font></b><p>To revert all converted message items, you can select <b>message ->revert all</b>.<p>Note: after the operation, all resource bundle variables used by theconverted message items will be undefined.<p><b><font size=-1>Changing converting Properties</font></b><p>To change convert properties (key, bundle, default value), you can select<b>Changeproperties</b> from the popup menu in the editor.<p><img SRC="image/mt_dlg_properties.gif" height=228 width=325><h6>Figure4: Changing properties</h6><b><font size=-1>Unifying converted messages</font></b><p>To change the keys of several converted message items in the same packageclass&nbsp; to a same key.<blockquote><li>Multi-select the messages in the messages list. Press right mouse buttonand get the popup menu(figure5).</li></blockquote><ul><li>Press <b>Unify</b> and get the dialog box popup(figure12).</li><br>&nbsp;<p>&nbsp;<br>&nbsp;<br>&nbsp;<p><img SRC="image/msg_inputmsgstring.gif" height=131 width=274><h6>Figure12: Input the unified key dialog box</h6><li>Type the value in the text field.</li><li>Press <b>OK</b>.</li></ul>All instances of this key are given this message.<br><a NAME="Exporting Resources"></a><b><i>Exporting Resources</i></b><p>To exporting all resource bundle files, you can:<ul><li>Select <b>File->Export Resource</b>, get the <b>Export Resource </b>dialogbox popup(figure7).</li></ul><ul><img SRC="image/msg_exportresource.gif" height=167 width=426><h6>Figure7: Export Resource Dialog Box</h6><ul><li>In the above text field, input or browse the path to which you want toexport the resource files.</li><li>Specify the locales for which the resources will be created. Press <b>Specify</b>button and get the window popup(figure8).</li></ul></ul><ul><ul><img SRC="image/msg_definelocale.gif" height=289 width=447><h6>Figure8: Define locales to be used</h6></ul><li>Press <b>Export</b>, the resource files are exported to the directory.</li></ul><a NAME="Translating Resources"></a><b><i>Translating Resources</i></b><p>To run the <b>translator</b> tool to translate some resource bundlefile. Choose <b>Resource-> Translate</b>, you will get the dialog box shownin figure6. Input the name of the file to be translated in the blank textfield or select one file by using <b>Browse</b>. Then press <b>Translate</b>,you can access <b>Translator</b> function and get the Translator's mainwindow.<ul><img SRC="image/msg_translatedialog.gif" height=123 width=411><h6>Figure6: Translate file dialog</h6></ul><a NAME="Viewing verify report"></a><b><i>Viewing Verify Report</i></b><p>To view the verifier report, select <b>verifier -> report</b>.<p><a NAME="Setting Verify policy"></a><b><i>Setting Verify Policies</i></b><p>To set the verifier policies, select <b>verifier -> policies</b>.<p><a NAME="Changing  Options"></a><b><i>Changing&nbsp; Options</i></b><p>Select<b> Edit->Options</b>, you will get the <b>Messagetool: Options</b>window popup(figure9). There are two items of options: <b>I18n Verifier</b>and<b>Editor</b>.<ul><li>Select <b>I18n Verifier</b>, you will get the window shown in figure9.If&nbsp; "<b><i>Show dialog for parameters when convert a message item</i></b>"is checked, a dialog will always pop up when you do converting.</li><li>Select <b>Editor</b>, see the detail introduction in Chapter2 <a href="verifier.html#Editor">I18nVerifier <b>"Editor"</b></a>.</li><ul>&nbsp;</ul><img SRC="image/msg_opt_i18.gif" height=340 width=465><h6>Figure9: MessageTool Options_Verifier_I18N</h6></ul><a NAME="Internationalize a Java source file"></a><b><i>Internationalizea Java source file</i></b><p>A sample process of internationalizing a Java source file by MessageTool is:<ol><li>Open a Java file by selecting <b>File->Open</b>.</li><li>Choose a file and select Open, the file will be parsed automatically.</li><li>After the file is opened as shown in figure2, use<b> Previous item, Firstitem, Next item</b> to navigate between message strings. You can also searchfor specific strings by content or location, by selecting items under the<b>Edit</b>menu:</li><ul><li><b>Edit->Find</b></li><li><b>Edit->Find Next</b></li><li><b>Edit->Goto</b></li></ul><li>Define bundle objects.</li><li>If a string ought to be protected, select <b>Message-> Freeze</b>.</li><li>If you want to accept all the entries in the suggestion window, select<b>Message->Convert All</b>, otherwise select Covert to accept individual suggestions.Only the messages in Error status can be converted automatically.</li><li>Press <b>View->Refresh</b> to reparse the contents of the editor.</li><li>If you require several different messages use the same value from a resource,select <b>Unify</b> from the list menu item(figure5).</li><li>To save a resource file, select <b>File-> Export Resources</b>. See thedetail introduction in <b>Export Resources</b>. The created resource bundleswill be automatically added to the project management window as shown infigure13.</li><br>&nbsp;<p>&nbsp;<p><img SRC="image/msg_expresouce.gif" height=356 width=434><h6>Figure13: Resource bundles are added automatically</h6><li>To save the changes in the opened file, select <b>File-> Save </b>or <b>Saveas</b>.</li></ol><a NAME="Message Tool command line"></a><b>Message Tool Command-line</b><p>The following describes the usage of Message tool command in detail.<p>USAGE:<p>java com.sun.tdc.toolkit.messagetool.MessageTool [-h|-help] [[-rn resourceName][-rt resourceType][-rd resourceDirectory] [-v] files|directories]<p>&nbsp;&nbsp;&nbsp; -h|-help&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display this information<br>&nbsp;&nbsp;&nbsp; -rn resourceName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the resource class full package name<br>&nbsp;&nbsp;&nbsp; -rt resourceType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the resource type&nbsp; 0 - list resource, 1 - array resource,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2 - property resource<br>&nbsp;&nbsp;&nbsp; -rd resourceDirectory&nbsp;&nbsp;&nbsp;&nbsp; theresource export directory<br>&nbsp;&nbsp;&nbsp; -v&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display verbose information<br>&nbsp;&nbsp;&nbsp; files|directories&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the java source files or directories<p><img SRC="image/rainbow.gif" height=6 width=100%><center><p><b><font size=-1>&nbsp;<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><br><a href="http://www.sun.com"><img SRC="image/sun-logo.gif" ALT="Sun Home" BORDER=0 height=60 width=84></a><br><font size=-2>Copyright &copy;&nbsp; 1995-1999 Sun Microsystems, Inc.</font><br><font size=-2>China Technical Development Center</font><br><font size=-2>All Rights Reserved.</font></center></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -