~ubuntu-branches/ubuntu/quantal/netbeans/quantal

« back to all changes in this revision

Viewing changes to java/helpset/javahelp/org/netbeans/modules/java/helpset/docs/internationalize/i18nwizard.html

  • Committer: Bazaar Package Importer
  • Author(s): Marek Slama
  • Date: 2008-01-29 14:11:22 UTC
  • Revision ID: james.westby@ubuntu.com-20080129141122-fnzjbo11ntghxfu7
Tags: upstream-6.0.1
ImportĀ upstreamĀ versionĀ 6.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<!--       
 
3
*     Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
 
4
*     Use is subject to license terms.
 
5
-->
 
6
<html>
 
7
<head>
 
8
<title>Internationalizing a Set of Files With the Internationalization Wizard</title>
 
9
<link rel="StyleSheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
 
10
</head>
 
11
<body>
 
12
 
 
13
<h2>Internationalizing a Set of Files With the Internationalization Wizard</h2>
 
14
<p> <small><a href="#seealso">See Also</a>&nbsp; </small>
 
15
<p>The Internationalization wizard enables you to replace hard-coded strings with 
 
16
  internationalized strings in multiple files. If you are localizing the source 
 
17
  into more than one language, the Internationalization wizard also lets you specify 
 
18
  the localized string for multiple locales.</p>
 
19
 
 
20
<p> <b>To automatically internationalize strings in multiple source files:</b> 
 
21
<ol>
 
22
  <li>Choose Tools  &gt; Internationalization 
 
23
     &gt; Internationalization 
 
24
    Wizard from the main window.</li>    
 
25
  <li>Click Add Source(s) to add one or more source files to internationalize. 
 
26
    Click Next to proceed.</li>
 
27
  <li>Click Select All if you want a single resource bundle to contain the key and 
 
28
    value pairs for all the listed sources. To select a resource bundle for specific
 
29
    source files, select the desired sources and click Select Resource. 
 
30
    In the Select Resource dialog, select the 
 
31
    desired <tt>.properties</tt> file or create a new file. 
 
32
    Click Next to proceed.
 
33
 
 
34
</li>
 
35
 
 
36
 
 
37
  <li>Modify additional values (Advanced Wizard only). You can create a variable 
 
38
    that points to the resource bundle. The variable is then used in the method 
 
39
    calls, which retrieve the localized strings. You must use the <tt>{identifier}.getString("{key}")</tt> 
 
40
    format to access the resource bundle through a variable.
 
41
    
 
42
<!--PENDING : language overly vague - explain why this is useful via context-->
 
43
    
 
44
  <ul class="note"> 
 
45
    <li>This feature is available for Java 
 
46
    sources only and not for other types of files, such as JavaServer Pages
 
47
    <small><sup>TM</sup></small>. To use this feature, set the Advanced Wizard 
 
48
    property in the Internationalization settings to True. 
 
49
    </ul>
 
50
 
 
51
    <p>To modify key and value pairs:
 
52
    <ol>
 
53
      <li>From the Source combo box, select the source file in which you want 
 
54
        to create the variable. </li>
 
55
      <li>Select the Generate Field checkbox and set the variable's modifiers.</li>
 
56
      <li>Type the name of the identifier in the Identifier text field.</li>
 
57
      <li>The Init String field gives you a preview of the code that the variable 
 
58
        will use to reference the resource bundle. To change this code, click 
 
59
        Format and select the desired code format from the Init Code Format Editor. 
 
60
      </li>
 
61
      <li>Click Next to generate the field.</li>
 
62
    </ol></li>
 
63
  <li>In the Modify Found Strings pane, set the key name and localized values 
 
64
    for each of the strings you want to internationalize by entering a new value 
 
65
    in the appropriate column. Use the Source combo box to switch between source 
 
66
    files. Deselect the checkbox in the first column for any string you do not 
 
67
    want to internationalize. 
 
68
    </li>
 
69
  <li>To change the code format used to generate the internationalized string 
 
70
    or add arguments to the method call, click the ellipsis button (...) at the 
 
71
    end of the string's row.</li>
 
72
  <li>Click Finish to internationalize the strings for all of the selected source 
 
73
    files.</li>
 
74
</ol>
 
75
 
 
76
<dl>
 
77
    <dt><a name="seealso">See Also</a></dt>
 
78
    <dd><a href="autoinsert.html">Internationalizing a Single File</a></dd>
 
79
    <dd><a href="manualinsert.html">Inserting an Internationalized String Into Source Code</a></dd>
 
80
    <dd><a href="custominter.html">Configuring Internationalization Settings</a></dd>
 
81
  </dl>
 
82
 
 
83
<hr><small><a href="../credits.html">Legal Notices</a></small>
 
84
 
 
85
<table border="0" cellpadding="50">
 
86
<tr><td>&nbsp;</td></tr>
 
87
</table></body>
 
88
</html>