Open Reality Reference Guide
FBMultiLangManager Class Reference

Language manager. More...

#include <fbmultilang.h>

Public Member Functions

 FBMultiLangManager ()
 Constructor. More...
 
 ~FBMultiLangManager ()
 Destructor. More...
 
const char * GetCurrentLanguage () const
 Obtain the current language. More...
 
bool SetCurrentLanguage (const char *pLanguage)
 Set the current language. More...
 

Public Attributes

FBStringList Languages
 List of available languages. More...
 

Detailed Description

Language manager.

The class FBMultiLangManager indicates the supported languages and allows to query and change the current language.

The support for localization is done using conversion tables from internal names to language specific names, so that they can be used in the GUI and other human readable contexts.

Warning
At this time, changing the current language will not affect the GUI. Only calls to functions 'FBGetMultiLangText()' will be affected.

The following sample code lists the names of the supported languages:

Python sample code:

from pyfbsdk import *
lManager = FBMultiLangManager()
print 'Current localization language: ', lManager.GetCurrentLanguage()
print 'Supported languages:'
for lLanguage in lManager.Languages:
print ' ', lLanguage
FBMultiLangManager()
Constructor.
FBStringList Languages
List of available languages.
Definition: fbmultilang.h:274
const char * GetCurrentLanguage() const
Obtain the current language.

C++ sample code:

FBTrace( "Current localization language: %s\n", lManager.GetCurrentLanguage());
FBTrace( "Supported languages:\n" );
int lIdx = 0;
while( lIdx < lManager.Languages.GetCount())
{
FBTrace( " %s\n", lManager.Languages[lIdx++] );
}
Language manager.
Definition: fbmultilang.h:233
int GetCount() const
Get the number of items in the list.
K_DLLIMPORT void FBTrace(const char *pFormatString,...)
This function prints useful debugging strings in the console with kFBNORMAL_TRACE output detailed lev...

Definition at line 232 of file fbmultilang.h.

Constructor & Destructor Documentation

◆ FBMultiLangManager()

Constructor.

◆ ~FBMultiLangManager()

Destructor.

Member Function Documentation

◆ GetCurrentLanguage()

const char* GetCurrentLanguage ( ) const

Obtain the current language.

Query the current language used for the GUI.

Returns
Will return the string associated with the current language used.

◆ SetCurrentLanguage()

bool SetCurrentLanguage ( const char *  pLanguage)

Set the current language.

Change the current language to another available language.

Parameters
pLanguageThe string corresponding to the desired language, as defined in property Languages.
Returns
Indicate if the change of language was successful.
Warning
Setting the current language will affect the lookup done with the functions FBGetMultiLangText, but will not have any effect on the GUI.

Member Data Documentation

◆ Languages

FBStringList Languages

List of available languages.

Warning
This list should not be modified. Changes to its value will not affect the languages supported.

Definition at line 274 of file fbmultilang.h.


The documentation for this class was generated from the following file: