1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
http-analyze Multi-National Language Support (MNLS)
---------------------------------------------------
The multi-national language support includes localized buttons and message
catalogs. The message catalogs are contained in this directory and are
named after the scheme
ha-LANGUAGE[_TERRITORY].str
where "LANGUAGE" is a two-letter ISO code and "TERRITORY" is the country this
language is spoken in. For example, a user who speaks German as it is spoken
in Switzerland, would create a message file
ha-de_CH.str
The format of this file is:
Comments:
Anything after a `$' is a comment. For example, each catalog
starts with:
$ Message catalog for http-analyze (de)
$ ### Messages from http-analyze.c ###
Messages:
Message are lines starting with a message number followed by text in
a specific charset. For example, the first four german messages are:
1 Registriert fr
2 Testversion - bitte sehen Sie %s\n
3 Anwendung:\n
4 Benutzen Sie `%s -h' fr eine Kurzbeschreibung.\n\n
The charset of the messages for the statistics report currently must
be the same as the chasrset for messages displayed when running
http-analyze.
The message may contain special printf-style formatting sequences
like in:
108 Kann Button-Directory `%s' nicht erstellen (%s)\n
or HTML codes like in:
172 Bitte benutzen Sie die <A HREF="index.html">\
konventionelle Version</A> des Statistikreports.
The last example shows also how to break a logical line into two or
more physical lines. By escaping the newline with a backslash (`\')
the message can be continued on the following line.
Care should be taken to not add or remove newline escape sequences
(`\n') by accident.
Installation of Message Catalogs
--------------------------------
The location of message catalogs is usually defined in nl_types(5) if
X/Open support is available. Usually, the NLSPATH variable provides both
the location of message catalogues, in the form of a search path, and the
naming conventions associated with message catalogue files. For example:
NLSPATH=/usr/lib/locale/%L/LC_MESSAGES/%N
where %L is the content of the LANG environment variable and %N is the
name "http-analyze" for the message catalog. For example, the french
message catalog is located in a file named:
/usr/lib/locale/fr/LC_MESSAGES/http-analyze
To install a message catalog in a locale, the command "gencat" is used
for the X/Open method. Edit the Makefile and set the name of the locale
directory or specify it on the command line:
$ make LOCALE=/usr/lib/locale
for idx in en en_US de de_BY it fr pt_BR ru; do \
gencat /usr/lib/locale/$idx/LC_MESSAGES/http-analyze ha-$idx.str; done
touch xpgcat
Now all catalogs are installed. Note that they need a version of http-analyze
compiled with the USE_XPGCAT macro in config.h.
The alternative method is to use the System V Release 4 MNLS. The required
source files contain only messages, one per line. Since this format is
very unhandy for modification and enhancements, those files are generated
automatically from the corresponding X/Open message source files using the
perl script "gen-msgcat":
$ make svr4cat
perl gen-msgcat ha-en.str >ha-en.cat
perl gen-msgcat ha-en_US.str >ha-en_US.cat
perl gen-msgcat ha-de.str >ha-de.cat
perl gen-msgcat ha-de_BY.str >ha-de_BY.cat
perl gen-msgcat ha-it.str >ha-it.cat
perl gen-msgcat ha-fr.str >ha-fr.cat
perl gen-msgcat ha-pt_BR.str >ha-pt_BR.cat
perl gen-msgcat ha-ru.str >ha-ru.cat
for idx in en en_US de de_BY it fr pt_BR ru; do \
mkmsgs -o -i $idx ha-$idx.cat http-analyze; done
touch svr4cat
Note: If the perl script does not run on your system, it is because the SVR4
catalog files are already included in the distribution. Don't remove them
("make clean") unless you have perl installed.
The mkmsgs command above installs the message catalogs in the appropirate
locale directory. Note that they need a version of http-analyze compiled
with the USE_SVR4CAT macro in config.h.
The third and last method is native MNLS by http-analyze. The message
catalogs in SVR4 format are copied into the directory HA_LIBDIR/msgcat.
http-analyze uses then own functions to access the message catalogs.
$ make mycat
test -d /usr/local/lib/http-analyze/msgcat || \
mkdir /usr/local/lib/http-analyze/msgcat
cp ha-en.cat ha-en_US.cat ha-de.cat ha-de_BY.cat ha-it.cat \
ha-fr.cat ha-pt_BR.cat ha-ru.cat /usr/local/lib/http-analyze/msgcat
touch mycat
Now all catalogs are installed. Unless in the X/Open and SVR4 method,
http-analyze does not use the LANG mechanism, but an own environment
variable "HA_LANG". Note that they need a version of http-analyze
compiled with the USE_MYCAT macro in config.h.
|