JavaScript Resource File
For JavaScript resource files, we are using rjs as the file extension. This
allows Globalyzer's Resource Editor to distinguish JavaScript resource files from
js code files.
To associate this resource file type with your Scan, select
Scan=>Manage Scans, modify the Scan, and navigate to the
Globalyzer String Externalization page. Select rjs
in the Resource File Type dropdown.
Note that the resource types available are dependent on the programming language of
the Scan's Rule Set. For example, a JavaScript Scan can have a rjs resource type.
The following describes how to set the fields for this resource type:
- Resource File Type: The generated resource file(s)
where externalized objects are inserted will be of this type.
- Resource File Frequency: Project means there
will be only one file, while Source File means each individual
source file where strings are externalized will receive its own
corresponding resource file.
- Retrieval Method: The method signature your program
uses to retrieve resources from a resource file. For example, in
Java, the call might be: myBundle.getResourceText("somekey").
In this case, you would enter myBundle.getResourceText("[key]")
in the Retrieval Method field.
- String Key Format: This field displays the current
format for the resource keys that Globalyzer creates during string
externalization. Click the Edit Format button to change the
format, allowing you to completely customize your resource keys.
- String Key Next ID: Initially set to 1, this field is
incremented each time you externalize a string, and is used as the ID
part of the String Key Format. In this way, Globalyzer
maintains uniqueness across all resource keys.
- Share Strings: Allow the sharing of keys for
identical strings.
- Externalized String Comment: This will be used if you
choose to add a comment after externalizing a string. Select Window=>Preferences=>Globalyzer
and check Automatically Insert Externalized String Comment.
- Resource File Path: This is where your resource file
is stored. Add a name if you don't already have a file. In the case
where Resource File Frequency is set to Source File,
Globalyzer will create multiple resource files, with names that
correspond to the source filenames. For example, for a file named SwingTest.java,
Globalyzer will create a resource file name SwingTest.properties
to hold its externalized strings.
- Resource File Encoding: Set the file encoding of the
resource file. Globalyzer will assume all your resource files
of this type are the same encoding, although it will ensure that if a resource file has
BOM bytes (bytes at the beginning of the file that indicate encoding), it will access the
file properly, regardless the Project's Resource File Encoding setting. To see the
encoding of an individual file, right-click on the file in the Project Explorer view
and select Properties.
|