#include <QY2Translator.h>
Public Member Functions | |
QY2Translator (QObject *parent) | |
virtual QString | translate (const char *context, const char *sourceText, const char *disambiguation=0, int nPlural=-1) const Q_DECL_OVERRIDE |
Helper class to enable YaST translations (using xgettext) even in a Qt context, e.g. for .ui files which use QCoreApplication::translate() in the generated ui_*.h files.
NOTICE: This requires a QY2 or YQ prefix for those classes!
This is not commonly used for other translations in the YaST / libyui-qt context, just for .ui files (created with Qt Designer).
|
virtual |
Reimplemented from QTranslator:
Use GNU gettext like everywhere in YaST if 'context' (usually the class name) starts with "QY2" or "YQ", fall back to Qt's built-in translation method otherwise.
Notice that this is also used for Qt's own messages that need to be translated, such as predefined dialogs (file dialog) and context menus (e.g. when right-clicking input fields, lists, scroll bars), so we cannot simply use GNU gettext everywhere.