Content


NTL
Core
ITranslate

ITranslate


Provides internationalization capability. You may access this via application getTranslate().

You can find more information in comments below.

class ITranslate
{
public:
    using Params = std::map<String, String>;
public:
    virtual String getLanguage() = 0; // Return current active language name 

    virtual bool setLanguage(const String &value) = 0; // Activate language by name and send translation change notifications to every entity(via IApplicationService::SendTranslateChangeNotification method) 

    virtual String t(const String &category, const String &key) = 0; // Translate specified key located in specified category with current active language 
    virtual String t(const String &category, const String &key, const Params ¶ms) = 0; // Translate specified key located in specified category with current active language. Replace all occurances of keys in params with corresponding values 

    virtual bool Add(const String &language, const String &category, const String &key, const String &value) = 0; // Add new translation key 
    virtual bool Set(const String &language, const String &category, const String &key, const String &value) = 0; // Add new or replace existing translation key 
};
Namespace: nitisa
Include: Nitisa/Interfaces/ITranslate.h