Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ gettxt(1) — Reliant UNIX 5.44c4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

exstr(1)

mkmsgs(1)

srchtxt(1)

gettxt(3C)

setlocale(3C)

gettxt(1)                                                         gettxt(1)

NAME
     gettxt - retrieve a text string from a message database (get text)

SYNOPSIS
     gettxt msgfile:msgnum ["defaultmsg"]

DESCRIPTION
     gettxt retrieves a text string associated with a message number from a
     message text file.

OPERANDS
     msgfile
          Basename (i.e. without the path prefix) of the message file from
          which gettxt is to retrieve msgnum. The basename can be up to 14
          characters in length, but may not contain any of the following
          characters: \0 (null byte), / (slash), or : (colon).

          msgfile must have been created by the mkmsgs utility and must
          reside in the directory /usr/lib/locale/Locale/LCMESSAGES. The
          basename of the directory /usr/lib/locale/Locale corresponds to
          the language in which the text strings are written in the message
          file [see setlocale(3C)].

          You can control which /usr/lib/locale/Locale directory is to be
          searched to find the message file containing the specified msgnum
          by setting the environment variable LCMESSAGES (see below).

     msgnum
          Sequence number of the string to be retrieved from msgfile. The
          strings in msgfile are numbered sequentially from 1 to n, where n
          is the number of strings contained in msgfile.

     "defaultmsg"
          If gettxt cannot locate the required string in the message file
          whose pathname is defined by the LCMESSAGES variable, it tries
          to retrieve the string associated with msgnum from the file
          /usr/lib/locale/C/LCMESSAGES/msgfile. If the required string
          cannot be found there either, the message "Message not found!!"
          is issued. If either msgfile or msgnum does not exist, gettxt
          issues the specified defaultmsg.

          "defaultmsg" not specified or "" (null):

          If gettxt cannot locate the required string in the message file
          whose pathname is defined by the LCMESSAGES variable, it tries
          to retrieve the string associated with msgnum from the file
          /usr/lib/locale/C/LCMESSAGES/msgfile. If the required string
          cannot be found there either, or if msgfile does not exist, the
          string "Message not found!!" is displayed.






Page 1                       Reliant UNIX 5.44                Printed 11/98

gettxt(1)                                                         gettxt(1)

LOCALE
     The LCMESSAGES environment variable governs the language in which
     message texts are displayed.

     LCTYPE governs character classes and character conversion (shifting).

     If LCMESSAGES or LCTYPE is undefined or is defined as the null
     string, it defaults to the value of LANG. If LANG is likewise unde-
     fined or null, the system acts as if it were not internationalized.

     If any of the locale variables has an invalid value, the system acts
     as if none of the variables were set.

     The LCALL environment variable governs the entire locale. LCALL
     takes precedence over all the other environment variables which affect
     internationalization.

EXAMPLES
     Let us assume the following files exist:

     Contents of inputfile1:

     Hallo !\n\007
     Gute   ... Nacht !\n
     Guten Morgen !\n

     Contents of inputfile2:

     Salut !\n
     Bonne nuit !\n

     The message files are created and installed as described below:

     The directories /usr/lib/locale/german/LCMESSAGES and
     /usr/lib/locale/french/LCMESSAGES do not exist. The system adminis-
     trator therefore creates the directory /usr/lib/locale/german with a
     file named hallo in it by issuing the following call:

     $ mkmsgs -i german inputfile1 hallo

     The call

     $ mkmsgs inputfile2 hallo

     creates a file named hallo in the current directory. To enable the
     subsequent use of this file in the french locale with gettxt, the sys-
     tem administrator must then perform the following actions:

     $ mkdir /usr/lib/locale/french
     $ mkdir /usr/lib/locale/french/LCMESSAGES
     $ cp hallo /usr/lib/locale/french/LCMESSAGES/hallo



Page 2                       Reliant UNIX 5.44                Printed 11/98

gettxt(1)                                                         gettxt(1)

     These files are accessed as follows: if LCMESSAGES has a null value
     and the value of LANG is german:

     $ gettxt hallo:1 "Hello!\n"
     Hallo !

     The terminal bell rings at the same time.

     $ gettxt hallo:2 "Good Night!\n"
     Gute   ... Nacht !
     $ gettxt hallo:3 "Good Morning!\n"
     Guten Morgen !
     $ LCMESSAGES=french
     $ export LCMESSAGES
     $ gettxt hallo:1 "Hello!\n"
     Salut !
     $ gettxt hallo:2 "Good Night!\n"
     Bonne nuit !\n
     $ gettxt hallo:3 "Good Morning!\n"
     Message not found!!

     Invoking hallo:3 causes the message Message not found!! to be
     displayed, since there are only two messages in the file
     /usr/lib/locale/french/LCMESSAGES/hallo.

     $ LCMESSAGES=invalid
     $ gettxt hallo:1 "Hello!\n"
     Hello
     $ gettxt hallo:2 "Good Night!\n"
     Good Night!

     Invoking hallo:1 or hallo:2 causes the default message "defaultmsg"
     to be displayed, as there is no existing file named
     /usr/lib/locale/invalid/LCMESSAGES/hallo. If no "defaultmsg" were
     specified, the message "Message not found!!" would be displayed [see
     gettxt(3C)].

FILES
     /usr/lib/locale/Locale/LCMESSAGES/*
          Message files created by mkmsgs for different languages.

     /usr/lib/locale/C/LCMESSAGES/*
          Default message files created by mkmsgs.

SEE ALSO
     exstr(1), mkmsgs(1), srchtxt(1), gettxt(3C), setlocale(3C).








Page 3                       Reliant UNIX 5.44                Printed 11/98

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026