📄 translator.html
字号:
<b>Use Resource</b></li><ul><li>Select this menu item you will get the window (figure4).</li></ul><ul><img SRC="image/tra_dic_useres.gif" height=250 width=371><h6>Figure4: Use resources as dictionary</h6></ul></ul></ul><ul><ul><ul><li>Press <b>Add</b> button and get <b>Add Resource File</b> window (figure5).</li></ul><ul><img SRC="image/tra_dic_addresfile.gif" height=250 width=400><h6>Figure5: Add resource bundle files</h6></ul></ul></ul><ul><ul><ul><li>Select a resource bundle file and<b> Open</b> it.</li></ul>Note: A resource bundle file and its content can be loaded only if itslocale meets the system dictionary target locale and the ignore countryand ignore variant criteria. After the resource file is loaded, its contentcan be used as resource dictionary because it is the form of the key valuepairs.<ul> </ul><li><b>Customize</b></li><br>Select this menu item, you will get <b>Customize User Dictionary </b>dialogbox (figure6) . Press <b>Load</b>, then get <b>Open User Dictionary</b>window (figure7). Here you can select and load a dictionary file or classto be used as the user dictionary. If the dictionary file or class meetsthe system dictionary locale and the ignore country and ignore variantcriteria, this action will be successful.<p><img SRC="image/tra_dic_customize.gif" height=250 width=400><h6>Figure6: Customize User Dictionary</h6><img SRC="image/tra_dic_loadcustom.gif" height=190 width=400><h6>Figure7: Open User Dictionary</h6></ul></ul><ul><ul><ul><li>Load a user dictionary (figure 7): select a user dictionary file or entera class name (the class must implement the <a href="../api/com/sun/tdc/toolkit/api/Dictionary.html">com.sun.tdc.toolkit.api.Dictionary</a>interface , see <a href="#Implementing A User Dictionary">how to importa user dictionary</a> for more information. ) on your class-path and press<b>OK</b>to open it as the user dictionary.</li></ul><p><br> If choose to load thedictionary as a file, the file name should be:<ul>xxx_<source-locale>2<target-locale>.bbtf, and if a non-absolute<br>path is given to the file, the dictionary will be put into the lib<br>directory of the product installation. If the file does not exists<br>on the path, you will be prompted whether to create it or not.</ul><ul><li>Input a new meaning for a word or sentence: press<b> Add</b> button (figure6)and get<b> Input New Meaning</b> dialog box (figure8).</li></ul><ul><img SRC="image/tra_dic_newmeaning.gif" height=131 width=283><h6>Figure8: Input New Meaning</h6></ul></ul></ul><ul><ul>After the customization, the new meaning entered will be valid andused in the translation candidate list. This is another method to customizethe dictionary.<br> <li><b>Information</b></li><br>Press this menu then you will get a process dialog box (figure9) ongenerating the dictionary information. When the processing is finished,the <b>Dictionary Information</b> window (figure10) is shown (or Press<b>Cancel</b>on the dialog box to terminate the action).<p><img SRC="image/tra_dic_gen_infomation.gif" height=141 width=170><h6>Figure9: Generating dictionary Information</h6><img SRC="image/tra_dic_info.gif" height=250 width=400><h6>Figure10: Dictionary information</h6></ul></ul><ul><ul>In this window, you can see the detailed information about the dictionariesused by<b> Translator</b>.<br> <li><b>Refresh</b></li><br>Refresh will make the keys in the dictionary cache (if enabled) synchronizewith the matching values in dictionaries.</ul><ul><li><b>Pack</b></li><br>If the internal implementation of dictionaries need packing to savethe storage space, select this menu item. You can pack <b>System Dictionary</b>makingit more compact, and save its storage space, or pack <b>User Dictionary</b>making it more compact, and save its storage space.</ul></ul><a NAME="Translating A Resource File"></a><b><i><font size=+1>TranslatingA Resource File</font></i></b><ol><li>Select <b>File-Open</b> to open a resource bundle file (either source fileor class file).</li><li>Once opened<b>, Translator</b> automatically locates the first value string;the string is displayed in the top-left text field above the editor window.</li><li>To view the translation, double click the string in the input window (ormark a string and right click). If there are more possible translationthen can be viewed in a list.</li><li>When you find the right meaning, select it then it is shown in the rightside text field. If there are more than one translatables in the string,the Translator automatically locates the next one that needs translation.</li><li>To copy some text without translation, select the <img SRC="image/tra_copymeaning.gif" height=25 width=22>to copy the selected portion of the string into the target field (rightside). Select <img SRC="image/tra_skipmeaning.gif" height=27 width=26>toskip a translation.</li><li>If there is no appropriate translation provided, complete the translationby typing directly your own translation text in the target field manually.</li><li>When the translated strings appears in the target field, select <b>Submit</b>from menu bar or popup menu.</li><br>The highlighted string in the resource file will be replaced by thetranslated string. To locates the next string in the resource file to betranslated, select <b>Submit&Next</b> from menu bar or popup menu.<li>To save your work, use <b>File-Save</b> or<b> Save As</b>.</li></ol><a NAME="Implementing A User Dictionary"></a><b><i><font size=+1>Importing A User Dictionary</font></i></b><p>Two kinds of user-defined dictionaries can be loaded in the translator,in Bbtf format or a class which implements com.sun.tdc.toolkit.api.Dictionaryinterface.<ul><li>Dictionary file in Bbtf format is a dictionary file in which the keys andvalues are stored in internal binary balance tree format.</li><li>Dictionary class is a bridge class to use a dictionary existed already.The class should implement <tt><a href="../api/com/sun/tdc/toolkit/api/Dictionary.html">com.sun.tdc.toolkit.api.Dictionary</a></tt>interface. It should be able to found in CLASSPATH.</li></ul>There is aleady a default blank user dictionary file at "lib/userdict_en2zh_CN.bbtf". It can be used directly (such as adding new meaning, customizing the meaningof a word or sentence).<p>To import a new user dictionary to use, the <tt><a href="../api/com/sun/tdc/toolkit/api/Dictionary.html">com.sun.tdc.toolkit.api.Dictionary</a></tt>interface must be implemented first, and the implementationmust consider other language translation. If there is a need to cache thedictionary for looking up usage, the <tt><a href="../api/com/sun/tdc/toolkit/api/DictionaryCachable.html">com.sun.tdc.toolkit.api.DictionaryCachable</a></tt>interface should also be implemented. The implementations can be usedas a bridge to connect to any existed dictionaries, even the web dictionary.That is to say, user can access other dictionaries via implementing theabove interfaces. See the example: <a href="../../samples/SampleDictionary.java"><tt>SampleDictionary.java</tt></a><br> <p><a NAME="Translator command line"></a><b><font size=+1>Translator Command-line</font></b><p>The command of Transltor is simple to use.<p>USAGE:<br> java com.sun.tdc.toolkit.translator.Translator<source file> [<output file>]<p><img SRC="image/rainbow.gif" height=6 width=100%><center><p><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><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 © 1995-1999 Sun Microsystems, Inc.</font><br><font size=-2>China Technical Development Center</font><br><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 + -