diff --git a/src/goldendict.pro b/src/goldendict.pro index d177f04a..6dd824d3 100644 --- a/src/goldendict.pro +++ b/src/goldendict.pro @@ -116,7 +116,8 @@ HEADERS += folding.hh \ russiantranslit.hh \ german.hh \ website.hh \ - orderandprops.hh + orderandprops.hh \ + language.hh FORMS += groups.ui \ dictgroupwidget.ui \ mainwindow.ui \ @@ -184,7 +185,8 @@ SOURCES += folding.cc \ russiantranslit.cc \ german.cc \ website.cc \ - orderandprops.cc + orderandprops.cc \ + language.cc win32 { SOURCES += mouseover_win32/ThTypes.c HEADERS += mouseover_win32/ThTypes.h diff --git a/src/groups_widgets.cc b/src/groups_widgets.cc index 49ec78bd..bc9fdd58 100644 --- a/src/groups_widgets.cc +++ b/src/groups_widgets.cc @@ -6,6 +6,7 @@ #include "instances.hh" #include "config.hh" #include "langcoder.hh" +#include "language.hh" #include #include @@ -107,8 +108,8 @@ QVariant DictListModel::data( QModelIndex const & index, int role ) const { QString tt = "" + QString::fromUtf8( item->getName().c_str() ) + ""; - QString lfrom( LangCoder::decode( item->getLangFrom() ) ); - QString lto( LangCoder::decode( item->getLangTo() ) ); + QString lfrom( Language::localizedNameForId( item->getLangFrom() ) ); + QString lto( Language::localizedNameForId( item->getLangTo() ) ); if ( !lfrom.isEmpty() ) { if ( lfrom == lto ) diff --git a/src/hunspell.cc b/src/hunspell.cc index 1991060b..a8267b05 100644 --- a/src/hunspell.cc +++ b/src/hunspell.cc @@ -7,6 +7,8 @@ #include "iconv.hh" #include "folding.hh" #include "wstring_qt.hh" +#include "language.hh" +#include "langcoder.hh" #include #include #include @@ -636,219 +638,17 @@ vector< DataFiles > findDataFiles( QString const & path ) // Try making up good readable name from dictBaseId + QString localizedName; + + if ( dictBaseId.size() == 2 ) + localizedName = Language::localizedNameForId( LangCoder::code2toInt( dictBaseId.toAscii().data() ) ); + QString dictName = dictId; - bool readableNameSucceeded = true; - - #define TRY_LANG( code, translation ) if ( dictBaseId == ( code ) ) dictName = ( translation ); else - - // The following list was taken from the Wikipedia article - // "List of ISO 639-1 codes" - - TRY_LANG( "aa", QCoreApplication::translate( "Hunspell", "Afar" ) ) - TRY_LANG( "ab", QCoreApplication::translate( "Hunspell", "Abkhazian" ) ) - TRY_LANG( "ae", QCoreApplication::translate( "Hunspell", "Avestan" ) ) - TRY_LANG( "af", QCoreApplication::translate( "Hunspell", "Afrikaans" ) ) - TRY_LANG( "ak", QCoreApplication::translate( "Hunspell", "Akan" ) ) - TRY_LANG( "am", QCoreApplication::translate( "Hunspell", "Amharic" ) ) - TRY_LANG( "an", QCoreApplication::translate( "Hunspell", "Aragonese" ) ) - TRY_LANG( "ar", QCoreApplication::translate( "Hunspell", "Arabic" ) ) - TRY_LANG( "as", QCoreApplication::translate( "Hunspell", "Assamese" ) ) - TRY_LANG( "av", QCoreApplication::translate( "Hunspell", "Avaric" ) ) - TRY_LANG( "ay", QCoreApplication::translate( "Hunspell", "Aymara" ) ) - TRY_LANG( "az", QCoreApplication::translate( "Hunspell", "Azerbaijani" ) ) - TRY_LANG( "ba", QCoreApplication::translate( "Hunspell", "Bashkir" ) ) - TRY_LANG( "be", QCoreApplication::translate( "Hunspell", "Belarusian" ) ) - TRY_LANG( "bg", QCoreApplication::translate( "Hunspell", "Bulgarian" ) ) - TRY_LANG( "bh", QCoreApplication::translate( "Hunspell", "Bihari" ) ) - TRY_LANG( "bi", QCoreApplication::translate( "Hunspell", "Bislama" ) ) - TRY_LANG( "bm", QCoreApplication::translate( "Hunspell", "Bambara" ) ) - TRY_LANG( "bn", QCoreApplication::translate( "Hunspell", "Bengali" ) ) - TRY_LANG( "bo", QCoreApplication::translate( "Hunspell", "Tibetan" ) ) - TRY_LANG( "br", QCoreApplication::translate( "Hunspell", "Breton" ) ) - TRY_LANG( "bs", QCoreApplication::translate( "Hunspell", "Bosnian" ) ) - TRY_LANG( "ca", QCoreApplication::translate( "Hunspell", "Catalan" ) ) - TRY_LANG( "ce", QCoreApplication::translate( "Hunspell", "Chechen" ) ) - TRY_LANG( "ch", QCoreApplication::translate( "Hunspell", "Chamorro" ) ) - TRY_LANG( "co", QCoreApplication::translate( "Hunspell", "Corsican" ) ) - TRY_LANG( "cr", QCoreApplication::translate( "Hunspell", "Cree" ) ) - TRY_LANG( "cs", QCoreApplication::translate( "Hunspell", "Czech" ) ) - TRY_LANG( "cu", QCoreApplication::translate( "Hunspell", "Church Slavic" ) ) - TRY_LANG( "cv", QCoreApplication::translate( "Hunspell", "Chuvash" ) ) - TRY_LANG( "cy", QCoreApplication::translate( "Hunspell", "Welsh" ) ) - TRY_LANG( "da", QCoreApplication::translate( "Hunspell", "Danish" ) ) - TRY_LANG( "de", QCoreApplication::translate( "Hunspell", "German" ) ) - TRY_LANG( "dv", QCoreApplication::translate( "Hunspell", "Divehi" ) ) - TRY_LANG( "dz", QCoreApplication::translate( "Hunspell", "Dzongkha" ) ) - TRY_LANG( "ee", QCoreApplication::translate( "Hunspell", "Ewe" ) ) - TRY_LANG( "el", QCoreApplication::translate( "Hunspell", "Greek" ) ) - TRY_LANG( "en", QCoreApplication::translate( "Hunspell", "English" ) ) - TRY_LANG( "eo", QCoreApplication::translate( "Hunspell", "Esperanto" ) ) - TRY_LANG( "es", QCoreApplication::translate( "Hunspell", "Spanish" ) ) - TRY_LANG( "et", QCoreApplication::translate( "Hunspell", "Estonian" ) ) - TRY_LANG( "eu", QCoreApplication::translate( "Hunspell", "Basque" ) ) - TRY_LANG( "fa", QCoreApplication::translate( "Hunspell", "Persian" ) ) - TRY_LANG( "ff", QCoreApplication::translate( "Hunspell", "Fulah" ) ) - TRY_LANG( "fi", QCoreApplication::translate( "Hunspell", "Finnish" ) ) - TRY_LANG( "fj", QCoreApplication::translate( "Hunspell", "Fijian" ) ) - TRY_LANG( "fo", QCoreApplication::translate( "Hunspell", "Faroese" ) ) - TRY_LANG( "fr", QCoreApplication::translate( "Hunspell", "French" ) ) - TRY_LANG( "fy", QCoreApplication::translate( "Hunspell", "Western Frisian" ) ) - TRY_LANG( "ga", QCoreApplication::translate( "Hunspell", "Irish" ) ) - TRY_LANG( "gd", QCoreApplication::translate( "Hunspell", "Scottish Gaelic" ) ) - TRY_LANG( "gl", QCoreApplication::translate( "Hunspell", "Galician" ) ) - TRY_LANG( "gn", QCoreApplication::translate( "Hunspell", "Guarani" ) ) - TRY_LANG( "gu", QCoreApplication::translate( "Hunspell", "Gujarati" ) ) - TRY_LANG( "gv", QCoreApplication::translate( "Hunspell", "Manx" ) ) - TRY_LANG( "ha", QCoreApplication::translate( "Hunspell", "Hausa" ) ) - TRY_LANG( "he", QCoreApplication::translate( "Hunspell", "Hebrew" ) ) - TRY_LANG( "hi", QCoreApplication::translate( "Hunspell", "Hindi" ) ) - TRY_LANG( "ho", QCoreApplication::translate( "Hunspell", "Hiri Motu" ) ) - TRY_LANG( "hr", QCoreApplication::translate( "Hunspell", "Croatian" ) ) - TRY_LANG( "ht", QCoreApplication::translate( "Hunspell", "Haitian" ) ) - TRY_LANG( "hu", QCoreApplication::translate( "Hunspell", "Hungarian" ) ) - TRY_LANG( "hy", QCoreApplication::translate( "Hunspell", "Armenian" ) ) - TRY_LANG( "hz", QCoreApplication::translate( "Hunspell", "Herero" ) ) - TRY_LANG( "ia", QCoreApplication::translate( "Hunspell", "Interlingua" ) ) - TRY_LANG( "id", QCoreApplication::translate( "Hunspell", "Indonesian" ) ) - TRY_LANG( "ie", QCoreApplication::translate( "Hunspell", "Interlingue" ) ) - TRY_LANG( "ig", QCoreApplication::translate( "Hunspell", "Igbo" ) ) - TRY_LANG( "ii", QCoreApplication::translate( "Hunspell", "Sichuan Yi" ) ) - TRY_LANG( "ik", QCoreApplication::translate( "Hunspell", "Inupiaq" ) ) - TRY_LANG( "io", QCoreApplication::translate( "Hunspell", "Ido" ) ) - TRY_LANG( "is", QCoreApplication::translate( "Hunspell", "Icelandic" ) ) - TRY_LANG( "it", QCoreApplication::translate( "Hunspell", "Italian" ) ) - TRY_LANG( "iu", QCoreApplication::translate( "Hunspell", "Inuktitut" ) ) - TRY_LANG( "ja", QCoreApplication::translate( "Hunspell", "Japanese" ) ) - TRY_LANG( "jv", QCoreApplication::translate( "Hunspell", "Javanese" ) ) - TRY_LANG( "ka", QCoreApplication::translate( "Hunspell", "Georgian" ) ) - TRY_LANG( "kg", QCoreApplication::translate( "Hunspell", "Kongo" ) ) - TRY_LANG( "ki", QCoreApplication::translate( "Hunspell", "Kikuyu" ) ) - TRY_LANG( "kj", QCoreApplication::translate( "Hunspell", "Kwanyama" ) ) - TRY_LANG( "kk", QCoreApplication::translate( "Hunspell", "Kazakh" ) ) - TRY_LANG( "kl", QCoreApplication::translate( "Hunspell", "Kalaallisut" ) ) - TRY_LANG( "km", QCoreApplication::translate( "Hunspell", "Khmer" ) ) - TRY_LANG( "kn", QCoreApplication::translate( "Hunspell", "Kannada" ) ) - TRY_LANG( "ko", QCoreApplication::translate( "Hunspell", "Korean" ) ) - TRY_LANG( "kr", QCoreApplication::translate( "Hunspell", "Kanuri" ) ) - TRY_LANG( "ks", QCoreApplication::translate( "Hunspell", "Kashmiri" ) ) - TRY_LANG( "ku", QCoreApplication::translate( "Hunspell", "Kurdish" ) ) - TRY_LANG( "kv", QCoreApplication::translate( "Hunspell", "Komi" ) ) - TRY_LANG( "kw", QCoreApplication::translate( "Hunspell", "Cornish" ) ) - TRY_LANG( "ky", QCoreApplication::translate( "Hunspell", "Kirghiz" ) ) - TRY_LANG( "la", QCoreApplication::translate( "Hunspell", "Latin" ) ) - TRY_LANG( "lb", QCoreApplication::translate( "Hunspell", "Luxembourgish" ) ) - TRY_LANG( "lg", QCoreApplication::translate( "Hunspell", "Ganda" ) ) - TRY_LANG( "li", QCoreApplication::translate( "Hunspell", "Limburgish" ) ) - TRY_LANG( "ln", QCoreApplication::translate( "Hunspell", "Lingala" ) ) - TRY_LANG( "lo", QCoreApplication::translate( "Hunspell", "Lao" ) ) - TRY_LANG( "lt", QCoreApplication::translate( "Hunspell", "Lithuanian" ) ) - TRY_LANG( "lu", QCoreApplication::translate( "Hunspell", "Luba-Katanga" ) ) - TRY_LANG( "lv", QCoreApplication::translate( "Hunspell", "Latvian" ) ) - TRY_LANG( "mg", QCoreApplication::translate( "Hunspell", "Malagasy" ) ) - TRY_LANG( "mh", QCoreApplication::translate( "Hunspell", "Marshallese" ) ) - TRY_LANG( "mi", QCoreApplication::translate( "Hunspell", "Maori" ) ) - TRY_LANG( "mk", QCoreApplication::translate( "Hunspell", "Macedonian" ) ) - TRY_LANG( "ml", QCoreApplication::translate( "Hunspell", "Malayalam" ) ) - TRY_LANG( "mn", QCoreApplication::translate( "Hunspell", "Mongolian" ) ) - TRY_LANG( "mr", QCoreApplication::translate( "Hunspell", "Marathi" ) ) - TRY_LANG( "ms", QCoreApplication::translate( "Hunspell", "Malay" ) ) - TRY_LANG( "mt", QCoreApplication::translate( "Hunspell", "Maltese" ) ) - TRY_LANG( "my", QCoreApplication::translate( "Hunspell", "Burmese" ) ) - TRY_LANG( "na", QCoreApplication::translate( "Hunspell", "Nauru" ) ) - TRY_LANG( "nb", QCoreApplication::translate( "Hunspell", "Norwegian Bokmal" ) ) - TRY_LANG( "nd", QCoreApplication::translate( "Hunspell", "North Ndebele" ) ) - TRY_LANG( "ne", QCoreApplication::translate( "Hunspell", "Nepali" ) ) - TRY_LANG( "ng", QCoreApplication::translate( "Hunspell", "Ndonga" ) ) - TRY_LANG( "nl", QCoreApplication::translate( "Hunspell", "Dutch" ) ) - TRY_LANG( "nn", QCoreApplication::translate( "Hunspell", "Norwegian Nynorsk" ) ) - TRY_LANG( "no", QCoreApplication::translate( "Hunspell", "Norwegian" ) ) - TRY_LANG( "nr", QCoreApplication::translate( "Hunspell", "South Ndebele" ) ) - TRY_LANG( "nv", QCoreApplication::translate( "Hunspell", "Navajo" ) ) - TRY_LANG( "ny", QCoreApplication::translate( "Hunspell", "Chichewa" ) ) - - // This looks really like a fake, and it is a fake - because - // the one very "intelligent" MSVC compiler does not understand if...else - // with more than 128 cases :( - -#ifdef _MSC_VER - readableNameSucceeded = false; - - if (readableNameSucceeded == false) - { -#endif - - TRY_LANG( "oc", QCoreApplication::translate( "Hunspell", "Occitan" ) ) - TRY_LANG( "oj", QCoreApplication::translate( "Hunspell", "Ojibwa" ) ) - TRY_LANG( "om", QCoreApplication::translate( "Hunspell", "Oromo" ) ) - TRY_LANG( "or", QCoreApplication::translate( "Hunspell", "Oriya" ) ) - TRY_LANG( "os", QCoreApplication::translate( "Hunspell", "Ossetian" ) ) - TRY_LANG( "pa", QCoreApplication::translate( "Hunspell", "Panjabi" ) ) - TRY_LANG( "pi", QCoreApplication::translate( "Hunspell", "Pali" ) ) - TRY_LANG( "pl", QCoreApplication::translate( "Hunspell", "Polish" ) ) - TRY_LANG( "ps", QCoreApplication::translate( "Hunspell", "Pashto" ) ) - TRY_LANG( "pt", QCoreApplication::translate( "Hunspell", "Portuguese" ) ) - TRY_LANG( "qu", QCoreApplication::translate( "Hunspell", "Quechua" ) ) - TRY_LANG( "rm", QCoreApplication::translate( "Hunspell", "Raeto-Romance" ) ) - TRY_LANG( "rn", QCoreApplication::translate( "Hunspell", "Kirundi" ) ) - TRY_LANG( "ro", QCoreApplication::translate( "Hunspell", "Romanian" ) ) - TRY_LANG( "ru", QCoreApplication::translate( "Hunspell", "Russian" ) ) - TRY_LANG( "rw", QCoreApplication::translate( "Hunspell", "Kinyarwanda" ) ) - TRY_LANG( "sa", QCoreApplication::translate( "Hunspell", "Sanskrit" ) ) - TRY_LANG( "sc", QCoreApplication::translate( "Hunspell", "Sardinian" ) ) - TRY_LANG( "sd", QCoreApplication::translate( "Hunspell", "Sindhi" ) ) - TRY_LANG( "se", QCoreApplication::translate( "Hunspell", "Northern Sami" ) ) - TRY_LANG( "sg", QCoreApplication::translate( "Hunspell", "Sango" ) ) - TRY_LANG( "sh", QCoreApplication::translate( "Hunspell", "Serbo-Croatian" ) ) - TRY_LANG( "si", QCoreApplication::translate( "Hunspell", "Sinhala" ) ) - TRY_LANG( "sk", QCoreApplication::translate( "Hunspell", "Slovak" ) ) - TRY_LANG( "sl", QCoreApplication::translate( "Hunspell", "Slovenian" ) ) - TRY_LANG( "sm", QCoreApplication::translate( "Hunspell", "Samoan" ) ) - TRY_LANG( "sn", QCoreApplication::translate( "Hunspell", "Shona" ) ) - TRY_LANG( "so", QCoreApplication::translate( "Hunspell", "Somali" ) ) - TRY_LANG( "sq", QCoreApplication::translate( "Hunspell", "Albanian" ) ) - TRY_LANG( "sr", QCoreApplication::translate( "Hunspell", "Serbian" ) ) - TRY_LANG( "ss", QCoreApplication::translate( "Hunspell", "Swati" ) ) - TRY_LANG( "st", QCoreApplication::translate( "Hunspell", "Southern Sotho" ) ) - TRY_LANG( "su", QCoreApplication::translate( "Hunspell", "Sundanese" ) ) - TRY_LANG( "sv", QCoreApplication::translate( "Hunspell", "Swedish" ) ) - TRY_LANG( "sw", QCoreApplication::translate( "Hunspell", "Swahili" ) ) - TRY_LANG( "ta", QCoreApplication::translate( "Hunspell", "Tamil" ) ) - TRY_LANG( "te", QCoreApplication::translate( "Hunspell", "Telugu" ) ) - TRY_LANG( "tg", QCoreApplication::translate( "Hunspell", "Tajik" ) ) - TRY_LANG( "th", QCoreApplication::translate( "Hunspell", "Thai" ) ) - TRY_LANG( "ti", QCoreApplication::translate( "Hunspell", "Tigrinya" ) ) - TRY_LANG( "tk", QCoreApplication::translate( "Hunspell", "Turkmen" ) ) - TRY_LANG( "tl", QCoreApplication::translate( "Hunspell", "Tagalog" ) ) - TRY_LANG( "tn", QCoreApplication::translate( "Hunspell", "Tswana" ) ) - TRY_LANG( "to", QCoreApplication::translate( "Hunspell", "Tonga" ) ) - TRY_LANG( "tr", QCoreApplication::translate( "Hunspell", "Turkish" ) ) - TRY_LANG( "ts", QCoreApplication::translate( "Hunspell", "Tsonga" ) ) - TRY_LANG( "tt", QCoreApplication::translate( "Hunspell", "Tatar" ) ) - TRY_LANG( "tw", QCoreApplication::translate( "Hunspell", "Twi" ) ) - TRY_LANG( "ty", QCoreApplication::translate( "Hunspell", "Tahitian" ) ) - TRY_LANG( "ug", QCoreApplication::translate( "Hunspell", "Uighur" ) ) - TRY_LANG( "uk", QCoreApplication::translate( "Hunspell", "Ukrainian" ) ) - TRY_LANG( "ur", QCoreApplication::translate( "Hunspell", "Urdu" ) ) - TRY_LANG( "uz", QCoreApplication::translate( "Hunspell", "Uzbek" ) ) - TRY_LANG( "ve", QCoreApplication::translate( "Hunspell", "Venda" ) ) - TRY_LANG( "vi", QCoreApplication::translate( "Hunspell", "Vietnamese" ) ) - TRY_LANG( "vo", QCoreApplication::translate( "Hunspell", "Volapuk" ) ) - TRY_LANG( "wa", QCoreApplication::translate( "Hunspell", "Walloon" ) ) - TRY_LANG( "wo", QCoreApplication::translate( "Hunspell", "Wolof" ) ) - TRY_LANG( "xh", QCoreApplication::translate( "Hunspell", "Xhosa" ) ) - TRY_LANG( "yi", QCoreApplication::translate( "Hunspell", "Yiddish" ) ) - TRY_LANG( "yo", QCoreApplication::translate( "Hunspell", "Yoruba" ) ) - TRY_LANG( "za", QCoreApplication::translate( "Hunspell", "Zhuang" ) ) - TRY_LANG( "zh", QCoreApplication::translate( "Hunspell", "Chinese" ) ) - TRY_LANG( "zu", QCoreApplication::translate( "Hunspell", "Zulu" ) ) - readableNameSucceeded = false; // This ends the last else, so it's conditional -#ifdef _MSC_VER - } -#endif - - if ( readableNameSucceeded ) + if ( localizedName.size() ) { + dictName = localizedName; + if ( dictId.size() > 2 && ( dictId[ 2 ] == '-' || dictId[ 2 ] == '_' ) && dictId.mid( 3 ).toLower() != dictBaseId ) dictName += " (" + dictId.mid( 3 ) + ")"; diff --git a/src/language.cc b/src/language.cc new file mode 100644 index 00000000..3c61dcf3 --- /dev/null +++ b/src/language.cc @@ -0,0 +1,258 @@ +#include "language.hh" +#include "langcoder.hh" +#include +#include + +namespace Language { + +namespace { + +using std::map; + +struct Db +{ + static Db const & instance(); + + map< QString, QString > const & getIso2ToEnglish() const + { return iso2ToEnglish; } + map< QString, QString > const & getIso2ToLocalized() const + { return iso2ToLocalized; } + +private: + + map< QString, QString > iso2ToEnglish, iso2ToLocalized; + + Db(); + + void addEntry( QString const & iso2, QString const & english, + QString const & localized ); +}; + +Db const & Db::instance() +{ + static Db v; + + return v; +} + +void Db::addEntry( QString const & iso2, QString const & english, + QString const & localized ) +{ + iso2ToEnglish[ iso2 ] = english; + iso2ToLocalized[ iso2 ] = localized; +} + +Db::Db() +{ + addEntry( "aa", "Afar", QCoreApplication::translate( "Language", "Afar" ) ); + addEntry( "ab", "Abkhazian", QCoreApplication::translate( "Language", "Abkhazian" ) ); + addEntry( "ae", "Avestan", QCoreApplication::translate( "Language", "Avestan" ) ); + addEntry( "af", "Afrikaans", QCoreApplication::translate( "Language", "Afrikaans" ) ); + addEntry( "ak", "Akan", QCoreApplication::translate( "Language", "Akan" ) ); + addEntry( "am", "Amharic", QCoreApplication::translate( "Language", "Amharic" ) ); + addEntry( "an", "Aragonese", QCoreApplication::translate( "Language", "Aragonese" ) ); + addEntry( "ar", "Arabic", QCoreApplication::translate( "Language", "Arabic" ) ); + addEntry( "as", "Assamese", QCoreApplication::translate( "Language", "Assamese" ) ); + addEntry( "av", "Avaric", QCoreApplication::translate( "Language", "Avaric" ) ); + addEntry( "ay", "Aymara", QCoreApplication::translate( "Language", "Aymara" ) ); + addEntry( "az", "Azerbaijani", QCoreApplication::translate( "Language", "Azerbaijani" ) ); + addEntry( "ba", "Bashkir", QCoreApplication::translate( "Language", "Bashkir" ) ); + addEntry( "be", "Belarusian", QCoreApplication::translate( "Language", "Belarusian" ) ); + addEntry( "bg", "Bulgarian", QCoreApplication::translate( "Language", "Bulgarian" ) ); + addEntry( "bh", "Bihari", QCoreApplication::translate( "Language", "Bihari" ) ); + addEntry( "bi", "Bislama", QCoreApplication::translate( "Language", "Bislama" ) ); + addEntry( "bm", "Bambara", QCoreApplication::translate( "Language", "Bambara" ) ); + addEntry( "bn", "Bengali", QCoreApplication::translate( "Language", "Bengali" ) ); + addEntry( "bo", "Tibetan", QCoreApplication::translate( "Language", "Tibetan" ) ); + addEntry( "br", "Breton", QCoreApplication::translate( "Language", "Breton" ) ); + addEntry( "bs", "Bosnian", QCoreApplication::translate( "Language", "Bosnian" ) ); + addEntry( "ca", "Catalan", QCoreApplication::translate( "Language", "Catalan" ) ); + addEntry( "ce", "Chechen", QCoreApplication::translate( "Language", "Chechen" ) ); + addEntry( "ch", "Chamorro", QCoreApplication::translate( "Language", "Chamorro" ) ); + addEntry( "co", "Corsican", QCoreApplication::translate( "Language", "Corsican" ) ); + addEntry( "cr", "Cree", QCoreApplication::translate( "Language", "Cree" ) ); + addEntry( "cs", "Czech", QCoreApplication::translate( "Language", "Czech" ) ); + addEntry( "cu", "Church Slavic", QCoreApplication::translate( "Language", "Church Slavic" ) ); + addEntry( "cv", "Chuvash", QCoreApplication::translate( "Language", "Chuvash" ) ); + addEntry( "cy", "Welsh", QCoreApplication::translate( "Language", "Welsh" ) ); + addEntry( "da", "Danish", QCoreApplication::translate( "Language", "Danish" ) ); + addEntry( "de", "German", QCoreApplication::translate( "Language", "German" ) ); + addEntry( "dv", "Divehi", QCoreApplication::translate( "Language", "Divehi" ) ); + addEntry( "dz", "Dzongkha", QCoreApplication::translate( "Language", "Dzongkha" ) ); + addEntry( "ee", "Ewe", QCoreApplication::translate( "Language", "Ewe" ) ); + addEntry( "el", "Greek", QCoreApplication::translate( "Language", "Greek" ) ); + addEntry( "en", "English", QCoreApplication::translate( "Language", "English" ) ); + addEntry( "eo", "Esperanto", QCoreApplication::translate( "Language", "Esperanto" ) ); + addEntry( "es", "Spanish", QCoreApplication::translate( "Language", "Spanish" ) ); + addEntry( "et", "Estonian", QCoreApplication::translate( "Language", "Estonian" ) ); + addEntry( "eu", "Basque", QCoreApplication::translate( "Language", "Basque" ) ); + addEntry( "fa", "Persian", QCoreApplication::translate( "Language", "Persian" ) ); + addEntry( "ff", "Fulah", QCoreApplication::translate( "Language", "Fulah" ) ); + addEntry( "fi", "Finnish", QCoreApplication::translate( "Language", "Finnish" ) ); + addEntry( "fj", "Fijian", QCoreApplication::translate( "Language", "Fijian" ) ); + addEntry( "fo", "Faroese", QCoreApplication::translate( "Language", "Faroese" ) ); + addEntry( "fr", "French", QCoreApplication::translate( "Language", "French" ) ); + addEntry( "fy", "Western Frisian", QCoreApplication::translate( "Language", "Western Frisian" ) ); + addEntry( "ga", "Irish", QCoreApplication::translate( "Language", "Irish" ) ); + addEntry( "gd", "Scottish Gaelic", QCoreApplication::translate( "Language", "Scottish Gaelic" ) ); + addEntry( "gl", "Galician", QCoreApplication::translate( "Language", "Galician" ) ); + addEntry( "gn", "Guarani", QCoreApplication::translate( "Language", "Guarani" ) ); + addEntry( "gu", "Gujarati", QCoreApplication::translate( "Language", "Gujarati" ) ); + addEntry( "gv", "Manx", QCoreApplication::translate( "Language", "Manx" ) ); + addEntry( "ha", "Hausa", QCoreApplication::translate( "Language", "Hausa" ) ); + addEntry( "he", "Hebrew", QCoreApplication::translate( "Language", "Hebrew" ) ); + addEntry( "hi", "Hindi", QCoreApplication::translate( "Language", "Hindi" ) ); + addEntry( "ho", "Hiri Motu", QCoreApplication::translate( "Language", "Hiri Motu" ) ); + addEntry( "hr", "Croatian", QCoreApplication::translate( "Language", "Croatian" ) ); + addEntry( "ht", "Haitian", QCoreApplication::translate( "Language", "Haitian" ) ); + addEntry( "hu", "Hungarian", QCoreApplication::translate( "Language", "Hungarian" ) ); + addEntry( "hy", "Armenian", QCoreApplication::translate( "Language", "Armenian" ) ); + addEntry( "hz", "Herero", QCoreApplication::translate( "Language", "Herero" ) ); + addEntry( "ia", "Interlingua", QCoreApplication::translate( "Language", "Interlingua" ) ); + addEntry( "id", "Indonesian", QCoreApplication::translate( "Language", "Indonesian" ) ); + addEntry( "ie", "Interlingue", QCoreApplication::translate( "Language", "Interlingue" ) ); + addEntry( "ig", "Igbo", QCoreApplication::translate( "Language", "Igbo" ) ); + addEntry( "ii", "Sichuan Yi", QCoreApplication::translate( "Language", "Sichuan Yi" ) ); + addEntry( "ik", "Inupiaq", QCoreApplication::translate( "Language", "Inupiaq" ) ); + addEntry( "io", "Ido", QCoreApplication::translate( "Language", "Ido" ) ); + addEntry( "is", "Icelandic", QCoreApplication::translate( "Language", "Icelandic" ) ); + addEntry( "it", "Italian", QCoreApplication::translate( "Language", "Italian" ) ); + addEntry( "iu", "Inuktitut", QCoreApplication::translate( "Language", "Inuktitut" ) ); + addEntry( "ja", "Japanese", QCoreApplication::translate( "Language", "Japanese" ) ); + addEntry( "jv", "Javanese", QCoreApplication::translate( "Language", "Javanese" ) ); + addEntry( "ka", "Georgian", QCoreApplication::translate( "Language", "Georgian" ) ); + addEntry( "kg", "Kongo", QCoreApplication::translate( "Language", "Kongo" ) ); + addEntry( "ki", "Kikuyu", QCoreApplication::translate( "Language", "Kikuyu" ) ); + addEntry( "kj", "Kwanyama", QCoreApplication::translate( "Language", "Kwanyama" ) ); + addEntry( "kk", "Kazakh", QCoreApplication::translate( "Language", "Kazakh" ) ); + addEntry( "kl", "Kalaallisut", QCoreApplication::translate( "Language", "Kalaallisut" ) ); + addEntry( "km", "Khmer", QCoreApplication::translate( "Language", "Khmer" ) ); + addEntry( "kn", "Kannada", QCoreApplication::translate( "Language", "Kannada" ) ); + addEntry( "ko", "Korean", QCoreApplication::translate( "Language", "Korean" ) ); + addEntry( "kr", "Kanuri", QCoreApplication::translate( "Language", "Kanuri" ) ); + addEntry( "ks", "Kashmiri", QCoreApplication::translate( "Language", "Kashmiri" ) ); + addEntry( "ku", "Kurdish", QCoreApplication::translate( "Language", "Kurdish" ) ); + addEntry( "kv", "Komi", QCoreApplication::translate( "Language", "Komi" ) ); + addEntry( "kw", "Cornish", QCoreApplication::translate( "Language", "Cornish" ) ); + addEntry( "ky", "Kirghiz", QCoreApplication::translate( "Language", "Kirghiz" ) ); + addEntry( "la", "Latin", QCoreApplication::translate( "Language", "Latin" ) ); + addEntry( "lb", "Luxembourgish", QCoreApplication::translate( "Language", "Luxembourgish" ) ); + addEntry( "lg", "Ganda", QCoreApplication::translate( "Language", "Ganda" ) ); + addEntry( "li", "Limburgish", QCoreApplication::translate( "Language", "Limburgish" ) ); + addEntry( "ln", "Lingala", QCoreApplication::translate( "Language", "Lingala" ) ); + addEntry( "lo", "Lao", QCoreApplication::translate( "Language", "Lao" ) ); + addEntry( "lt", "Lithuanian", QCoreApplication::translate( "Language", "Lithuanian" ) ); + addEntry( "lu", "Luba-Katanga", QCoreApplication::translate( "Language", "Luba-Katanga" ) ); + addEntry( "lv", "Latvian", QCoreApplication::translate( "Language", "Latvian" ) ); + addEntry( "mg", "Malagasy", QCoreApplication::translate( "Language", "Malagasy" ) ); + addEntry( "mh", "Marshallese", QCoreApplication::translate( "Language", "Marshallese" ) ); + addEntry( "mi", "Maori", QCoreApplication::translate( "Language", "Maori" ) ); + addEntry( "mk", "Macedonian", QCoreApplication::translate( "Language", "Macedonian" ) ); + addEntry( "ml", "Malayalam", QCoreApplication::translate( "Language", "Malayalam" ) ); + addEntry( "mn", "Mongolian", QCoreApplication::translate( "Language", "Mongolian" ) ); + addEntry( "mr", "Marathi", QCoreApplication::translate( "Language", "Marathi" ) ); + addEntry( "ms", "Malay", QCoreApplication::translate( "Language", "Malay" ) ); + addEntry( "mt", "Maltese", QCoreApplication::translate( "Language", "Maltese" ) ); + addEntry( "my", "Burmese", QCoreApplication::translate( "Language", "Burmese" ) ); + addEntry( "na", "Nauru", QCoreApplication::translate( "Language", "Nauru" ) ); + addEntry( "nb", "Norwegian Bokmal", QCoreApplication::translate( "Language", "Norwegian Bokmal" ) ); + addEntry( "nd", "North Ndebele", QCoreApplication::translate( "Language", "North Ndebele" ) ); + addEntry( "ne", "Nepali", QCoreApplication::translate( "Language", "Nepali" ) ); + addEntry( "ng", "Ndonga", QCoreApplication::translate( "Language", "Ndonga" ) ); + addEntry( "nl", "Dutch", QCoreApplication::translate( "Language", "Dutch" ) ); + addEntry( "nn", "Norwegian Nynorsk", QCoreApplication::translate( "Language", "Norwegian Nynorsk" ) ); + addEntry( "no", "Norwegian", QCoreApplication::translate( "Language", "Norwegian" ) ); + addEntry( "nr", "South Ndebele", QCoreApplication::translate( "Language", "South Ndebele" ) ); + addEntry( "nv", "Navajo", QCoreApplication::translate( "Language", "Navajo" ) ); + addEntry( "ny", "Chichewa", QCoreApplication::translate( "Language", "Chichewa" ) ); + addEntry( "oc", "Occitan", QCoreApplication::translate( "Language", "Occitan" ) ); + addEntry( "oj", "Ojibwa", QCoreApplication::translate( "Language", "Ojibwa" ) ); + addEntry( "om", "Oromo", QCoreApplication::translate( "Language", "Oromo" ) ); + addEntry( "or", "Oriya", QCoreApplication::translate( "Language", "Oriya" ) ); + addEntry( "os", "Ossetian", QCoreApplication::translate( "Language", "Ossetian" ) ); + addEntry( "pa", "Panjabi", QCoreApplication::translate( "Language", "Panjabi" ) ); + addEntry( "pi", "Pali", QCoreApplication::translate( "Language", "Pali" ) ); + addEntry( "pl", "Polish", QCoreApplication::translate( "Language", "Polish" ) ); + addEntry( "ps", "Pashto", QCoreApplication::translate( "Language", "Pashto" ) ); + addEntry( "pt", "Portuguese", QCoreApplication::translate( "Language", "Portuguese" ) ); + addEntry( "qu", "Quechua", QCoreApplication::translate( "Language", "Quechua" ) ); + addEntry( "rm", "Raeto-Romance", QCoreApplication::translate( "Language", "Raeto-Romance" ) ); + addEntry( "rn", "Kirundi", QCoreApplication::translate( "Language", "Kirundi" ) ); + addEntry( "ro", "Romanian", QCoreApplication::translate( "Language", "Romanian" ) ); + addEntry( "ru", "Russian", QCoreApplication::translate( "Language", "Russian" ) ); + addEntry( "rw", "Kinyarwanda", QCoreApplication::translate( "Language", "Kinyarwanda" ) ); + addEntry( "sa", "Sanskrit", QCoreApplication::translate( "Language", "Sanskrit" ) ); + addEntry( "sc", "Sardinian", QCoreApplication::translate( "Language", "Sardinian" ) ); + addEntry( "sd", "Sindhi", QCoreApplication::translate( "Language", "Sindhi" ) ); + addEntry( "se", "Northern Sami", QCoreApplication::translate( "Language", "Northern Sami" ) ); + addEntry( "sg", "Sango", QCoreApplication::translate( "Language", "Sango" ) ); + addEntry( "sh", "Serbo-Croatian", QCoreApplication::translate( "Language", "Serbo-Croatian" ) ); + addEntry( "si", "Sinhala", QCoreApplication::translate( "Language", "Sinhala" ) ); + addEntry( "sk", "Slovak", QCoreApplication::translate( "Language", "Slovak" ) ); + addEntry( "sl", "Slovenian", QCoreApplication::translate( "Language", "Slovenian" ) ); + addEntry( "sm", "Samoan", QCoreApplication::translate( "Language", "Samoan" ) ); + addEntry( "sn", "Shona", QCoreApplication::translate( "Language", "Shona" ) ); + addEntry( "so", "Somali", QCoreApplication::translate( "Language", "Somali" ) ); + addEntry( "sq", "Albanian", QCoreApplication::translate( "Language", "Albanian" ) ); + addEntry( "sr", "Serbian", QCoreApplication::translate( "Language", "Serbian" ) ); + addEntry( "ss", "Swati", QCoreApplication::translate( "Language", "Swati" ) ); + addEntry( "st", "Southern Sotho", QCoreApplication::translate( "Language", "Southern Sotho" ) ); + addEntry( "su", "Sundanese", QCoreApplication::translate( "Language", "Sundanese" ) ); + addEntry( "sv", "Swedish", QCoreApplication::translate( "Language", "Swedish" ) ); + addEntry( "sw", "Swahili", QCoreApplication::translate( "Language", "Swahili" ) ); + addEntry( "ta", "Tamil", QCoreApplication::translate( "Language", "Tamil" ) ); + addEntry( "te", "Telugu", QCoreApplication::translate( "Language", "Telugu" ) ); + addEntry( "tg", "Tajik", QCoreApplication::translate( "Language", "Tajik" ) ); + addEntry( "th", "Thai", QCoreApplication::translate( "Language", "Thai" ) ); + addEntry( "ti", "Tigrinya", QCoreApplication::translate( "Language", "Tigrinya" ) ); + addEntry( "tk", "Turkmen", QCoreApplication::translate( "Language", "Turkmen" ) ); + addEntry( "tl", "Tagalog", QCoreApplication::translate( "Language", "Tagalog" ) ); + addEntry( "tn", "Tswana", QCoreApplication::translate( "Language", "Tswana" ) ); + addEntry( "to", "Tonga", QCoreApplication::translate( "Language", "Tonga" ) ); + addEntry( "tr", "Turkish", QCoreApplication::translate( "Language", "Turkish" ) ); + addEntry( "ts", "Tsonga", QCoreApplication::translate( "Language", "Tsonga" ) ); + addEntry( "tt", "Tatar", QCoreApplication::translate( "Language", "Tatar" ) ); + addEntry( "tw", "Twi", QCoreApplication::translate( "Language", "Twi" ) ); + addEntry( "ty", "Tahitian", QCoreApplication::translate( "Language", "Tahitian" ) ); + addEntry( "ug", "Uighur", QCoreApplication::translate( "Language", "Uighur" ) ); + addEntry( "uk", "Ukrainian", QCoreApplication::translate( "Language", "Ukrainian" ) ); + addEntry( "ur", "Urdu", QCoreApplication::translate( "Language", "Urdu" ) ); + addEntry( "uz", "Uzbek", QCoreApplication::translate( "Language", "Uzbek" ) ); + addEntry( "ve", "Venda", QCoreApplication::translate( "Language", "Venda" ) ); + addEntry( "vi", "Vietnamese", QCoreApplication::translate( "Language", "Vietnamese" ) ); + addEntry( "vo", "Volapuk", QCoreApplication::translate( "Language", "Volapuk" ) ); + addEntry( "wa", "Walloon", QCoreApplication::translate( "Language", "Walloon" ) ); + addEntry( "wo", "Wolof", QCoreApplication::translate( "Language", "Wolof" ) ); + addEntry( "xh", "Xhosa", QCoreApplication::translate( "Language", "Xhosa" ) ); + addEntry( "yi", "Yiddish", QCoreApplication::translate( "Language", "Yiddish" ) ); + addEntry( "yo", "Yoruba", QCoreApplication::translate( "Language", "Yoruba" ) ); + addEntry( "za", "Zhuang", QCoreApplication::translate( "Language", "Zhuang" ) ); + addEntry( "zh", "Chinese", QCoreApplication::translate( "Language", "Chinese" ) ); + addEntry( "zu", "Zulu", QCoreApplication::translate( "Language", "Zulu" ) ); +} + +} + +QString englishNameForId( Id id ) +{ + map< QString, QString >::const_iterator i = + Db::instance().getIso2ToEnglish().find( LangCoder::intToCode2( id ) ); + + if ( i == Db::instance().getIso2ToEnglish().end() ) + return QString(); + + return i->second; +} + +QString localizedNameForId( Id id ) +{ + map< QString, QString >::const_iterator i = + Db::instance().getIso2ToLocalized().find( LangCoder::intToCode2( id ) ); + + if ( i == Db::instance().getIso2ToLocalized().end() ) + return QString(); + + return i->second; +} + +} diff --git a/src/language.hh b/src/language.hh new file mode 100644 index 00000000..49cee644 --- /dev/null +++ b/src/language.hh @@ -0,0 +1,37 @@ +/* This file is (c) 2008-2009 Konstantin Isakov + * Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */ + +#ifndef __LANGUAGE_HH_INCLUDED__ +#define __LANGUAGE_HH_INCLUDED__ + +#include + +/// Language-specific stuff - codes, names, ids etc. +namespace Language { + +/// This identifies any language uniquely within the program. It also has +/// two special meanings - Unknown and Any. +typedef quint32 Id; + +enum +{ + /// Value for Id which signifies that the language is unknown or unspecified. + Unknown = 0, + /// Value for Id which signifies that the language can be any, or all of them. + Any = 0xFFffFFff +}; + +/// Returns name in English for the given Id. If the Id is incorrect, or has +/// Unknown/Any values, returns empty string. +QString englishNameForId( Id ); + +/// Returns name for the given Id, translated to the current UI language. +/// If the Id is incorrect, or has Unknown/Any values, returns empty string. +QString localizedNameForId( Id ); + +// All other functions are to be used from LangCoder, which is supposed to +// be migrated here over time. + +} + +#endif diff --git a/src/locale/ru.ts b/src/locale/ru.ts index 8bc0846c..0075c6c3 100644 --- a/src/locale/ru.ts +++ b/src/locale/ru.ts @@ -1,12 +1,11 @@ - - - + + XML parse error: %1 at %2,%3 Ошибка обработки XML: %1 на строке %2, столбце %3 @@ -46,55 +45,64 @@ ArticleMaker - + No translation for <b>%1</b> was found in group <b>%2</b>. Не найдено перевода для <b>%1</b> в группе <b>%2</b>. - + Welcome! Добро пожаловать! - + <h3 align="center">Welcome to <b>GoldenDict</b>!</h3><p>To start working with the program, first visit <b>Edit|Sources</b> to add some directory paths where to search for the dictionary files, and/or set up various Wikipedia sources. After that, you can optionally organize all the dictionaries found into groups in <b>Edit|Groups</b>.<p>You can also check out the available program preferences at <b>Edit|Preferences</b>. All settings there have tooltips, be sure to read them if you are in doubt about anything.<p>And then you're ready to look up your words! You can do that in this window by using a pane to the left, or you can <a href="Working with popup">look up words from other active applications</a>. <p>Should you need further help, have any questions, suggestions or just wonder what the others think, you are welcome at the program's <a href="http://goldendict.berlios.de/forum/">forum</a>.<p>You can also contact the author directly by writing an <a href="mailto: Konstantin Isakov <ikm@users.berlios.de>">e-mail</a>.<p>Check program's <a href="http://goldendict.berlios.de/">website</a> for the updates. <p>(c) 2008-2009 Konstantin Isakov. Licensed under GPLv3 or later. <h3 align="center">Добро пожаловать в <b>GoldenDict</b>!</h3><p>Если вы запустили программу в первый раз, укажите пути к словарям в <b>Правка|Источники</b>. После этого сгруппируйте найденные словари в <b>Правка|Группы</b>.<p>Вы можете настроить параметры программы в <b>Правка|Параметры</b>. Все параметры настройки имеют подсказки, показываемые при наведении курсора на них.<p>Теперь всё готово для поиска слов! Введите слово в верхнее поле левой панели. Также вы можете <a href="Всплывающее окно">искать слова прямо из других приложений</a>.<p>Если вы хотите помочь в разработке и улучшении программы, пишите на <a href="http://goldendict.berlios.de/forum/">форум</a> или непосредственно автору <a href="mailto: Konstantin Isakov <ikm@users.berlios.de>">по электронной почте</a>.<p>Последняя версия программы доступна на <a href="http://goldendict.berlios.de/">веб-сайте GoldenDict</a>.<p>© Константин Исаков, 2008-2009. Лицензия: GPLv3 или более поздняя версия. - + Working with popup Всплывающее окно - + <h3 align="center">Working with the popup</h3>To look up words from other active applications, you would need to first activate the <i>"Scan popup functionality"</i> in <b>Preferences</b>, and then enable it at any time either by triggering the 'Popup' icon above, or by clicking the tray icon down below with your right mouse button and choosing so in the menu you've popped. <h3 align="center">Всплывающее окно</h3>Для поиска слов из других приложений, вам нужно включить <i>«Разрешить всплывающее окно»</i> в <b>Параметрах</b> и после этого включить всплывающее окно кнопкой «Сканировать» в основном окне или в контекстном меню значка в системном лотке. - + Then just stop the cursor over the word you want to look up in another application, and a window would pop up which would describe it to you. Теперь подведите курсор мыши к какому-либо слову в приложении, и появится всплывающее окно с переводом или значением этого слова. - + Then just select any word you want to look up in another application by your mouse (double-click it or swipe it with mouse with the button pressed), and a window would pop up which would describe the word to you. Теперь выделите какое-либо слово в приложении (двойным щелчком, или же проводя по ним курсором мыши при зажатой левой кнопке), и появится всплывающее окно с переводом или значением этого слова. + + + (untitled) + (без имени) + ArticleRequest - - From %1 - Из словаря %1 + + From + - + From %1 + Из словаря %1 + + + Query error: %1 Ошибка поиска: %1 - + Close words: Близкие слова: @@ -102,123 +110,167 @@ ArticleView - - - - - + + + + + GoldenDict GoldenDict - + The referenced resource doesn't exist. Запрошенный ресурс не найден. - + &Open Link &Открыть ссылку - + Open Link in New &Tab Открыть ссылку в новой &вкладке - + &Look up "%1" &Поиск «%1» - + Look up "%1" in &New Tab Поиск «%1» в &новой вкладке - + + &Look up "%1" in %2 + + + + + Look up "%1" in %2 in &New Tab + + + + Failed to run a player to play sound file: %1 Невозможно запустить проигрыватель звукового файла: %1 - + Failed to create temporary file. Ошибка создания временного файла. - + Failed to auto-open resource file, try opening manually: %1. Ошибка открытия файла ресурса, попробуйте открыть вручную: %1. - + The referenced resource failed to download. Невозможно загрузить указанный ресурс. - + Form Form - + about:blank about:blank - + x x - + Find: Искать: + + + &Previous + + + + + &Next + + + + + Ctrl+G + + + + + &Case Sensitive + + DictGroupWidget - + Form Form - + Group icon: Значок группы: + + DictListModel + + + %1 entries + + + EditDictionaries - + &Sources &Источники - - + + + &Dictionaries + + + + + &Groups &Группы - + Sources changed Источники изменены - + Some sources were changed. Would you like to accept the changes? Источники были изменены. Принять внесенные изменения? - + Accept Принять - + Cancel Отмена @@ -228,6 +280,22 @@ Словари + + GermanTranslit + + + German Transliteration + + + + + GroupComboBox + + + Choose a Group (Alt+G) + + + GroupSelectorWidget @@ -244,43 +312,43 @@ Groups - + Add group Добавить группу - + Give a name for the new group: Введите название новой группы: - + Rename group Переименовать группу - + Give a new name for the group: Введите новое название группы: - + Remove group Удалить группу - + Are you sure you want to remove the group <b>%1</b>? Удалить группу <b>%1</b>? - - + + Remove all groups Удалить все - + Are you sure you want to remove all the groups? Удалить все группы? @@ -289,57 +357,87 @@ Группы - + Dictionaries available: Доступные словари: - + + Add selected dictionaries to group (Ins) + + + + + > + + + + + Ins + + + + + Remove selected dictionaries from group (Del) + + + + + < + + + + + Del + + + + Groups: Группы: - + Tab 2 Tab 2 - + Create new dictionary group Создать новую группу - + &Add group &Добавить - + Rename current dictionary group Переименовать редактируемую группу - + Re&name group &Переименовать - + Remove current dictionary group Удалить редактируемую группу - + &Remove group &Удалить - + Remove all dictionary groups Удалить все существующие группы - + Drag&drop dictionaries to and from the groups, move them inside the groups, reorder the groups using your mouse. Перетаскивайте словари в группы из списка доступных словарей, изменяйте порядок групп, используя мышь. @@ -1286,12 +1384,12 @@ HunspellDictsModel - + Enabled Включено - + Name Название @@ -1320,10 +1418,938 @@ Название словаря + + Language + + + Afar + Афарский + + + + Abkhazian + Абхазский + + + + Avestan + Авестийский + + + + Afrikaans + Африкаанс + + + + Akan + Аканский + + + + Amharic + Амхарский + + + + Aragonese + Арагонский + + + + Arabic + Арабский + + + + Assamese + Ассамский + + + + Avaric + Аварский + + + + Aymara + Аймарский + + + + Azerbaijani + Азербайджанский + + + + Bashkir + Башкирский + + + + Belarusian + Белорусский + + + + Bulgarian + Болгарский + + + + Bihari + Бихарский + + + + Bislama + Бислама + + + + Bambara + Бамана + + + + Bengali + Бенгали + + + + Tibetan + Тибетский + + + + Breton + Бретонский + + + + Bosnian + Боснийский + + + + Catalan + Каталонский + + + + Chechen + Чеченский + + + + Chamorro + Чаморро + + + + Corsican + Корсиканский + + + + Cree + Кри + + + + Czech + Чешский + + + + Church Slavic + Церковно-славянский + + + + Chuvash + Чувашский + + + + Welsh + Уэльский + + + + Danish + Датский + + + + German + Немецкий + + + + Divehi + Мальдивский + + + + Dzongkha + Дзонгка (Бутан) + + + + Ewe + Эве + + + + Greek + Греческий + + + + English + Английский + + + + Esperanto + Эсперанто + + + + Spanish + Испанский + + + + Estonian + Эстонский + + + + Basque + Баскский + + + + Persian + Персидский + + + + Fulah + Фула + + + + Finnish + Финский + + + + Fijian + Фиджи + + + + Faroese + Фарерский + + + + French + Французский + + + + Western Frisian + Фризийский + + + + Irish + Галльский (Ирландия) + + + + Scottish Gaelic + Галльский (Шотландия) + + + + Galician + Галицийский + + + + Guarani + Гуарани + + + + Gujarati + Гуджарати + + + + Manx + Манкс + + + + Hausa + Хауса + + + + Hebrew + Иврит + + + + Hindi + Хинди + + + + Hiri Motu + Хири-моту + + + + Croatian + Хорватский + + + + Haitian + Гаитянский + + + + Hungarian + Венгерский + + + + Armenian + Армянский + + + + Herero + Эреро + + + + Interlingua + Интерлингва + + + + Indonesian + Индонезийский + + + + Interlingue + Окциденталь + + + + Igbo + Ибо + + + + Sichuan Yi + Сычуаньский И + + + + Inupiaq + Инупиак + + + + Ido + Идо + + + + Icelandic + Исландский + + + + Italian + Итальянский + + + + Inuktitut + Инуктитут + + + + Japanese + Японский + + + + Javanese + Яванский + + + + Georgian + Грузинский + + + + Kongo + Конго + + + + Kikuyu + Кикую + + + + Kwanyama + Кваньяма + + + + Kazakh + Казахский + + + + Kalaallisut + Калаалисут + + + + Khmer + Кхмерский + + + + Kannada + Каннада + + + + Korean + Корейский + + + + Kanuri + Канури + + + + Kashmiri + Кашмирский + + + + Kurdish + Курдский + + + + Komi + Коми + + + + Cornish + Корнуольский + + + + Kirghiz + Киргизский + + + + Latin + Латинский + + + + Luxembourgish + Люксембургский + + + + Ganda + Ганда + + + + Limburgish + Лимбуржский + + + + Lingala + Лингала + + + + Lao + Лао + + + + Lithuanian + Литовский + + + + Luba-Katanga + Луба-Катанга + + + + Latvian + Латышский + + + + Malagasy + Мальгашский + + + + Marshallese + Маршалльский + + + + Maori + Маори + + + + Macedonian + Македонский + + + + Malayalam + Малайялам + + + + Mongolian + Монгольский + + + + Marathi + Марати + + + + Malay + Малайский + + + + Maltese + Мальтийский + + + + Burmese + Бирманский + + + + Nauru + Науру + + + + Norwegian Bokmal + Норвежский букмол + + + + North Ndebele + Сев. Ндебеле + + + + Nepali + Непальский + + + + Ndonga + Ндонга + + + + Dutch + Голландский + + + + Norwegian Nynorsk + Новонорвежский (нюнорск) + + + + Norwegian + Норвежский + + + + South Ndebele + Юж. Ндебеле + + + + Navajo + Навахо + + + + Chichewa + Чичева + + + + Occitan + Французский (диалект Occitan) + + + + Ojibwa + Оджибва + + + + Oromo + Оромо + + + + Oriya + Ория + + + + Ossetian + Осетинский + + + + Panjabi + Панджаби + + + + Pali + Пали + + + + Polish + Польский + + + + Pashto + Пуштунский + + + + Portuguese + Португальский + + + + Quechua + Кечуа + + + + Raeto-Romance + Романшский + + + + Kirundi + Рунди + + + + Romanian + Румынский + + + + Russian + Русский + + + + Kinyarwanda + Киньяруанда + + + + Sanskrit + Санскрит + + + + Sardinian + Сардинийский + + + + Sindhi + Синдхи + + + + Northern Sami + Северное Саами + + + + Sango + Санго + + + + Serbo-Croatian + Сербо-хорватский + + + + Sinhala + Сингальский + + + + Slovak + Словацкий + + + + Slovenian + Словенский + + + + Samoan + Самоа + + + + Shona + Схона + + + + Somali + Сомалийский + + + + Albanian + Албанский + + + + Serbian + Сербский + + + + Swati + Свати + + + + Southern Sotho + Юж. Сото + + + + Sundanese + Сунданский + + + + Swedish + Шведский + + + + Swahili + Суахили + + + + Tamil + Тамильский + + + + Telugu + Телугу + + + + Tajik + Таджикский + + + + Thai + Тайский + + + + Tigrinya + Тигринья + + + + Turkmen + Туркменский + + + + Tagalog + Тагалог + + + + Tswana + Тсвана + + + + Tonga + Тонга + + + + Turkish + Турецкий + + + + Tsonga + Тсонга + + + + Tatar + Татарский + + + + Twi + Тви + + + + Tahitian + Таитянский + + + + Uighur + Уйгурский + + + + Ukrainian + Украинский + + + + Urdu + Урду + + + + Uzbek + Узбекский + + + + Venda + Венда + + + + Vietnamese + Вьетнамский + + + + Volapuk + Волапюк + + + + Walloon + Валлонский + + + + Wolof + Уолоф + + + + Xhosa + Кшоса + + + + Yiddish + Идиш + + + + Yoruba + Йоруба + + + + Zhuang + Чжуанг + + + + Chinese + Китайский + + + + Zulu + Зулусский + + LoadDictionaries - + Error loading dictionaries Ошибка при загрузке словарей @@ -1331,68 +2357,72 @@ MainWindow - + Navigation Навигация - + Back Назад - + Forward Вперёд - + Scan Popup Сканировать - Pronounce word - Произнести слово + Произнести слово - + Show &Main Window Показать &основное окно - - + + &Quit В&ыход - + Loading... Загрузка... - + + Skip This Release + + + + Print Article Печать статьи - + Save Article As Сохранить статью как - + Html files (*.html *.htm) Файлы Html (*.html *.htm) - + Error Ошибка - + Can't save article: %1 Невозможно сохранить статью: %1 @@ -1401,69 +2431,79 @@ Ошибка при загрузке словарей - + %1 dictionaries, %2 articles, %3 words Словарей: %1, статей: %2, слов: %3 - + Failed to initialize hotkeys monitoring mechanism.<br>Make sure your XServer has RECORD extension turned on. Ошибка инициализации механизма отслеживания горячих клавиш.<br>Убедитесь, что ваш XServer поддерживает расширение RECORD. - + New Release Available Доступна новая версия - + Version <b>%1</b> of GoldenDict is now available for download.<br>Click <b>Download</b> to get to the download page. Версия <b>%1</b> программы GoldenDict доступа для загрузки.<br> Нажмите <b>Загрузить</b>, чтобы перейти на страницу загрузки. - + Download Загрузить - - + + Look up in: Поиск в: - + + Pronounce Word (Alt+S) + + + + Zoom In Увеличить - + Zoom Out Уменьшить - + Normal Size Обычный размер - + Look up: Искать: - + + All + + + + (untitled) (без имени) - + WARNING: %1 Внимание: %1 - + GoldenDict GoldenDict @@ -1477,7 +2517,7 @@ Tab 2 - + Welcome! Добро пожаловать! @@ -1488,17 +2528,17 @@ &Файл - + &Edit &Правка - + &Help &Справка - + &Preferences... &Параметры... @@ -1507,113 +2547,123 @@ &Источники... - + F2 F2 - + &Groups... &Группы... - + &Dictionaries... &Словари... - - + + F3 F3 - + F4 F4 - + &Homepage &Веб-сайт - + &About &О программе - + About GoldenDict О программе GoldenDict - + F1 F1 - + Quit from application Выйти из приложения - + Ctrl+Q Ctrl+Q - + &Forum &Форум - + &Close To Tray &Свернуть в лоток - + Minimizes the window to tray Свёртывает окно в лоток - + Ctrl+F4 Ctrl+F4 - + &Save Article &Сохранить статью - + Save Article Сохранить статью - + &Print &Печатать - + Ctrl+P Ctrl+P - + Page Set&up П&араметры страницы - + Print Preview Предварительый просмотр - + + Rescan Files + + + + + Ctrl+F5 + + + + Search Pane Панель поиска @@ -1625,30 +2675,96 @@ MediaWikisModel - + Enabled Включено - + Name Название - + Address Адрес + + OrderAndProps + + + Form + Form + + + + Dictionary order: + + + + + + + + ... + ... + + + + Inactive (disabled) dictionaries: + + + + + Dictionary information + + + + + Name: + + + + + Total articles: + + + + + Total words: + + + + + Translates from: + + + + + Translates to: + + + + + Files comprising this dictionary: + + + + + Adjust the order by dragging and dropping items in it. Drop dictionaries to the inactive group to disable their use. + + + PathsModel - + Path Путь - + Recursive Рекурсивно @@ -1661,17 +2777,17 @@ Параметры - + &Interface &Интерфейс - + Tabbed browsing Работа со вкладками - + Normally, opening a new tab switches to it immediately. With this on however, new tabs will be opened without switching to them. @@ -1680,12 +2796,12 @@ switching to them. открываться в фоне, без переключения на них. - + Open new tabs in background Открывать новые вкладки в фоне - + With this on, new tabs are opened just after the current, active one. Otherwise they are added to be the last ones. @@ -1694,12 +2810,12 @@ be the last ones. добавляться в конец.. - + Open new tabs after the current one Открывать новые вкладки за текущей - + When enabled, an icon appears in the sytem tray area which can be used to open main window and perform other tasks. При включении этого параметра в системном лотке появится значок, @@ -1707,82 +2823,87 @@ to open main window and perform other tasks. действий. - + Enable system tray icon Показывать значок в системном лотке - + With this on, the application starts directly to system tray without showing its main window. При включении этого параметра приложение будет запущено в системном лотке без показа основного окна. - + Start to system tray Запустить в системном лотке - + With this on, an attempt to close main window would hide it instead of closing the application. При включении этого параметра закрытие основного окна свернёт его в системный лоток. - + Close to system tray Сворачивать в системный лоток - + Startup Запуск - + Automatically starts GoldenDict after operation system bootup Автоматически запускать программу при старте операционной системы - + Start with system Автозапуск программы - + Interface language: Язык программы: - + + Display style: + + + + Hotkeys Горячие клавиши - + Use the following hotkey to show or hide the main window: Использовать следующую комбинацию для показа/скрытия основного окна: - + Use the following hotkey to translate a word from clipboard: Использовать следующую комбинацию для перевода слова из буфера обмена: - + The hotkeys are global and work from any program and within any context as long as GoldenDict is running in background. Горячие клавиши являются глобальными и работают из любой программы и в любом состоянии, до тех пор пока GoldenDict работает в фоне. - + &Scan Popup &Всплывающее окно - + When enabled, a translation popup window would be shown each time you point your mouse on any word on the screen (Windows) or select any word with mouse (Linux). When enabled, you can switch it on and @@ -1797,135 +2918,135 @@ off from main window or tray icon. Показывать всплывающее окно - + Enable scan popup functionality Разрешить всплывающее окно - + Chooses whether the scan popup mode is on by default nor not. If checked, the program would always start with the scan popup active. Включать или нет режим всплывающего окна при запуске программы. - + Start with scan popup turned on Включить режим всплывающего окна при запуске - + With this enabled, the popup would only show up if all chosen keys are in the pressed state when the word selection changes. Показывать всплывающее окно, только если все выбранные клавиши находятся в зажатом состоянии в момент выделения слова. - + Only show popup when all selected keys are kept pressed: Показывать всплывающее окно только при зажатых клавишах: - + Left Ctrl only При зажатии левой клавиши Ctrl - + Left Ctrl Левый Ctrl - + Right Shift only При зажатии правой клавиши Shift - + Right Shift Правый Shift - + Alt key При зажатии любой клавиши Alt - + Alt Alt - + Ctrl key При зажатии любой клавиши Ctrl - + Ctrl Ctrl - + Left Alt only При зажатии левой клавиши Alt - + Left Alt Левый Alt - + Shift key При зажатии любой клавиши Shift - + Shift Shift - + Right Alt only При зажатии правой клавиши Alt - + Right Alt Правый Alt - + Right Ctrl only При зажатии правой клавиши Ctrl - + Right Ctrl Правый Ctrl - + Left Shift only При зажатии левой клавиши Shift - + Left Shift Левый Shift - + Windows key or Meta key При зажатии клавиши Windows или Meta - + Win/Meta Win или Meta - + Normally, in order to activate a popup you have to maintain the chosen keys pressed while you select a word. With this enabled, the chosen keys may also @@ -1937,12 +3058,12 @@ be pressed shorty after the selection is done. того, как слово было выделено. - + Keys may also be pressed afterwards, within Задержка проверки модификаторов - + To avoid false positives, the keys are only monitored after the selection's done for a limited amount of seconds, which is specified here. @@ -1951,74 +3072,74 @@ seconds, which is specified here. промежутка времени, который и задается здесь. - + secs секунд(ы) - + &Audio &Аудио - + Auto-pronounce words in main window Автоматически произносить слова в главном окне - + Auto-pronounce words in scan popup Автоматически произносить слова во всплывающем окне - + Program to play audio files: Программа для воспроизведения звуковых файлов: - + &Network &Сеть - + Enable if you wish to use a proxy server for all program's network requests. Включите, если хотите использовать прокси-сервер для всех сетевых запросов программы. - + Use proxy server Использовать прокси-сервер - + Type: Тип: - + Host: Сервер: - + Port: Порт: - + User: Имя пользователя: - + Password: Пароль: - + When this is enabled, the program periodically checks if a new, updated version of GoldenDict is available for download. If it is so, the program @@ -2031,7 +3152,7 @@ GoldenDict. Если новая версия появилась, програм страницу загрузки. - + Check for new program releases periodically Проверять наличие новой версии @@ -2051,16 +3172,47 @@ GoldenDict. Если новая версия появилась, програм Русский - + + Default + + + + + Lingvo + + + + Changing Language Смена языка - + Restart the program to apply the language change. Перезапустите программу, чтобы изменение языка вошло в силу. + + Romaji + + + Hepburn Romaji for Hiragana + + + + + Hepburn Romaji for Katakana + + + + + RussianTranslit + + + Russian Transliteration + + + ScanPopup @@ -2083,31 +3235,49 @@ GoldenDict. Если новая версия появилась, програм + List Matches (Alt+M) + + + + + Alt+M + + + + + Pronounce Word (Alt+S) + + + + + Alt+S + + + List matches - Список совпадений + Список совпадений - - + + ... ... - Pronounce word - Произнести слово + Произнести слово SoundDirsModel - + Path Путь - + Name Название @@ -2115,27 +3285,29 @@ GoldenDict. Если новая версия появилась, програм Sources - - - + + + Choose a directory Выбор пути - - - + + + + Confirm removal Подтверждение удаления - - + + Remove directory <b>%1</b> from the list? Удалить путь <b>%1</b> из списка? - + + Remove site <b>%1</b> from the list? Удалить веб-сайт <b>%1</b> из списка? @@ -2155,50 +3327,57 @@ GoldenDict. Если новая версия появилась, програм - - + + + &Add... &Добавить... - - + + + &Remove &Удалить - + + Re&scan now + + + + Sound Dirs Папки со звуками - + Make dictionaries from bunches of audiofiles by adding paths here: Все найденные звуковые файлы каждой папки компонуются в словари: - + Morphology Морфология - + Path to a directory with Hunspell/Myspell dictionaries: Путь к словарям Hunspell/Myspell: - + &Change... &Изменить... - + Available morphology dictionaries: Доступные морфологические словари: - + Each morphology dictionary appears as a separate auxiliary dictionary which provides stem words for searches and @@ -2215,26 +3394,147 @@ of the appropriate groups to use them. добавляйте соответствующие словари в конец соответствующих групп. + + + Websites + + + + + Any websites. A string %GDWORD% will be replaced with the query word: + + + + + Alternatively, use %GD1251% for CP1251, %GDISO1% for ISO 8859-1. + + + + + Transliteration + + + + + Russian transliteration + + + + + German transliteration + + + + + Enables to use the Latin alphabet to write the Japanese language + + + + + Japanese Romaji + + + + + Systems: + + + + + The most widely used method of transcription of Japanese, +based on English phonology + + + + + Hepburn + + + + + The most regular system, having a one-to-one relation to the +kana writing systems. Standardized as ISO 3602 + +Not implemented yet in GoldenDict. + + + + + Nihon-shiki + + + + + Based on Nihon-shiki system, but modified for modern standard Japanese. +Standardized as ISO 3602 + +Not implemented yet in GoldenDict. + + + + + Kunrei-shiki + + + + + Syllabaries: + + + + + + Hiragana Japanese syllabary + + + + + Hiragana + + + + + Katakana + + Each morphology dictionary appears as a separate auxiliary dictionary which provides stem words for searches and spelling suggestions for mistyped words. Add appropriate dictionaries to the bottoms of the appropriate groups to use them. Каждый морфологический словарь представляется в виде отдельного вспомогательного словаря, предоставляющего корни слов при поиске, а также варианты написания неправильно написанных слов. Для использования словарей добавляйте соответствующие словари в конец соответствующих групп. - + Wikipedia Пишется по-русски, источник: ru.wikipedia.org Википедия - + Wikipedia (MediaWiki) sites: Веб-сайты Википедии (MediaWiki): + + WebSitesModel + + + Enabled + Включено + + + + Name + Название + + + + Address + Адрес + + WordFinder - + Failed to query some dictionaries. Ошибка поиска в некоторых словарях. diff --git a/src/orderandprops.cc b/src/orderandprops.cc index 7df3f353..b68d00d8 100644 --- a/src/orderandprops.cc +++ b/src/orderandprops.cc @@ -4,6 +4,7 @@ #include "orderandprops.hh" #include "instances.hh" #include "langcoder.hh" +#include "language.hh" OrderAndProps::OrderAndProps( QWidget * parent, Config::Group const & dictionaryOrder, @@ -73,9 +74,9 @@ void OrderAndProps::disableDictionaryDescription() } namespace { - QString makeLangText( quint32 langId ) + QString makeLangText( Language::Id langId ) { - QString name = LangCoder::decode( langId ); + QString name = Language::localizedNameForId( langId ); if ( name.isEmpty() ) return name;