virtual void Translate(TranslateInfo* ptranslateInfo);
Translate method implements a UTF-8/UCS-2 translation interface and performs lookup of 'ptranslateInfo->GetKey()' string for language translation, filling in the destination buffer by calling TranslateInfo::SetResult or TranslateInfo::SetResultHtml method. 'ptranslateInfo' is guaranteed to be not null. If neither TranslateInfo::SetResult nor TranslateInfo::SetResultHtml is called then original text will not be changed.
Example of Translate method implementation:
virtual bool Translate(TranslateInfo* ptranslateInfo) { // Translate '$hi' into bold 'Hello!'. const char* pkey = ptranslateInfo->GetKey(); if (pkey[0] == '$') { String key(pkey); if (pkey == "$hi") { ptranslateInfo->SetResultHtml("<b>Hello!</b>"); } } }
Parameters |
Description |
TranslateInfo* ptranslateInfo |
Pointer on TranslateInfo class which provides data exchange between GFx core and user code. Guaranteed to be not null. |