Using QTranslator to get original strings as well as translated strings



  • I'm using the following code to get a Russian translation of all my strings:
    @
    m_translator = new QTranslator(this);
    qApp->installTranslator(m_translator);
    m_translator->load(":/Traductions/Autostream2_rs.qm");
    @

    I've set up the .ts and .qm files properly, and I see all the strings in Russian. That part works fine. Occasionally, however, it'll be necessary to show the original English as well on the same form. Is there any way to go back and get the original text without deleting m_translator?



  • Hi,

    IMHO you can:

    • use QApplication::removeTranslator()
    • modify you code in order to use tr() in a conditioned way

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.