Previous Next


Since version 2.0.0, M!Table supports localization of built-in windows, dialogues and messages.


Language files
All required strings are located in a language file. There is one language file per language.
By default M!Table supports German and English, so it comes with two language files, MTBLLANG.DE (German) and MTBLLANG.EN (English).
Please note that you have to distribute these files with your application, otherwise M!Table will not function properly.
The files must be in the same directory where MTBLxx.DLL is located.

A language file is in the good old Microsoft initialization file (INI) format. It consists of sections, keywords, values and optional comments:

Keyword = Value

A section contains related keywords and values, e.g. the section "[Printing]" contains all keywords and values related to printing.
A keyword is like the name of a value, and a value is the string which is finally displayed.

M!Table internally uses the Windows API function GetPrivateProfileString to read strings from a language file.

Custom languages
To implement and use a custom language, three steps are required:

Step 1: Create an appropriate language file
The following approach is recommended:
First make a copy of one of the default language files ( MTBLLANG.DE if you speak German, MTBLLANG.EN if you speak English ) and give it a "speaking name" ( e.g. MTBLLANG.FR for French ). Then replace each string ( to the right of the equal sign ) you'd like to translate with the appropriate translation. Make sure that you don't modify the keywords, otherwise M!Table won't find them anymore. When it' s done, save the file and copy it to the desired location.

Step 2: Register the language in your application
The language registration is done with the function MTblRegisterLanguage.
It has two parameters: the desired language ID and the name ( or full path ) of the language file.
You should specify a negative language ID because the built in languages have positive IDs.
Let's say you have created the language file MTBLLANG.FR (French). The registration would be like this:

Call MTblRegisterLanguage( -1, "MTBLLANG.FR" )

Because the registration is on application level, it's sufficient to call the function once, e.g. on SAM_AppStartup.
If only a filename is given, M!Table assumes that the file is in the same directory where MTBLxx.DLL is located.

Step 3: Pass the registered language ID to a language-aware function
The following functions are language-aware:
MTblExportToExcel, MTblExportToExcelEx, MTblExportToOOCalc, MTblPrint.

Created with the Personal Edition of HelpNDoc: Free Kindle producer