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 für 2 Testversion - bitte sehen Sie %s\n 3 Anwendung:\n 4 Benutzen Sie `%s -h' für 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 \ konventionelle Version 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.