		README-file for the text system

  TkRat software and its included text is Copyright 1996 by Martin Forssen.

 
  Postilion software and its included text and images
  Copyright (C) 1998 Nic Bernstein
 
  The full text of the legal notices is contained in the files called
  COPYING and COPYRIGHT.TkRat, included with this distribution.
 
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.
  
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
 
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.


The dotext.tcl program builds the text files used by TkRat from the
source files (suffixes .text and .help) located in this directory.

    TO ADD A NEW LANGUAGE

The only thing that has to be done to add a new language is to modify
the "languages" list in dotext.tcl. This will work since all messages that
are not provided in the new language will fallback to the english version:-)
It is however appreciated if the person adding a new language also produces
texts for that language.
The syntax of the source files should be obvious (but is documented below
anyway). You can use dotext.tcl ('tclsh7.5 dotext.tcl') to check if you
have provided all needed texts for a new language. dotext.tcl will warn
about any missing definitions.


    FORMAT OF THE SOURCE FILES

The texts of TkRat is divided among three variables t, changes and help.
There is a one-to-one correlation between source-files in this directory
and variables (messages.text-t changes.text-changes help.help-help).
Each source file starts with a variable statement:

	variable <var>

Where <var> is the name of the variable that the content of this file should
go into. After that the .text files consists of a lot of labels and their
definitions. Each looks like:

	label <lab>
	<l1> <Message in language 1>
	<l2> <Message in language 2>

Where <lab> is the label name (must be lower-case and unique) and <l1> and
<l2> are shorhand names for languages as defined in the "languages" list
in dotext.tcl.

The .help file looks a little different. Each entry looks like:

	node <parent> <node>
	title <l1> <Title in language 1>
	title <l2> <Title in language 2>
	<l1> <Text in language 1>
	<l2> <Text in language 2>

<parent> and <node> are used to build a tree structure of nodes, the user
will never see them. <l1> and <l2> are defined as above.

The files are read via the tcl source command. That means that they will
follow the usual tcl qutation rules etc. That is:

    * A message that contains embedded spaces bust be enclosed in quotes ("")
      or braces ({}). Example: "Tkrat 0.64"
    * A message which contains newlines must be enclosed by braces ({}).

It is always a good idea to look how the file are written before adding
anything new.


    FORMAT OF THE GENERATED FILES

The output is generated in the directory specified by the outdir variable
in dotext.tcl. First a file languages.tcl is create and in this file a
procedure GetLanguages is defined. This procedure returns a list of the
available languages. This file alse defines the InitMessages proc, which
should be called to initialize a set of messages (arguments are variable
and language).
The actual messages are stored in files named text_<var>_<language>.tcl
where <var> is the variable and <language> is the language of the
messages in the file. Each such file contains one proc which is named
"init_VAR_LANGUAGE" (VAR and LANGUAGE are substituted with the apropriate
values), this is used by the autoloading mechanism.



This command builds the text files from the data files found in this
directory. As input is uses all files in ths directory which ends in
".text". These files should be in the following format:

variable <var>

label <lab>
<l1> <Message in language 1>
<l2> <Message in language 2>
[etc...]

label <lab2>
[etc...]

Where <var> is the name of the variable which is to hold these messages.
<lab> is the label of a message, <l1> and <l2> are language shorthand
names as specified below.

