Merge branch 'stardict' of ssh://drop.maemo.org/git/mdictionary into stardict
authorjakub <jakub.jaszczynski@comarch.com>
Thu, 18 Nov 2010 10:09:29 +0000 (11:09 +0100)
committerjakub <jakub.jaszczynski@comarch.com>
Thu, 18 Nov 2010 10:09:29 +0000 (11:09 +0100)
Conflicts:
src/plugins/stardict/StarDialog.cpp
src/plugins/stardict/StarDictPlugin.cpp
src/plugins/stardict/en_US.ts
src/plugins/stardict/pl_PL.ts

1  2 
src/plugins/stardict/StarDialog.cpp
src/plugins/stardict/StarDictPlugin.cpp
src/plugins/stardict/en_US.ts
src/plugins/stardict/pl_PL.ts

  #include <QDebug>
  #include <QFile>
  
 -StarDialog::StarDialog(StarDictPlugin *plugin,
 -                       StarDialogType type,
 -                       QWidget *parent) :
 -    QDialog(parent) {
 -    this->plugin = plugin;
 -    this->type = type;
 -
 -    accentsToolTip = tr("Strip accents (searching takes more time, but spelling doesn't have to be exact)");
 -
 -    initializeUI();
 -
 -
 -    connect(accentsCheckBox, SIGNAL(toggled(bool)),
 -            this, SLOT(setAccents(bool)));
 -
 -    #ifdef Q_WS_MAEMO_5
 -        connect(accentsInfoToolButton, SIGNAL(clicked()),
 -
 -    #endif
 -
 -    if(type == New) {
 -        connect(browseButton, SIGNAL(clicked()),
 -                this, SLOT(selectFile()));
 -    }
 -
 -    connect(confirmButton, SIGNAL(clicked()),
 -            this, SLOT(accept()));
 -
 +StarDialog::StarDialog(StarDictPlugin *plugin, StarDialogType type,
 +                       QWidget *parent) : QDialog(parent) {
 +   this->plugin = plugin;
 +   this->type = type;
 +   initializeUI();
 +   if(type == New)
 +       connect(browseButton, SIGNAL(clicked()),this, SLOT(selectFile()));
 +   connect(confirmButton, SIGNAL(clicked()),this, SLOT(accept()));
  }
  
  
@@@ -40,21 -60,28 +40,24 @@@ void StarDialog::initializeUI() 
      mainVerticalLayout = new QVBoxLayout;
      widget = new QWidget;
      widget->setLayout(mainVerticalLayout);
 -
      infoLabel = new QLabel;
      infoLabel->setWordWrap(true);
+     QVBoxLayout* buttonLayout = new QVBoxLayout;
  
      if(type == New) {
 -        setWindowTitle(tr("Add new StarDict dictionary"));
 -
          browseLayout = new QHBoxLayout;
          browseButton = new QPushButton(tr("Browse"));
+         browseButton->setMaximumWidth(150);
+         infoLabel->setText(tr("Dictionary file: not selected"));
 -
 +        setWindowTitle(tr("Add new StarDict dictionary"));
 +        infoLabel->setText(tr("Dictionary file: not selected"));
          browseLayout->addWidget(infoLabel, 0, Qt::AlignLeft);
+         browseLayout->addLayout(buttonLayout);
          browseLayout->addWidget(browseButton, 0, Qt::AlignRight);
 -
          mainVerticalLayout->addLayout(browseLayout);
      }
      else {
          setWindowTitle(tr("StarDict Settings"));
 -
          infoLabel->setText(tr("Plugin: ") + plugin->type().toUpper() +"\n" +
                  tr("Book name: ") + plugin->settings()->value("bookname") 
                          + "\n" +
          mainVerticalLayout->addWidget(infoLabel);
      }
  
 -    accentsLayout = new QHBoxLayout;
 -    accentsCheckBox = new QCheckBox(tr("Strip accents"));
 -    accentsCheckBox->setToolTip(accentsToolTip);
 -    accentsLayout->addWidget(accentsCheckBox);
 -    #ifdef Q_WS_MAEMO_5
 -        accentsInfoToolButton = new QToolButton;
 -        accentsInfoToolButton->setIcon(QIcon::fromTheme("general_information"));
 -        accentsLayout->addWidget(accentsInfoToolButton);
 -    #endif
 -
 -
 -    mainVerticalLayout->addLayout(accentsLayout);
 -
 -
 -    //load old setting if exists
 -    if(!plugin) {
 -        accentsCheckBox->setChecked(true);
 -        accentsCheckBox->setEnabled(false);
 -        _accents = true;
 +    if(!plugin)
          _dictionaryFilePath = "";
  
      confirmButton = new QPushButton;
      mainVerticalLayout->addWidget(confirmButton);
 -    if(type == New) {
 +    if(type == New)
          confirmButton->setText(tr("Add"));
 -    }
 -    else {
 +    else
          confirmButton->setText(tr("Save settings"));
 -    }
  
      scrollArea = new QScrollArea;
      scrollArea->setWidget(widget);
      scrollArea->setLineWidth(0);
      scrollArea->setMidLineWidth(0);
      scrollArea->setFrameStyle(QFrame::NoFrame);
 -
 -
 -}
 -
 -
 -void StarDialog::setAccents(bool accents) {
 -    _accents = accents;
  }
  
  
  void StarDialog::selectFile() {
      QString fileName = QFileDialog::getOpenFileName(this,
 -                                     tr("Select dictionary file"),
 -                                     _dictionaryFilePath,
 -                                     tr("StarDict Files (*.dict *dict.dz *.idx *idx.gz *.ifo)"),
 -                                     NULL,
 -                                     NULL);
 -
 +                     tr("Select dictionary file"),
 +                     _dictionaryFilePath,
 +                     tr("StarDict Files (*.dict *dict.dz *.idx *idx.gz *.ifo)"),
 +                     NULL,
 +                     NULL);
      if (!fileName.isEmpty()) {
          infoLabel->setText(tr("Dictionary file: %1").arg(fileName));
          _dictionaryFilePath = fileName;
 -        if (_dictionaryFilePath.endsWith(".tar.bz2")){
 -                _isCompressed = true;
 -        }
 -        else {
 -                _isCompressed = false;
 -        }
 +        if (_dictionaryFilePath.endsWith(".tar.bz2"))
 +            _isCompressed = true;
 +        else
 +            _isCompressed = false;
          updateGeometry();
      }
  }
  
 +
  void StarDialog::saveSettings() {
      _settings = new Settings;
 -    if(plugin) {
 +
 +    if(plugin)
          foreach(QString key, plugin->settings()->keys())
              _settings->setValue(key, plugin->settings()->value(key));
 -    }
 -    //else {
 +
 +    if(_settings->value("path")=="")
          _settings->setValue("path", _dictionaryFilePath);
 +
 +    if(_settings->value("ifoFileName")=="")
          _settings->setValue("ifoFileName", _dictName + ".ifo");
 +
 +    if(_settings->value("idxFileName")=="")
          _settings->setValue("idxFileName", _dictName + ".idx");
 -        if (QFile::exists(_dictName + ".dict.dz") == true) {
 -                _settings->setValue("dictFileName", _dictName + ".dict.dz");
 -        }
 -        else {
 -                _settings->setValue("dictFileName", _dictName + ".dict");
 -        }
  
 -        if (QFile::exists(_dictName + ".syn") == true) {
 -                _settings->setValue("synFileName", _dictName + ".syn");
 -        }
 -    //}
 -    if(_accents)
 -        _settings->setValue("strip_accents", "true");
 -    else
 -        _settings->setValue("strip_accents", "false");
 +    if(_settings->value("dictFileName")==""){
 +        if (QFile::exists(_dictName + ".dict.dz") == true)
 +            _settings->setValue("dictFileName", _dictName + ".dict.dz");
 +        else
 +            _settings->setValue("dictFileName", _dictName + ".dict");
 +    }
 +
 +    if(_settings->value("synFileName")=="")
 +        if (QFile::exists(_dictName + ".syn") == true)
 +            _settings->setValue("synFileName", _dictName + ".syn");
  }
  
 +
  void StarDialog::accept() {
      if(type == New && _dictionaryFilePath.isEmpty()) {
          Q_EMIT notify(Notify::Warning, tr("File path is not set"));
 -
          return;
      }
  
      QDialog::accept();
  }
  
 +
  bool StarDialog::checkFiles() {
 -        if (!_isCompressed) {
 -
 -            if (_dictionaryFilePath.right(2) == "dz") {
 -                _dictName = _dictionaryFilePath.left(_dictionaryFilePath.lastIndexOf("."));
 -                _dictName = _dictName.left(_dictName.lastIndexOf("."));
 -            }
 -            else {
 -                _dictName = _dictionaryFilePath.left(_dictionaryFilePath.lastIndexOf("."));
 -            }
 -
 -            if (QFile::exists(_dictName + ".idx") == false && QFile::exists(_dictName + ".idx.gz") == false) {
 -                return false;
 -            }
 -            if (QFile::exists(_dictName + ".dict") == false && QFile::exists(_dictName + ".dict.dz") == false) {
 -                return false;
 -            }
 -            return true;
 +    if (!_isCompressed) {
 +        if (_dictionaryFilePath.right(2) == "dz") {
 +            _dictName = _dictionaryFilePath.left(_dictionaryFilePath.lastIndexOf("."));
 +            _dictName = _dictName.left(_dictName.lastIndexOf("."));
          }
 -        else {
 -            //TODO: untar files (?)
 +        else{
 +            _dictName = _dictionaryFilePath.left(_dictionaryFilePath.lastIndexOf("."));
 +        }
 +
 +
 +        if (QFile::exists(_dictName + ".idx") == false
 +                && QFile::exists(_dictName + ".idx.gz") == false) {
 +            return false;
 +        }
 +        if (QFile::exists(_dictName + ".dict") == false
 +                && QFile::exists(_dictName + ".dict.dz") == false) {
              return false;
          }
 +        return true;
 +    }
 +    else
 +        return false;
  }
  
 +
  Settings* StarDialog::getSettings() {
      return _settings;
  }
  
 -#ifdef Q_WS_MAEMO_5
 -    void StarDialog::showAccentsInfo() {
 -        Q_EMIT notify(Notify::Warning, accentsToolTip);
 -    }
 -#endif
 -
  
  #include "StarDictPlugin.h"
  
 +/**/
  uint qHash(const TranslationStarDict &key) {
     return qHash(key.key());
  }
  
 +
  StarDictPlugin::StarDictPlugin(QObject *parent) : CommonDictInterface(parent),
                      _langFrom(""), _langTo(""),_name(""), _infoNote("") {
      _settings = new Settings();
      connect(_dictDialog, SIGNAL(notify(Notify::NotifyType,QString)),
              this, SIGNAL(notify(Notify::NotifyType,QString)));
  
 -
      _settings->setValue("type","stardict");
      _icon = QIcon("/usr/share/mdictionary/stardict.png");
 -    _wordsCount = -1;
      stopped = false;
  
      initAccents();
  }
  
 +
  void StarDictPlugin::retranslate() {
      QString locale = QLocale::system().name();
      QTranslator *translator = new QTranslator(this);
  
      if(!translator->load(":/stardict/translations/" + locale)) {
-         translator->load(":/stardicts/translations/en_US");
+         translator->load(":/stardict/translations/en_US");
      }
      QCoreApplication::installTranslator(translator);
  }
@@@ -89,29 -89,26 +89,29 @@@ QString StarDictPlugin::infoNote() cons
  
  
  QList<Translation*> StarDictPlugin::searchWordList(QString word, int limit) {
 -    qDebug() << "StarDict searachWordList" << word;
      QList<TranslationStarDict> translations;
      bool is32b = false;
 -    if(settings()->value("idxoffsetbits") == "32" ||
 -            settings()->value("idxoffsetbits") == "")
 -       is32b = true;
 -
      bool err = 0;
      int wordcount = settings()->value("wordcount").toInt(&err);
 -    if(!err)
 -        return QList<Translation*>();
 -
 +    int counter = 0;
 +    int counterLimit = 0;
      QString idxPath = settings()->value("idxFileName");
      StarDictReader * reader = StarDictReaderFactory::createReader(idxPath);
      QString fkey;
      qint64 offset = 0, len = 0;
      QRegExp keyword(word, Qt::CaseInsensitive, QRegExp::Wildcard);
  
 -    int counter = 0;
 -    int counterLimit = 0;
 +    if( word.indexOf("*")==-1 && word.indexOf("?")==-1 &&
 +        word.indexOf("_")==-1 && word.indexOf("%")==-1)
 +        word+="*";
 +
 +    if((settings()->value("idxoffsetbits") == "32") ||
 +                         (settings()->value("idxoffsetbits") == ""))
 +        is32b = true;
 +
 +    if(!err)
 +        return QList<Translation*>();
 +
      stopped=false;
      while(counter < wordcount && (counterLimit<limit || limit==0) && !stopped) {
          counter++;
          len = reader->readInt32BigEndian();
  
          if(keyword.exactMatch(fkey)) {
 -            qDebug()<<"InfoNote"<<infoNote();
              TranslationStarDict tran(fkey, infoNote(), this);
              qDebug() << "off/len" << offset << len;
              int id = translations.indexOf(tran);
      QListIterator<TranslationStarDict> it(translations);
      while(it.hasNext())
          ret.push_back(new TranslationStarDict(it.next()));
 -
 -
      return ret;
  }
  
@@@ -149,6 -149,8 +149,6 @@@ QByteArray StarDictPlugin::read(QByteAr
      if(bytes == 0 && it != end){
          while(*it != '\0' && it != end)
              ret.append(*it++);
 -        if(it == end) qDebug()<<"end";
 -        else  qDebug()<<"000";
      }
      else
          for(int i = 0; i < bytes && it != end; i++)
@@@ -161,22 -163,19 +161,22 @@@ QString StarDictPlugin::interpret(QByte
          QByteArray::iterator end, QChar mode,QString key, bool last) {
      QString result;
      qDebug()<<"****** mode:     "<<mode;
 -    if(mode == 'm'){
 -        result += "<key>" + key + "</key>";
 -        result += QString::fromUtf8(read(it++, end));
 -    }
 -    else if(mode == 'l'){
 +
 +    if(mode == 'm' ||
 +            mode == 'l' ||
 +            mode == 'g' ||
 +            mode == 't' ||
 +            mode == 'y' ||
 +            mode == 'k' ||
 +            mode == 'w' ||
 +            mode == 'h' ||
 +            mode == 'r' ){
          result += "<key>" + key + "</key>";
 -        result += QString::fromUtf8(read(it++, end));
 +        result += "<t>" + QString::fromUtf8(read(it++, end)) + "</t>";
      }
 -    else if(mode ==  'g'){
 -        result += "<key>" + key + "</key>";
 -        result += QString::fromUtf8(read(it++, end));
  
 -        /* delete "small" tag  from translation*/
 +    if(mode ==  'g'){
 +        /* delete "small" tag  from g translation*/
          int indexOfSmall=result.indexOf("<small>");
          while(indexOfSmall!=-1){
              int indexOfEndSmall= result.indexOf("</small>");
              indexOfSmall=result.indexOf("<small>");
          }
      }
 -    else if(mode == 't'){
 -        result += "<key>" + key + "</key>";
 -        result += QString::fromUtf8(read(it++, end));
 -    }
 -    else if(mode == 'x'){
 +    if(mode == 'x'){
          result += QString::fromUtf8(read(it++, end));
          result.replace("</k>","</key><t>");
          result.replace("<k>","</t><key>");
          if(result.contains("<t>"))
              result+="</t>";
      }
 -    else if(mode == 'y') {
 -        result += "<key>" + key + "</key>";
 -        result += QString::fromUtf8(read(it++, end));
 -    }
 -    else if(mode == 'k'){
 -        result += "<key>" + key + "</key>";
 -        result += QString::fromUtf8(read(it++, end));
 -    }
 -    else if(mode == 'w'){
 -        result += "<key>" + key + "</key>";
 -        result += QString::fromUtf8(read(it++, end));
 -    }
 -    else if(mode == 'h'){
 -        result += "<key>" + key + "</key>";
 -        result += QString::fromUtf8(read(it++, end));
 -    }
 -    else if(mode == 'r'){
 -        result += "<key>" + key + "</key>";
 -        result += QString::fromUtf8(read(it++, end));
 -    }
  
  // Dont know whether mDictionary would ever handle binary stardict format
 -//     to be honest dont see any kind of adventages (can't find any binary dict)
 +// to be honest dont see any kind of adventages (can't find any binary dict)
   /*
      }
      else if(mode == 'W') {
      return result;
  }
  
 +
  QString StarDictPlugin::format(QByteArray raw, QString mode,QString key) {
      QString result;
      if(mode == "") {
  }
  
  
  QString StarDictPlugin::search(QString key, qint64 offset, qint32 len) {
      QString dictPath = settings()->value("dictFileName");
      StarDictReader *reader = StarDictReaderFactory::createReader(dictPath);
 -
      QByteArray raw = reader->readString(offset, len);
 -    qDebug()<<"mod"<<settings()->value("sametypesequence");
      QString result= format(raw, settings()->value("sametypesequence"),key);
 +
      delete reader;
      return result;
  }
  
  
 -
  void StarDictPlugin::stop() {
 -    qDebug()<<"zatrzymanie programu";
      stopped=true;
  }
  
@@@ -277,14 -303,14 +277,14 @@@ CommonDictInterface* StarDictPlugin::ge
              setLastDialogParent(_dictDialog->lastDialogParent());
  
      if(settings && plugin->setSettings(settings)) {
 -        disconnect(plugin, SIGNAL(notify(Notify::NotifyType,QString)),
 -                this, SIGNAL(notify(Notify::NotifyType,QString)));
 +        disconnect( plugin, SIGNAL(notify(Notify::NotifyType,QString)),
 +                    this, SIGNAL(notify(Notify::NotifyType,QString)));
          plugin->getDictionaryInfo();
          return plugin;
      }
      else {
 -        disconnect(plugin, SIGNAL(notify(Notify::NotifyType,QString)),
 -                this, SIGNAL(notify(Notify::NotifyType,QString)));
 +        disconnect( plugin, SIGNAL(notify(Notify::NotifyType,QString)),
 +                    this, SIGNAL(notify(Notify::NotifyType,QString)));
          delete plugin;
          return 0;
      }
@@@ -301,6 -327,11 +301,6 @@@ Settings* StarDictPlugin::settings() 
  }
  
  
 -bool StarDictPlugin::isCached() {
 -    return false;
 -}
 -
 -
  bool StarDictPlugin::setSettings(const Settings *sett) {
      if(sett) {
          foreach(QString key, sett->keys())
@@@ -317,11 -348,12 +317,11 @@@ bool StarDictPlugin::getDictionaryInfo(
      QFile file(settings()->value("ifoFileName"));
      if(!QFile::exists(_settings->value("ifoFileName"))
                  || !file.open(QFile::ReadOnly | QFile::Text)) {
 -       Q_EMIT notify(Notify::Warning,
 +        Q_EMIT notify(Notify::Warning,
                 QString(tr("StarDict dictionary cannot be read from file")));
          qDebug()<<"Error: could not open the file";
          return false;
      }
 -
      QTextStream in(&file);
      while (!in.atEnd()) {
          QString line = in.readLine();
              settings()->setValue(list.at(0),list.at(1));
          }
      }
 -
      _name = settings()->value("bookname");
      return true;
  }
@@@ -345,6 -378,7 +345,6 @@@ int StarDictPlugin::countWords() 
  }
  
  
 -
  void StarDictPlugin::clean() {
  
  }
  <context>
      <name>StarDialog</name>
      <message>
-         <location filename="StarDialog.cpp" line="33"/>
+         <location filename="StarDialog.cpp" line="35"/>
          <source>Strip accents (searching takes more time, but spelling doesn&apos;t have to be exact)</source>
          <translation type="unfinished"></translation>
      </message>
+     <message>
+         <location filename="StarDialog.cpp" line="68"/>
+         <source>Add new StarDict dictionary</source>
+         <translation type="unfinished"></translation>
+     </message>
 +</context>
 +<context>
 +    <name>StarDictPlugin</name>
      <message>
-         <location filename="StarDictPlugin.cpp" line="353"/>
-         <source>StarDict dictionary cannot be read from file</source>
+         <location filename="StarDialog.cpp" line="71"/>
+         <source>Browse</source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="72"/>
+         <source>Dictionary file: not selected</source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="80"/>
+         <source>StarDict Settings</source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="82"/>
+         <source>Plugin: </source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="83"/>
+         <source>Book name: </source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="85"/>
+         <source>Version: </source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="86"/>
+         <source>Word count: </source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="88"/>
+         <source>Author: </source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="89"/>
+         <source>E-mail: </source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="90"/>
+         <source>Website: </source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="91"/>
+         <source>Description: </source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="93"/>
+         <source>Date: </source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="98"/>
+         <source>Strip accents</source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="137"/>
+         <source>Add</source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="140"/>
+         <source>Save settings</source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="182"/>
+         <source>Select dictionary file</source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="184"/>
+         <source>StarDict Files (*.dict *dict.dz *.idx *idx.gz *.ifo)</source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="189"/>
+         <source>Dictionary file: %1</source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="230"/>
+         <source>File path is not set</source>
+         <translation type="unfinished"></translation>
+     </message>
+     <message>
+         <location filename="StarDialog.cpp" line="236"/>
+         <source>Dictionary files are not complete</source>
          <translation type="unfinished"></translation>
      </message>
  </context>
  <context>
-     <name>XdxfCachingDialog</name>
-     <message numerus="yes">
-         <source>%n second(s)</source>
-         <translation type="obsolete">
-             <numerusform>%n second</numerusform>
-             <numerusform>%n seconds</numerusform>
-         </translation>
+     <name>StarDictPlugin</name>
+     <message>
+         <location filename="StarDictPlugin.cpp" line="352"/>
+         <source>StarDict dictionary cannot be read from file</source>
+         <translation type="unfinished"></translation>
++>>>>>>> 7dd7dae9cc55a957c22cd4c3dd93d32d1deb5328
      </message>
  </context>
  </TS>
  <context>
      <name>StarDialog</name>
      <message>
-         <location filename="StarDialog.cpp" line="33"/>
+         <location filename="StarDialog.cpp" line="35"/>
          <source>Strip accents (searching takes more time, but spelling doesn&apos;t have to be exact)</source>
-         <translation type="unfinished">Usuń akcenty (wyszukiwanie trwa dłużej, ale szukane słowo nie musi być wpisane dokładnie)</translation>
+         <translation>Usuń akcenty (wyszukiwanie trwa dłużej, ale szukane słowo nie musi być wpisane dokładnie)</translation>
      </message>
- </context>
- <context>
-     <name>StarDictPlugin</name>
      <message>
-         <location filename="StarDictPlugin.cpp" line="353"/>
-         <source>StarDict dictionary cannot be read from file</source>
-         <translation type="unfinished"></translation>
+         <location filename="StarDialog.cpp" line="68"/>
+         <source>Add new StarDict dictionary</source>
+         <translation>Dodaj nowy słownik StarDict</translation>
      </message>
- </context>
- <context>
-     <name>XdxfCachingDialog</name>
      <message>
-         <source>Caching dictionary, please wait</source>
-         <translation type="obsolete">Optymalizacja słownika, proszę czekać</translation>
+         <location filename="StarDialog.cpp" line="71"/>
+         <source>Browse</source>
+         <translation>Przeglądaj</translation>
      </message>
      <message>
-         <source>Cancel</source>
-         <translation type="obsolete">Anuluj</translation>
+         <location filename="StarDialog.cpp" line="72"/>
+         <source>Dictionary file: not selected</source>
+         <translation>Plik ze słownikiem nie został wybrany</translation>
      </message>
      <message>
-         <source>Estimated time left: </source>
-         <translation type="obsolete">Pozostały czas: </translation>
+         <location filename="StarDialog.cpp" line="80"/>
+         <source>StarDict Settings</source>
+         <translation>Ustawienia StarDict</translation>
      </message>
-     <message numerus="yes">
-         <source>%n second(s)</source>
-         <translation type="obsolete">
-             <numerusform>%n sekunda</numerusform>
-             <numerusform>%n sekundy</numerusform>
-             <numerusform>%n sekund</numerusform>
-         </translation>
-     </message>
- </context>
- <context>
-     <name>XdxfDialog</name>
      <message>
-         <source>Optimize for quicker searches (may take some time)</source>
-         <translation type="obsolete">Optymalizuj dla szybszego wyszukiwania (może zająć trochę czasu)</translation>
+         <location filename="StarDialog.cpp" line="82"/>
+         <source>Plugin: </source>
+         <translation type="unfinished"></translation>
      </message>
      <message>
-         <source>Strip accents (searching takes more time, but spelling doesn&apos;t have to be exact)</source>
-         <translation type="obsolete">Usuń akcenty (wyszukiwanie trwa dłużej, ale szukane słowo nie musi być wpisane dokładnie)</translation>
+         <location filename="StarDialog.cpp" line="83"/>
+         <source>Book name: </source>
+         <translation>Słownik:</translation>
      </message>
      <message>
-         <source>Add new XDXF dictionary</source>
-         <translation type="obsolete">Dodaj nowy słownik XDXF</translation>
+         <location filename="StarDialog.cpp" line="85"/>
+         <source>Version: </source>
+         <translation>Wersja:</translation>
      </message>
      <message>
-         <source>Browse</source>
-         <translation type="obsolete">Przeglądaj</translation>
+         <location filename="StarDialog.cpp" line="86"/>
+         <source>Word count: </source>
+         <translation>Liczba słów:</translation>
      </message>
      <message>
-         <source>Dictionary file: not selected</source>
-         <translation type="obsolete">Plik ze słownikiem nie został wybrany</translation>
+         <location filename="StarDialog.cpp" line="88"/>
+         <source>Author: </source>
+         <translation>Autor:</translation>
      </message>
      <message>
-         <source>XDXF Settings</source>
-         <translation type="obsolete">Ustawienia XDXF</translation>
+         <location filename="StarDialog.cpp" line="89"/>
+         <source>E-mail: </source>
+         <translation type="unfinished"></translation>
      </message>
      <message>
-         <source>From: </source>
-         <translation type="obsolete">Z: </translation>
+         <location filename="StarDialog.cpp" line="90"/>
+         <source>Website: </source>
+         <translation>Strona:</translation>
      </message>
      <message>
-         <source>To: </source>
-         <translation type="obsolete">Na: </translation>
+         <location filename="StarDialog.cpp" line="91"/>
+         <source>Description: </source>
+         <translation>Opis:</translation>
      </message>
      <message>
-         <source>Description: </source>
-         <translation type="obsolete">Opis: </translation>
+         <location filename="StarDialog.cpp" line="93"/>
+         <source>Date: </source>
+         <translation>Data:</translation>
      </message>
      <message>
+         <location filename="StarDialog.cpp" line="98"/>
          <source>Strip accents</source>
 -        <translation>Usuń akcenty</translation>
 +        <translation type="obsolete">Usuń akcenty</translation>
 +    </message>
 +    <message>
 +        <source>Optimize</source>
 +        <translation type="obsolete">Optymalizuj</translation>
      </message>
      <message>
+         <location filename="StarDialog.cpp" line="137"/>
          <source>Add</source>
 -        <translation>Dodaj</translation>
 +        <translation type="obsolete">Dodaj</translation>
      </message>
      <message>
+         <location filename="StarDialog.cpp" line="140"/>
          <source>Save settings</source>
 -        <translation>Zapisz ustawienia</translation>
 +        <translation type="obsolete">Zapisz ustawienia</translation>
      </message>
      <message>
+         <location filename="StarDialog.cpp" line="182"/>
          <source>Select dictionary file</source>
 -        <translation>Wybierz plik ze słownikiem</translation>
 +        <translation type="obsolete">Wybierz plik ze słownikiem</translation>
      </message>
      <message>
-         <source>XDXF Files (*.xdxf)</source>
-         <translation type="obsolete">Pliki XDXF (*.xdxf)</translation>
+         <location filename="StarDialog.cpp" line="184"/>
+         <source>StarDict Files (*.dict *dict.dz *.idx *idx.gz *.ifo)</source>
+         <translation>Pliki StarDict (*.dict *dict.dz *.idx *idx.gz *.ifo)</translation>
      </message>
      <message>
+         <location filename="StarDialog.cpp" line="189"/>
          <source>Dictionary file: %1</source>
 -        <translation>Plik ze słownikiem: %1</translation>
 +        <translation type="obsolete">Plik ze słownikiem: %1</translation>
      </message>
      <message>
+         <location filename="StarDialog.cpp" line="230"/>
          <source>File path is not set</source>
 -        <translation>Ścieżka do pliku nie jest ustawiona</translation>
 +        <translation type="obsolete">Ścieżka do pliku nie jest ustawiona</translation>
      </message>
- </context>
- <context>
-     <name>XdxfPlugin</name>
-     <message>
-         <source>Cache database cannot be opened for %1 dictionary. Searching in XDXF file. You may want to recache.</source>
-         <translation type="obsolete">Nie można otworzyć bazy danych dla słownika %1. Szukanie w pliku XDXF. Możesz spróbować ponownie włączyć optymalizację.</translation>
-     </message>
-     <message>
-         <source>XDXF file cannot be read for %1</source>
-         <translation type="obsolete">Nie można odczytać pliku XDXF dla %1</translation>
-     </message>
      <message>
-         <source>XDXF file is in wrong format</source>
-         <translation type="obsolete">Niewłaściwy format pliku XDXF</translation>
-     </message>
-     <message>
-         <source>XDXF dictionary cannot be read from file</source>
-         <translation type="obsolete">Nie można odczytać słownika XDXF z pliku</translation>
-     </message>
-     <message>
-         <source>XDXF file cannot be read for %1 dictionary</source>
-         <translation type="obsolete">Nie mozna odczytać pliku XDXF dla słownika %1</translation>
+         <location filename="StarDialog.cpp" line="236"/>
+         <source>Dictionary files are not complete</source>
+         <translation>Brak części plików słownika</translation>
      </message>
+ </context>
+ <context>
+     <name>StarDictPlugin</name>
      <message>
-         <source>Database caching error, please try again.</source>
-         <translation type="obsolete">Błąd optymalizacji, proszę spróbować ponownie.</translation>
+         <location filename="StarDictPlugin.cpp" line="352"/>
+         <source>StarDict dictionary cannot be read from file</source>
+         <translation>Nie można odczytać słownika StarDict z pliku</translation>
      </message>
  </context>
  </TS>