2.9.16
Coherent GT
A modern user interface library for games
Coherent::UIGT::LocalizationManager Class Referenceabstract

Takes care of translating text between different locales. More...

#include <Coherent/Coherent/UIGT/UISystem.h>

Public Member Functions

virtual const char * Translate (const char *text)=0
 Translates the given text. The returned value must be UTF-8 encoded and outlive the method - it's safe to delete the string on the next call to this method or after the system has been uninitialized. Return nullptr if there's no translation for the text. Your application must take care of tracking the current locale and translating the text according to it. More...
 

Detailed Description

Takes care of translating text between different locales.

Warning
THIS CLASS MUST BE THREAD-SAFE as it WILL be called from different threads during the UISystem's lifetime

Member Function Documentation

◆ Translate()

virtual const char* Coherent::UIGT::LocalizationManager::Translate ( const char *  text)
pure virtual

Translates the given text. The returned value must be UTF-8 encoded and outlive the method - it's safe to delete the string on the next call to this method or after the system has been uninitialized. Return nullptr if there's no translation for the text. Your application must take care of tracking the current locale and translating the text according to it.

Parameters
textthe key to the text that needs translation
Returns
the translation of the given text, encoded in UTF-8