Aside from QObject::tr() which works without a context string, I think
QT_TR_NOOP() is the only other one without a context.


https://doc.qt.io/qt-5/i18n-source-translation.html#using-qt-tr-noop-and-qt-translate-noop-in-c

Note that QObject::tr can be used outside the class. See
some_global_function example here:


https://doc.qt.io/qt-5/i18n-source-translation.html#using-qcoreapplication-translate

Also of interest might be "Translating Non-Qt Classes":


https://doc.qt.io/qt-5/i18n-source-translation.html#translating-non-qt-classes

---
Andy Maloney  //  https://asmaloney.com
twitter ~ @asmaloney <https://twitter.com/asmaloney>



On Fri, Nov 9, 2018 at 11:12 AM Vadim Peretokin <vpereto...@gmail.com>
wrote:

> I'd like to translate a string while ignoring the context of it, but
> QCoreApplication::translate("", sourceText.toUtf8().constData()) isn't
> cutting it. Any ideas on what would work?
>
> _______________________________________________
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to