Internationalization and localization tools


Project Properties Dialog Box

The Project Properties dialog is where you configure the code scanning and fixing features of Globalyzer.

On the left side of the dialog are the navigation links. When you name your project and click Apply, the outermost link will display the project name. The Base Source Path tells Globalyzer the common base directory that the project's source code shares. The individual scans will look in this directory as well as its subdirectories for the source.

Below the project name on the left are the project's defined scans. These are created with the Add Scan button on the bottom left. In a new project, there is always a default scan created. Click on the scan's name to change its settings.

A scan's main screen contains the settings for specifying the files to scan and the Rule Set to use for scanning. The Rule Set dropdown will be populated with all the Rule Sets that you have created using the Globalyzer Server. Choosing a Rule Set will populate the Source Files tree with only those files that match the File Extensions for that Rule Set. For example, you will not see .java files when you have selected a C# Rule Set. To scan source code that contains several programming languages, add a new scan for each programming language.

Checking the checkbox in the upper left corner of the Source Files tree will cause Globalyzer to scan every file in the tree. You can also select individual files and subdirectories, allowing you to fine tune the files that require scanning for internationalization issues. For example, to ignore "dead" code, leave those files or directories unchecked.

Click the Scanning link underneath a scan's name on the left to display the scanning configuration screen as shown below:

On this screen you select the types of potential internationalization issues to scan for; if you're not sure, leave them all checked. You can also set the encoding of the source code files if they differ from your system's default file format. And lastly, you can customize Globalyzer code scan comments.

  • To Do Comment -- This comment is simply a string that you or others can later search for in your source code. It may be used for any purpose that you wish.

  • Ignore Next Line Comment -- This comment is a string that Globalyzer looks for while scanning your code. When the scanner finds an "Ignore next line" comment, it ignores the next line following the comment.

  • Start Ignore Comment and End ignore comment -- These two fields work together to ignore sequential lines of code. Globalyzer looks for the "Start Ignore" comment while scanning your code. Once found, Globalyzer then scans for the "End Ignore" comment. If both strings are found in the source code file, Globalyzer ignores all the lines of code between the two ignore comment strings.

  • Externalized String Comment -- This comment is a text string that can be inserted into your source code after you externalize text. When you externalize text, the text string you externalize is appended to the end of this comment, and the entire comment is placed on the system clipboard. You can then paste it into your source code near the externalized string if you wish.

Click on the Fixing navigation link to display the configurable options of Globalyzer that you use for string externalization.

The following gives details on all fields. Note that some fields will not be visible as they are dependent on the currently selected Rule Set and Resource File Type.

  • Resource File Type: The generated resource file(s) where externalized objects are inserted will be of this type. For more information on string externalization, click here.


  • 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.


  • Tag Library: Select the tag library used by your JSP project. This list is only displayed if the current Rule Set is HTML and you have selected properties in the Resource File type field. Options are currently JSTL, struts, and none.


  • 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.


  • Use/Generate Static Retrieval Class: Check this box to instruct Globalyzer to generate a locale-sensitive string retrieval class to access your Java properties file. To use this framework, enter the method and parameters in the Retrieval Method field in one of two forms: with only the "[key]" parameter, or with an additional locale parameter. Then, fill in the following two fields with the required information.


  • Retrieval Class Name: Name of the static Java retrieval class that Globalyzer will create in the same directory as your properties file. If this field is left blank, Globalyzer will use the name of your Scan to create the retrieval class. Once created, the class name will be prepended to the Retrieval Method during string externalization.


  • Retrieval Class Package: Name of the retrieval package. This will be used to create the import statement that will be inserted at the top of all Java files in which string externalization occurs.


  • 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.


  • 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.


  • Header File Path: Specify the directory for the header resource file that Globalyzer creates during string externalization (displays when Resource File Type is set to rc or msg).


  • Bas File Path: Specify the directory for the .bas file that Globalyzer creates during string externalization (displays for Visual Basic Rule Sets when the Resource File Type set to rc).


  • Resource File Encoding: Set the file encoding of the resource file.


 

 Globalyzer Reference

 

Lingoport internationalization and localization services and software