libyui-qt
 
Loading...
Searching...
No Matches
QY2Translator Class Reference

#include <QY2Translator.h>

Inheritance diagram for QY2Translator:
Collaboration diagram for QY2Translator:

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
 

Detailed Description

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).

Member Function Documentation

◆ translate()

QString QY2Translator::translate ( const char * context,
const char * sourceText,
const char * disambiguation = 0,
int nPlural = -1 ) const
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.


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