Changeset 2068 in vbox
- Timestamp:
- Apr 13, 2007 10:01:20 AM (18 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_de.ts
r2048 r2068 1653 1653 </message> 1654 1654 <message> 1655 <source>1656 Lists all available user interface languages. The effective language1657 is written in <b>bold</b>.1658 </source>1659 <translation type="unfinished"></translation>1660 </message>1661 <message>1662 1655 <source>Author(s):</source> 1663 1656 <translation type="unfinished"></translation> … … 1680 1673 <source><unknown></source> 1681 1674 <comment>Author(s)</comment> 1675 <translation type="unfinished"></translation> 1676 </message> 1677 <message> 1678 <source> 1679 Lists all available user interface languages. The effective language is 1680 written in <b>bold</b>. Select <i>Default</i> to reset 1681 to the system default language. 1682 </source> 1683 <translation type="unfinished"></translation> 1684 </message> 1685 <message> 1686 <source>Default</source> 1687 <comment>Language</comment> 1682 1688 <translation type="unfinished"></translation> 1683 1689 </message> … … 3871 3877 <translation>Der Wert '%1' des Schlüssels '%2' stimmt nicht mit dem regulären Ausdruck '%3' überein.</translation> 3872 3878 </message> 3879 <message> 3880 <source>Cannot delete the key '%1'.</source> 3881 <translation type="unfinished"></translation> 3882 </message> 3873 3883 </context> 3874 3884 </TS> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_ru.ts
r2048 r2068 1641 1641 </message> 1642 1642 <message> 1643 <source>1644 Lists all available user interface languages. The effective language1645 is written in <b>bold</b>.1646 </source>1647 <translation type="unfinished"></translation>1648 </message>1649 <message>1650 1643 <source>Author(s):</source> 1651 1644 <translation type="unfinished"></translation> … … 1668 1661 <source><unknown></source> 1669 1662 <comment>Author(s)</comment> 1663 <translation type="unfinished"></translation> 1664 </message> 1665 <message> 1666 <source> 1667 Lists all available user interface languages. The effective language is 1668 written in <b>bold</b>. Select <i>Default</i> to reset 1669 to the system default language. 1670 </source> 1671 <translation type="unfinished"></translation> 1672 </message> 1673 <message> 1674 <source>Default</source> 1675 <comment>Language</comment> 1670 1676 <translation type="unfinished"></translation> 1671 1677 </message> … … 3777 3783 <translation type="unfinished"></translation> 3778 3784 </message> 3785 <message> 3786 <source>Cannot delete the key '%1'.</source> 3787 <translation type="unfinished"></translation> 3788 </message> 3779 3789 </context> 3780 3790 </TS> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_xx_YY.ts
r2048 r2068 1641 1641 </message> 1642 1642 <message> 1643 <source>1644 Lists all available user interface languages. The effective language1645 is written in <b>bold</b>.1646 </source>1647 <translation type="unfinished"></translation>1648 </message>1649 <message>1650 1643 <source>Author(s):</source> 1651 1644 <translation type="unfinished"></translation> … … 1668 1661 <source><unknown></source> 1669 1662 <comment>Author(s)</comment> 1663 <translation type="unfinished"></translation> 1664 </message> 1665 <message> 1666 <source> 1667 Lists all available user interface languages. The effective language is 1668 written in <b>bold</b>. Select <i>Default</i> to reset 1669 to the system default language. 1670 </source> 1671 <translation type="unfinished"></translation> 1672 </message> 1673 <message> 1674 <source>Default</source> 1675 <comment>Language</comment> 1670 1676 <translation type="unfinished"></translation> 1671 1677 </message> … … 3777 3783 <translation type="unfinished"></translation> 3778 3784 </message> 3785 <message> 3786 <source>Cannot delete the key '%1'.</source> 3787 <translation type="unfinished"></translation> 3788 </message> 3779 3789 </context> 3780 3790 </TS> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_zh_CN.ts
r2048 r2068 1649 1649 </message> 1650 1650 <message> 1651 <source>1652 Lists all available user interface languages. The effective language1653 is written in <b>bold</b>.1654 </source>1655 <translation type="unfinished"></translation>1656 </message>1657 <message>1658 1651 <source>Author(s):</source> 1659 1652 <translation type="unfinished"></translation> … … 1676 1669 <source><unknown></source> 1677 1670 <comment>Author(s)</comment> 1671 <translation type="unfinished"></translation> 1672 </message> 1673 <message> 1674 <source> 1675 Lists all available user interface languages. The effective language is 1676 written in <b>bold</b>. Select <i>Default</i> to reset 1677 to the system default language. 1678 </source> 1679 <translation type="unfinished"></translation> 1680 </message> 1681 <message> 1682 <source>Default</source> 1683 <comment>Language</comment> 1678 1684 <translation type="unfinished"></translation> 1679 1685 </message> … … 3813 3819 <translation>关键字 '%2' 的值 '%1' 不能通过正则表达式 '%3' 的强制性检查.</translation> 3814 3820 </message> 3821 <message> 3822 <source>Cannot delete the key '%1'.</source> 3823 <translation type="unfinished"></translation> 3824 </message> 3815 3825 </context> 3816 3826 </TS> -
trunk/src/VBox/Frontends/VirtualBox/nls/VirtualBox_zh_TW.ts
r2048 r2068 1954 1954 </message> 1955 1955 <message> 1956 <source>1957 Lists all available user interface languages. The effective language1958 is written in <b>bold</b>.1959 </source>1960 <translation type="unfinished"></translation>1961 </message>1962 <message>1963 1956 <source>Author(s):</source> 1964 1957 <translation type="unfinished"></translation> … … 1981 1974 <source><unknown></source> 1982 1975 <comment>Author(s)</comment> 1976 <translation type="unfinished"></translation> 1977 </message> 1978 <message> 1979 <source> 1980 Lists all available user interface languages. The effective language is 1981 written in <b>bold</b>. Select <i>Default</i> to reset 1982 to the system default language. 1983 </source> 1984 <translation type="unfinished"></translation> 1985 </message> 1986 <message> 1987 <source>Default</source> 1988 <comment>Language</comment> 1983 1989 <translation type="unfinished"></translation> 1984 1990 </message> … … 4484 4490 <translation type="unfinished"></translation> 4485 4491 </message> 4492 <message> 4493 <source>Cannot delete the key '%1'.</source> 4494 <translation type="unfinished"></translation> 4495 </message> 4486 4496 </context> 4487 4497 </TS> -
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 { -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxGlobalSettingsDlg.ui
r2044 r2068 813 813 <property name="whatsThis" stdset="0"> 814 814 <string> 815 Lists all available user interface languages. The effective language 816 is written in <b>bold</b>. 815 Lists all available user interface languages. The effective language is 816 written in <b>bold</b>. Select <i>Default</i> to reset 817 to the system default language. 817 818 </string> 818 819 </property> -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxGlobalSettingsDlg.ui.h
r2045 r2068 90 90 : QListViewItem (aParent), mBuiltIn (aBuiltIn), mInvalid (false) 91 91 { 92 Assert (!aId.isEmpty()); 93 92 94 QTranslatorMessage transMes; 93 95 … … 143 145 : QListViewItem (aParent), mBuiltIn (false), mInvalid (true) 144 146 { 147 Assert (!aId.isEmpty()); 148 145 149 setText (0, QString ("<%1>").arg (aId)); 146 150 setText (1, aId); … … 149 153 } 150 154 155 /* Constructs an item for the default language ID (column 1 will be set 156 * to QString::null) */ 157 LanguageItem (QListView *aParent) 158 : QListViewItem (aParent), mBuiltIn (false), mInvalid (false) 159 { 160 setText (0, VBoxGlobalSettingsDlg::tr ("Default", "Language")); 161 setText (1, QString::null); 162 setText (2, QString::null); 163 setText (3, QString::null); 164 } 165 151 166 int rtti() const { return TypeId; } 152 167 153 168 int compare (QListViewItem *aItem, int aColumn, bool aAscending) const 154 169 { 155 QString this Value= text (1);156 QString that Value= aItem->text (1);157 if (this Value == gVBoxBuiltInLangName)170 QString thisId = text (1); 171 QString thatId = aItem->text (1); 172 if (thisId.isNull()) 158 173 return -1; 159 else if (thatValue == gVBoxBuiltInLangName)174 if (thatId.isNull()) 160 175 return 1; 161 else 162 return QListViewItem::compare (aItem, aColumn, aAscending); 176 if (mBuiltIn) 177 return -1; 178 if (aItem->rtti() == TypeId && ((LanguageItem *) aItem)->mBuiltIn) 179 return 1; 180 return QListViewItem::compare (aItem, aColumn, aAscending); 163 181 } 164 182 … … 362 380 QDir::Files); 363 381 QTranslator translator; 382 /* add the default language */ 383 new LanguageItem (lvLanguages); 364 384 /* add the built-in language */ 365 385 new LanguageItem (lvLanguages, translator, gVBoxBuiltInLangName, true /* built-in */); … … 565 585 566 586 QString langId = gs.languageId(); 567 if (langId.isNull())568 langId = VBoxGlobal::languageId();569 587 QListViewItem *item = lvLanguages->findItem (langId, 1); 570 588 if (!item) … … 643 661 644 662 QListViewItem *selItem = lvLanguages->selectedItem(); 663 Assert (selItem); 645 664 if (mLanguageChanged && selItem) 646 665 { 647 gs.setLanguageId (selItem->text (1) == VBoxGlobal::systemLanguageId() ? 648 QString::null : selItem->text (1)); 666 gs.setLanguageId (selItem->text (1)); 649 667 VBoxGlobal::loadLanguage (selItem->text (1)); 650 668 } … … 914 932 void VBoxGlobalSettingsDlg::lvLanguages_currentChanged (QListViewItem *aItem) 915 933 { 934 Assert (aItem); 916 935 if (!aItem) return; 917 936 937 /* disable labels for the Default language item */ 938 bool enabled = !aItem->text (1).isNull(); 939 940 tlLangName->setEnabled (enabled); 941 tlAuthorName->setEnabled (enabled); 918 942 tlLangData->setText (aItem->text (2)); 919 943 tlAuthorData->setText (aItem->text (3)); 944 920 945 mLanguageChanged = true; 921 946 }
Note:
See TracChangeset
for help on using the changeset viewer.