Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Document the new POSIX NLS based catalog policy.

  • Loading branch information...
commit ca670e770413a996719f954e565543936b4e3c24 1 parent afa6c7e
@lichray authored
Showing with 22 additions and 45 deletions.
  1. +22 −45 catalog/README
67 catalog/README
@@ -1,15 +1,9 @@
-# $Id: README,v 8.5 2012/10/19 15:17:44 zy Exp $
+# $Id: README,v 9.0 2012/10/19 17:06:15 zy Exp $
Generally, all non-system error and informational messages in nvi are
catalog messages, i.e. they can be tailored to a specific langauge.
-Command strings, usage strings, system errors and other "known text"
-are not. It would certainly be possible to internationalize all the
-text strings in nvi, but it's unclear that it's the right thing to do.
-First, there's no portable way to do message catalogs. The System V
-scheme is a reasonable choice, but none of the 4BSD derived systems
-support it. So, catalogs are completely implemented within nvi, and
-don't require any library support.
+Command strings, usage strings, system errors and other 'known text'
+are not.
Message catalogs in nvi are fairly simple. Every catalog message
consists of two parts -- an initial number followed by a pipe (`|')
@@ -71,47 +65,30 @@ example:
006 "unable to store line %lu"
007 "unable to get last line"
-are the first few lines of the current english.base file. Note that
-message #1 is missing -- the first message of each catalog is a special
-one, so that nvi can recognize message catalog files. It's added by the
-Makefile script that creates the second version of the message catalog.
+are the first few lines of the current english.base file.
-The second file is the file used by nvi to access messages, and is a list
-of the messages, one per line:
+Before this file being converted to the second file, the POSIX formatted
+message catalog file, by gencat(1), two lines:
- Line length overflowX
- unable to delete line %luX
- unable to append to line %luX
- unable to insert at line %luX
- unable to store line %luX
- unable to get last lineX
+ $set 1
+ $quote "
-Note that all messages have had a trailing 'X' character appended. This
-is to provide nvi a place to store a trailing '\0' for the message so that
-C library routines that expect one won't be disappointed.
+will be inserted before the base text to setup the set_id and the quote
+character. So the double-quote needs to be escaped by a backslash to be
+included in a message; same as the backslash itself.
-These files are named for their language, e.g. "english". The second
-files are automatically created from the first files.
+These files are named for their language, e.g. "english". However, a
+locale(1) name is also recommended.
To create a new catalog for nvi:
Copy the file english.base to a file that you can modify , e.g. "cp
english.base german.base". For each of the messages in the file,
-replace the message with the string that you want to use. To find out
-what the arguments to a message are, I'm afraid you'll have to search
-the source code for the message number. You can find them fairly quickly
-by doing:
- cd ..; egrep '123\|' */*.[chys]
-I'm sorry that there's not an easier way, but I couldn't think of
-anything that wasn't a lot of work.
+replace the message with the string that you want to use. If you have
+doubts about the meaning of a message, just email me.
-If, for some reason, you don't have the file english.base, or you
-have new sources for which you want to create a new base catalog, you
-can create it by running the command "make english" in the catalog
+A latest english.base can be created from source by running the command
+"make english" in the catalog/ directory.
Once you've translated all of the strings, then add your catalog to the
"CAT=" line of the Makefile, and run the command "make catalog". This
@@ -140,11 +117,11 @@ a single place.
To select a catalog when running nvi, set the "msgcat" option. If the
value of this option ends with a '/', it is treated as the name of a
-directory that contains a message catalog "XXXX", where XXXX is the
-value of the LC_MESSAGES environment variable, if it's set, or the value
-of the LANG environment variable if it's not. If neither of those
-environment variables are set, or if the option doesn't end in a '/',
-the option is treated as the full path name of the message catalog to use.
+directory that contains a message catalog "$LC_MESSAGES", which is set
+through the LC_MESSAGES environment variable but returned by setlocale(3).
+Check the output of locale(1) to validate such a value. If the option
+doesn't end in a '/', the option is treated as the full path name of the
+message catalog to use.
If any messages are missing from the catalog, the backup text (English)
is used instead.

0 comments on commit ca670e7

Please sign in to comment.
Something went wrong with that request. Please try again.