TotalNET Advanced Server 5.2 Reference Manual

tnmsgfmt

This command creates message object files from portable object files--those with the .xmsg extension--without changing the portable object files. The .xmsg file contains messages displayed to users by system commands or application programs. You can edit these files and translate the messages to any language supported by the system.

All .xmsg files have the same format. Each file contains one or more lines, and each line contains either a comment or a statement. A comment begins with a hash mark (#) and ends with a new-line character. The tnmsgfmt command ignores all comments. Statements follow this format:

directive value

Each directive starts at the beginning of the line, and white space--either spaces or tab characters--separate it from value. The value variable consists of one or more quoted strings separated by white space. Use any of the following types of directives:

domain domainname
msgid message_identifier
msgstr message_string

The value of domainname should correspond to the message file name; if you edit messages for the tnnlc_lowutils domain, the directive should read domain tnnlc_lowutils, and the output goes into the message file tnnlc_lowutils.mo.

The msgid directive specifies the value of a message identifier associated with the directive that follows it. The message_identifier variable represents the target string to use at retrieval time. Follow each msgid directive statement with a msgstr directive statement. Do not change the msgid lines, since the code uses them as keys to locate the translated strings defined by the msgstr lines that immediately follow msgid lines. Message strings may contain the following escape sequences:

\n

new line 

\t

tab 

\v

vertical tab 

\b

backspace 

\r

carriage return 

\f

form feed 

\\

backslash 

\"

double quotes 

\ddd

octalbit pattern 

\xDD

hexadecimal bit pattern 

Location


TNHOME/usr/bin

Usage


tnmsgfmt [-v] filename.xmsg

Option

-v

List duplicate message identifiers in verbose format without re-defining message strings. 

Notes

  1. Install message object files in the directory TNHOME/usr/lib/locale/msgs/lang[/charset/], where TNHOME represents the TotalNET home directory /var/opt/totalnet. The lang variable represents the message language defined in LC_MESSAGES or in LANG, and charset represents the message character set defined in LC_CHARSET.

  2. Messages can have any length; however, each line in the .xmsg file can have only MAX_INPUT (512) bytes. Installing message catalogs under the C locale serves no purpose, since the command ignores them for the sake of efficiency.