Home - RAD C++ GUI 2.0 Documentation
Published on March 17, 2008 [12:28:42 AM]



class Language


This class provides a unique and easy way of adding different languages to your applciation. The language file is actualy a text file that can be added to resources of your applciation or can be accessed at runtime. Format of languge file must be each entry on a separate line as:

[lanauge_variable]=[value_of_variable]

Example of a simplest language file:

name=Ali Imran
age=30
occupation=CEO


To add file in resources you must make sure that resource type must be RCP_LANG, to compile a language file with resources use following example:

115 RCP_LANG DISCARDABLE "language_file.txt"
Where 115 is the resource Id, RCP_LANG is the required resource type, and "language_file.txt" is the file to be added to application resources.

After the reources are compiled, the lanauge is added to your application.

To access lanauge and language variables from resources:

Language lang(115); //where 115 is Resource Id
//disply some variables from language
//assumed form1 is a Form already defined
form1.msgBox(lang["name"] + " is " + lang["occupation"]);
//which will display 'Ali Imran is CEO' if above mentioned language file is compiled with you application.


Moreover, you can also load language files at runtime, as:
Language lang("C:\\language.txt");




Functions

  Language(BinaryData bin)
  Language(DWORD resourceId)
  Language(String langFileName)
  bool load(BinaryData bin)
  bool load(DWORD resourceId)
  bool load(String fileName)
Generic Properties

  length




Visit www.radcpp.com for more help and updates. Documentation created using FlaX.Doc