6#include <QtCore/qlibraryinfo.h>
22 resetTranslationFound();
24 return translationFound();
29 return info.translation.translate();
35 translationBindingInformation.line,
36 translationBindingInformation.column);
43 m_currentUILanguages = locale.uiLanguages().join(
QLatin1Char(
' '));
48 m_qtTranslator.reset();
54 m_qmlTranslator.reset();
80 if (
result.isNull() && m_qtTranslator)
81 result = m_qtTranslator->translate(
context, sourceText, disambiguation,
n);
82 if (
result.isNull() && m_qmlTranslator)
83 result = m_qmlTranslator->translate(
context, sourceText, disambiguation,
n);
88void ProxyTranslator::resetTranslationFound()
const
90 m_translationFound =
false;
93bool ProxyTranslator::translationFound()
const
95 return m_translationFound;
100 if (m_qtTranslator && m_qtTranslator->isEmpty())
102 if (m_qmlTranslator && m_qmlTranslator->isEmpty())
109 return m_currentUILanguages;
114#include "moc_proxytranslator.cpp"
bool isEmpty() const override
Returns true if this translator is empty, otherwise returns false.
static QString translationFromInformation(const TranslationBindingInformation &translationBindingInformation)
void removeEngine(QQmlEngine *engine)
static QQmlSourceLocation sourceLocationFromInformation(const TranslationBindingInformation &translationBindingInformation)
void languageChanged(const QLocale &locale)
bool hasTranslation(const TranslationBindingInformation &translationBindingInformation) const
QString translate(const char *context, const char *sourceText, const char *disambiguation, int n) const override
Returns the translation for the key (context, sourceText, disambiguation).
void addEngine(QQmlEngine *engine)
void setLanguage(const QUrl &context, const QLocale &locale)
QString currentUILanguages() const
static bool installTranslator(QTranslator *messageFile)
Adds the translation file translationFile to the list of translation files to be used for translation...
static bool removeTranslator(QTranslator *messageFile)
Removes the translation file translationFile from the list of translation files used by this applicat...
void setUiLanguage(const QString &language)
static QString path(LibraryPath p)
bool removeOne(const AT &t)
void append(parameter_type t)
The QQmlEngine class provides an environment for instantiating QML components.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
QLatin1StringView QLatin1String
QFileInfo info(fileName)
[8]
\inmodule QtCore \reentrant