Changeset 2327 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 24, 2007 12:43:41 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 20702
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r2319 r2327 1923 1923 } 1924 1924 1925 /* load the language file */1925 /* delete the old translator if there is one */ 1926 1926 if (sTranslator) 1927 1927 { 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. */ 1929 1931 delete sTranslator; 1930 1932 } 1933 1934 /* load new language files */ 1931 1935 sTranslator = new VBoxTranslator (qApp); 1932 1936 Assert (sTranslator); … … 1956 1960 1957 1961 /* Try to load the corresponding Qt translation */ 1958 QTranslator *qtTr = new QTranslator (sTranslator);1959 Assert (qtTr);1960 1962 if (sLoadedLangId != gVBoxBuiltInLangName) 1961 1963 { … … 1965 1967 languageFileName = QString (qInstallPathTranslations()) + "/qt_" + 1966 1968 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. */ 1969 1981 #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); 1977 1989 /* The below message doesn't fit 100% (because it's an additonal 1978 1990 * language and the main one won't be reset to built-in on failure)
Note:
See TracChangeset
for help on using the changeset viewer.