PSL International Functions
The functions listed in the following table can help you write internationalized PSL scripts. For more information about any PSL function, see PSL Built-in Functions.
Function | Definition |
---|---|
General International Functions | |
code_cvt() | convert a string from one codeset to another |
convert_locale_date() | change the format of a date string |
num_bytes() | return the length of a string in bytes |
set_locale() | set or get the value of a locale category |
ID-Based Messaging Functions | |
msg_check() | check the validity of a message ID and message catalog |
msg_get_format() | return the format information for a message |
msg_get_severity() | return an integer that explains the severity of a message |
msg_printf() | print message text formatted by information from a catalog |
msg_sprintf() | return message text formatted by information from a catalog |
String-Based Messaging Functions | |
dcget_text() | return message text by defining the domain and category |
dget_text() | return message text by defining the domain only |
get_text() | return message text |
text_domain() | set or get the current name of the domain |
ID-Based Messaging Functions
The ID-based messaging functions in the following table require that you use a message catalog. The following PATROL manuals describe how to create a message catalog: PATROL Console for Unix User Guide and PATROL Console for Microsoft Windows User Guide Customizing PATROL Volume 3.
To use an existing ID-based message catalog, you must know the name of the .lib file for the catalog. In internationalized scripts, use the requires statement to identify the .lib file and call an INIT function based on the .lib file name. For example, if the name of the .lib file is example.lib, include the following lines of code:
requires "example.lib";
. . .
INIT_example();
The example catalog contains the following information:
VENDOR_ID 1
VENDOR BMC Software
TOOL_ID 23
TOOL PATROL Demo
VERSION 1.0
DATE 13-Mar-1997
#----------------------------------------------------
ID 145 DEMO_HELLO INFO CURRENT
MESSAGE "Hello World"
The requires statement makes the message catalog available to your script. The INIT function allows you to reference either the message ID number or message ID name. Without this function, you can use only the ID number. In the preceding example, executing the INIT function makes the msg_check(DEMO_HELLO) command equal to msg_check(145).
Comments
Log in or register to comment.