Changeset 2178 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 18, 2007 1:50:16 PM (18 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 13 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile
r1733 r2178 51 51 VirtualBox_SDKS.win = WINPSDK DXSDK 52 52 VirtualBox_SDKS.linux = LIBSDL 53 54 # Each nls/VirtualBox_xx_YY.ts file must have a qt_xx_YY.ts counterpart 55 VirtualBox_QT_TRANSLATIONS_QT := \ 56 $(patsubst nls/VirtualBox_%.ts,nls/qt_%.ts,\ 57 $(filter nls/VirtualBox_%.ts,$(VirtualBox_QT_TRANSLATIONS))) 53 58 54 59 # QDesigner UI sources are imported from VBoxUI.pro as VirtualBox_QT_UISRC … … 247 252 248 253 VirtualBox.nls_INST = $(INST_BIN)nls/ 249 VirtualBox.nls_SOURCES = $(patsubst %.ts,$(PATH_VirtualBox)/nls/%.qm,$(notdir $(VirtualBox_QT_TRANSLATIONS))) 254 VirtualBox.nls_SOURCES = $(patsubst %.ts,$(PATH_VirtualBox)/nls/%.qm,$(notdir $(VirtualBox_QT_TRANSLATIONS))) 255 VirtualBox.nls_SOURCES += $(patsubst %.ts,$(PATH_VirtualBox)/nls/%.qm,$(notdir $(VirtualBox_QT_TRANSLATIONS_QT))) 250 256 VirtualBox.nls_MODE = 644 251 257 … … 378 384 # NLS files 379 385 $(foreach tsfile,$($(target)_QT_TRANSLATIONS),$(eval $(def_qt_gen_nls))) 386 $(foreach tsfile,$($(target)_QT_TRANSLATIONS_QT),$(eval $(def_qt_gen_nls))) 380 387 # dirs 381 388 $$(call DIRDEP,$(PATH_$(target))/ui/) \ -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r2170 r2178 1912 1912 QString selectedLangId = gVBoxBuiltInLangName; 1913 1913 1914 QString nlsPath = qApp->applicationDirPath() + gVBoxLangSubDir; 1915 QDir nlsDir (nlsPath); 1916 1914 1917 Assert (!langId.isEmpty()); 1915 1918 if (!langId.isEmpty() && langId != gVBoxBuiltInLangName) … … 1922 1925 QString lang = regExp.cap (2); 1923 1926 1924 QString nlsPath = qApp->applicationDirPath() + gVBoxLangSubDir;1925 QDir nlsDir (nlsPath);1926 1927 if (nlsDir.exists (gVBoxLangFileBase + langId + gVBoxLangFileExt)) 1927 1928 { … … 1978 1979 vboxProblem().cannotLoadLanguage (languageFileName); 1979 1980 sLoadedLangId = gVBoxBuiltInLangName; 1981 } 1982 1983 /* Try to load the corresponding Qt translation */ 1984 QTranslator *qtTr = new QTranslator (sTranslator); 1985 Assert (qtTr); 1986 if (sLoadedLangId != gVBoxBuiltInLangName) 1987 { 1988 #ifdef Q_OS_UNIX 1989 /* We use system installations of Qt on Linux systems, so first, try 1990 * to load the Qt translation from the system location. */ 1991 languageFileName = QString (qInstallPathTranslations()) + "/qt_" + 1992 sLoadedLangId + gVBoxLangFileExt; 1993 loadOk = qtTr->load (languageFileName); 1994 if (!loadOk) 1995 #endif 1996 { 1997 languageFileName = nlsDir.absFilePath (QString ("qt_") + 1998 sLoadedLangId + 1999 gVBoxLangFileExt); 2000 loadOk = qtTr->load (languageFileName); 2001 } 2002 qApp->installTranslator (qtTr); 2003 /* The below message doesn't fit 100% (because it's an additonal 2004 * language and the main one won't be reset to built-in on failure) 2005 * but the load failure is so rare here that it's not worth a separate 2006 * message (but still, having something is better than having none) */ 2007 if (!loadOk && !aLangId.isNull()) 2008 vboxProblem().cannotLoadLanguage (languageFileName); 1980 2009 } 1981 2010 }
Note:
See TracChangeset
for help on using the changeset viewer.