MultiLang - a library to add several languages to applications

Features:

The structure of the translation file is:
  0|1|2
  1003|Insert|Beszúr|Einfügen
  1004|Overwrite|Felülír|Überschreiben
  1005|Modified|Módosítva|Modifiziert
  1006|Caps

Explanation:

The following C++ code shows the usage of the example translation file:
  TLangTable lang_table("translations.txt");
  lang_table.SetLang(0);                                             // or 1 for hungarian, or 2 for german
  cout << lang_table.GetText(1003).c_str() << endl;
  cout << lang_table.GetText(20000, "default text").c_str() << endl; // here the default will be used, as the example doesn't define a text with 20000

  // VCL/C++ Builder specific
  lang_table.SetLang(MainForm); // this sets the captions of all controls in the given form/dialog
                                // the Tag field of the components will be used, for example if a button's Tag field is
                                // 1004, its caption will be set to "Overwrite"

  // Windows specific
  lang_table.InitFromResource(HInstance, "translations"); // in this case, we have to add to the project an .rc file
                                                          // consisting of the following line:
                                                          // translations RCDATA translations.txt

  // a simple call to add our languages to the system menu
  LangAppendSystemMenuDefs(GetSystemMenu(Handle, FALSE)); // the result is this
  // the application will have to handle the WM_SYSCOMMAND messages, with IDM_LANG_EN, IDM_LANG_HU and IDM_LANG_DE parameters

Applications that use the library:


Attila NAGY Last updated: 2018-08-30