Changeset 2068 in vbox for trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
- Timestamp:
- Apr 13, 2007 10:01:20 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r2055 r2068 1868 1868 /** 1869 1869 * Loads the language by language ID. 1870 * @param aLang language ID in in form of xx_YY 1870 * 1871 * @param aLangId Language ID in in form of xx_YY. QString::null means the 1872 * system default language. 1871 1873 */ 1872 1874 /* static */ 1873 void VBoxGlobal::loadLanguage (const QString &aLang )1874 { 1875 QString langId = aLang .isNull() ?1876 VBoxGlobal::systemLanguageId() : aLang ;1877 QString languageFileName = QString::null;1875 void VBoxGlobal::loadLanguage (const QString &aLangId) 1876 { 1877 QString langId = aLangId.isNull() ? 1878 VBoxGlobal::systemLanguageId() : aLangId; 1879 QString languageFileName; 1878 1880 QString selectedLangId = gVBoxBuiltInLangName; 1879 1881 1880 if ( aLang!= gVBoxBuiltInLangName)1882 if (!aLangId.isNull() && aLangId != gVBoxBuiltInLangName) 1881 1883 { 1882 1884 QRegExp regExp (gVBoxLangIDRegExp); 1883 1885 int rule = regExp.search (langId); 1884 1886 /* this rule should match the language id completely */ 1885 Assert (!rule); 1886 if (rule == -1) return; 1887 1888 QString mId1part = regExp.cap (2); 1889 QString mId2part = regExp.cap (4); 1890 /* language localization (second part) should not be empty? */ 1891 // Assert (!mId2part.isEmpty()); 1887 AssertReturnVoid (rule == 0); 1888 1889 QString lang = regExp.cap (2); 1892 1890 1893 1891 QString nlsPath = qApp->applicationDirPath() + gVBoxLangSubDir; … … 1899 1897 selectedLangId = langId; 1900 1898 } 1901 else if (nlsDir.exists (gVBoxLangFileBase + mId1part+ gVBoxLangFileExt))1902 { 1903 languageFileName = nlsDir.absFilePath (gVBoxLangFileBase + mId1part+1899 else if (nlsDir.exists (gVBoxLangFileBase + lang + gVBoxLangFileExt)) 1900 { 1901 languageFileName = nlsDir.absFilePath (gVBoxLangFileBase + lang + 1904 1902 gVBoxLangFileExt); 1905 selectedLangId = mId1part;1906 } 1907 1908 if ( sTranslator &&languageFileName.isNull())1903 selectedLangId = lang; 1904 } 1905 1906 if (languageFileName.isNull()) 1909 1907 { 1910 1908 vboxProblem().cannotFindLanguage (langId, nlsPath); … … 1924 1922 if (sTranslator) 1925 1923 { 1926 /* an empty file name means built-in English*/1927 1924 if (selectedLangId != gVBoxBuiltInLangName) 1928 1925 {
Note:
See TracChangeset
for help on using the changeset viewer.