VirtualBox

Changeset 2327 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 24, 2007 12:43:41 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
20702
Message:

FE/Qt: Load the InnoTek supplied Qt translation anyway on Linux (after loading the system supplied translation if it's available) because the InnoTek version may contain important corrections.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp

    r2319 r2327  
    19231923    }
    19241924
    1925     /* load the language file */
     1925    /* delete the old translator if there is one */
    19261926    if (sTranslator)
    19271927    {
    1928         qApp->removeTranslator (sTranslator);
     1928        /* QTranslator destructor will call qApp->removeTranslator() for
     1929         * us. It will also delete all its child translations we attach to it
     1930         * below, so we don't have to care about them specially. */
    19291931        delete sTranslator;
    19301932    }
     1933
     1934    /* load new language files */
    19311935    sTranslator = new VBoxTranslator (qApp);
    19321936    Assert (sTranslator);
     
    19561960
    19571961    /* Try to load the corresponding Qt translation */
    1958     QTranslator *qtTr = new QTranslator (sTranslator);
    1959     Assert (qtTr);
    19601962    if (sLoadedLangId != gVBoxBuiltInLangName)
    19611963    {
     
    19651967        languageFileName = QString (qInstallPathTranslations()) + "/qt_" +
    19661968                           sLoadedLangId + gVBoxLangFileExt;
    1967         loadOk = qtTr->load (languageFileName);
    1968         if (!loadOk)
     1969        QTranslator *qtSysTr = new QTranslator (sTranslator);
     1970        Assert (qtSysTr);
     1971        if (qtSysTr && qtSysTr->load (languageFileName))
     1972            qApp->installTranslator (qtSysTr);
     1973        /* Note that the Qt translation supplied by InnoTek is always loaded
     1974         * afterwards to make sure it will take precedence over the system
     1975         * translation (it may contain more decent variants of translation
     1976         * that better correspond to VirtualBox UI). We need to load both
     1977         * because a newer version of Qt may be installed on the user computer
     1978         * and the InnoTek version may not fully support it. We don't do it on
     1979         * Win32 because we supply a Qt library there and therefore the
     1980         * InnoTek translation is always the best one. */
    19691981#endif
    1970         {
    1971             languageFileName =  nlsDir.absFilePath (QString ("qt_") +
    1972                                                     sLoadedLangId +
    1973                                                     gVBoxLangFileExt);
    1974             loadOk = qtTr->load (languageFileName);
    1975         }
    1976         qApp->installTranslator (qtTr);
     1982        languageFileName =  nlsDir.absFilePath (QString ("qt_") +
     1983                                                sLoadedLangId +
     1984                                                gVBoxLangFileExt);
     1985        QTranslator *qtTr = new QTranslator (sTranslator);
     1986        Assert (qtTr);
     1987        if (qtTr && (loadOk = qtTr->load (languageFileName)))
     1988            qApp->installTranslator (qtTr);
    19771989        /* The below message doesn't fit 100% (because it's an additonal
    19781990         * language and the main one won't be reset to built-in on failure)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette