{= include("docs.util"); start_docs_page(docs.technical_manual.page_titles.languagemodules); =}

All text displayed by $PRODUCT_NAME can be modified, customized, or translated by modifying $PRODUCT_NAME's Language Module files. This includes the links at the top of the interface, the name of table headers in the reports and this documentation. Language modules are text files, located in the languages sub$lang_stats.directory of the LogAnalysisInfo sub$lang_stats.directory. Documentation is separate, in the docs sub$lang_stats.directory, which contains all the text $PRODUCT_NAME ever displays. The documentation files can be duplicated, renamed, and modified to provide translations into any language. By modifying the language modules, or creating your own, you can translate $PRODUCT_NAME's interface into any language, or you can customize any text that $PRODUCT_NAME generates. Some language translations already exist; visit the $PRODUCT_NAME web site for more information. If you need translations into other languages, that will be under your own discretion.

There are four language module files which together define every bit of text $PRODUCT_NAME ever generates (plus, there are the documentation files).

They are:

For example, if all you need is a translation of the statistics you can use the English administrative interface, but you need to provide statistics in the native language of your clients, then you only need a translation of the lang_stats module. If you need to be able to use the profile list, configuration page, Scheduler, or other features in a language other than English, you will need translations of the lang_admin, lang_options, and lang_messages modules.

Creating a New Language Module

To begin translating, duplicate the "english" $lang_stats.directory in the languages $lang_stats.directory of the LogAnalysisInfo $lang_stats.directory, and change its name to the new language and then edit the files inside it. To switch languages, change the language specified in the preferences.cfg file of the LogAnalysisInfo $lang_stats.directory to match the name of the $lang_stats.directory you created.

Language Module Syntax

Language modules are configuration files, and their syntax is described in {=docs_chapter_link('configfiles')=}.

When translating or customizing a language module, you should not change the names of variables--those must remain exactly as they are. Only the values should be changed.

Debugging Language Modules

When you write a language module, you must be precise in the syntax and even a small error, like an unclosed quote, can make the entire file unreadable by $PRODUCT_NAME. This may result in a situation where $PRODUCT_NAME can't even report the error properly because the error message is in the corrupted language module.

This sort of a problem is difficult to track down, so a special feature of $PRODUCT_NAME lets you debug language modules easily. It requires a command-line version of $PRODUCT_NAME, and you must change the name of the $PRODUCT_NAME executable so that it contains the characters "lmd" (that stands for Language Module Debug) -- for instance, you might change the name of the program to $(PRODUCT_EXECUTABLE_DOCS)_lmd. Once you've done that, run $(PRODUCT_NAME). When it notices that its name contains "lmd", it will start generating information about the language modules it's reading, including the tokens it's processing and the name/value pairs it's finding. It is usually a simple matter to examine the output and see where the erroneous quote or bracket is.

Special Language Module Variables

Language modules are configuration files, and can contain references to any other configuration variables, using the standard dollar-sign syntax. Any variable in the configuration hierarchy can be referenced in this way.

Some special variables are also available:

{= end_docs_page() =}