--- /dev/null
+<RCC>
+ <qresource prefix="/">
+ <file>icons/logo/mdictionary.png</file>
+ <file>icons/96x96/staron.png</file>
+ <file>icons/96x96/staroff.png</file>
+ <file>icons/64x64/mdictionary.png</file>
+ <file>icons/48x48/edit-select-all.png</file>
+ <file>icons/16x16/staron.png</file>
+ <file>icons/16x16/staroff.png</file>
+ <file>translations/dict_pl.qm</file>
+ <file>translations/dict_en.qm</file>
+ </qresource>
+</RCC>
+++ /dev/null
-<RCC>
- <qresource prefix="/icons">
- <file>48x48/edit-select-all.png</file>
- <file>logo/mdictionary.png</file>
- <file>96x96/staroff.png</file>
- <file>96x96/staron.png</file>
- <file>16x16/staroff.png</file>
- <file>16x16/staron.png</file>
- <file>64x64/mdictionary.png</file>
- </qresource>
-</RCC>
QT += sql
TEMPLATE = subdirs
SUBDIRS = trunk
+TRANSLATIONS += dict_pl.ts dict_en.ts
BINDIR = $$PREFIX/bin
LIBDIR = $$PREFIX/lib/$${MDICT_APPNAME}
../includes/Notify.h \
gui/TranslationTextEdit.h \
../includes/AccentsNormalizer.h \
+ ../includes/DictDialog.h
../includes/DictDialog.h \
gui/DBusAdapter.h \
gui/NotifyManager.h
-RESOURCES += ../../../data/icons/gui.qrc
+
+RESOURCES += ../../../data/gui.qrc
unix {
# VARIABLES
isEmpty(PREFIX):PREFIX = /usr
{
QString infoNote, licenseNote, comarchNote;
infoNote = "<center><h2><u>mDictionary</u></h2></center>";
- comarchNote = "<center>Meamo/Meego Mulitlingual Dictionary</center>";
+ comarchNote = "<center>Meamo/Meego Multilingual Dictionary</center>";
comarchNote += "<center>Copyright 2006-2010, Comarch S.A. <br>";
comarchNote += "<a href=\"http://mdictionary.garage.maemo.org\">http://mdictionary.garage.maemo.org</a></center>";
licenseNote = QString("<br><p><font size=\"small\">This program is free software: you can redistribute it and/or modify\n")+
if(_save) {
#else
if(_changed &&
- QMessageBox::question(this, "Save", "Do you want to save changes?",
+ QMessageBox::question(this, tr("Save"), tr("Do you want to save changes?"),
QMessageBox::Save, QMessageBox::Cancel) == QMessageBox::Save) {
#endif
QList<CommonDictInterface*> checkedDicts;
}
void DictManagerWidget::removeButtonClicked() {
- if(QMessageBox::question(this, "Remove dictionary",
- "Do you want to remove selected dictionary?",
+ if(QMessageBox::question(this, tr("Remove dictionary"),
+ tr("Do you want to remove selected dictionary?"),
QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok) {
QList<QListWidgetItem*> selected = dictListWidget->selectedItems();
if(selected.count() > 0) {
#else
par = this;
#endif
- if(QMessageBox::question(par, "Delete all bookmarks",
- "Do you want to delete all bookmarks? (This action cannot be revoked)",
+ if(QMessageBox::question(par, tr("Delete all bookmarks"),
+ tr("Do you want to delete all bookmarks? (This action cannot be revoked)"),
QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok) {
backbone->removeAllBookmarks();
if(searchString.size())
if(settings && _save) {
#else
if(settings && _changed &&
- QMessageBox::question(this, "Save", "Do you want to save changes?",
+ QMessageBox::question(this, tr("Save"), tr("Do you want to save changes?"),
QMessageBox::Save, QMessageBox::Cancel) == QMessageBox::Save) {
#endif
QApplication::setOrganizationDomain("comarch.com");
QApplication::setApplicationName("mDictionary");
-
QStringList search = parseParameters(argc, argv);
qRegisterMetaType<Translation*>("Translation*");
qRegisterMetaType<QList<Translation*> >("QList<Translation*>");
qRegisterMetaType<Notify>("Notify");
qRegisterMetaType<Notify::NotifyType>("Notify::NotifyType");
+
+ QString locale = QLocale::system().name();
+
+ QTranslator qtTranslator;
+ qtTranslator.load("qt_" + QLocale::system().name(),
+ QLibraryInfo::location(QLibraryInfo::TranslationsPath));
+ a.installTranslator(&qtTranslator);
+
+ QTranslator myTranslator;
+ if(locale == "pl_PL")
+ myTranslator.load(":/translations/dict_pl");
+ else
+ myTranslator.load(":/translations/dict_en");
+ a.installTranslator(&myTranslator);
+
Backbone backbone;
MainWindow w(&backbone);
/*!
Shows settings dialog and save new settings in plugin
- \param parent parent widget on which will be displayed dialog
+ \param parent parent widget on which dialog will be displayed
*/
void changeSettings(QWidget *parent);
//! returns destination language code iso 639-2
QString langTo() const;
- //! returns dictionary name (like "old english" or so)
+ //! returns dictionary name (like "old English" or so)
QString name() const;
//! returns dictionary type (xdxf, google translate, etc)
void setLangFrom(QString langFrom);
/*! returns DictDialog object that creates dialogs
- for adding new dictionary and change plugin tings
+ for adding new dictionaries and changing plugin things
*/
DictDialog* dictDialog();
//! returns a unique hash for a dictionary
uint hash() const;
- //! set unique value (unique for every dictionary not plugin)
+ //! sets unique value (unique for every dictionary not plugin)
void setHash(uint);
//! returns current plugin settings
langFromLabel = new QLabel(tr("From:"));
langToLabel = new QLabel(tr(" To: "));
- connectInfoLabel = new QLabel(tr("Google plugin make use of internet "
- "conection, so it may cost You."));
+ connectInfoLabel = new QLabel(tr("Google plugin makes use of Internet "
+ "connection, so it may cost You."));
connectInfoLabel->setWordWrap(true);
setWindowTitle(tr("Google Settings"));
setLayout(verticalLayout);
infoLabel = new QLabel;
- infoLabel->setText(tr("Plugin:GoogleTranslator \n")+
+ infoLabel->setText(tr("Plugin: GoogleTranslator \n")+
tr("From: ") + _langFrom + "\n" +
tr("To: ") + _langTo);
verticalLayout->addWidget(infoLabel);
*******************************************************************************/
/*! \file GoogleSettingsDialog.h
- \brief Class create dialog to get or change settings for Google Plagin
+ \brief Class creates dialog to get or change settings for Google Plugin
\author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
*/
QString acceptButtonLabel = tr("Add"));
/*!
- \param parent parent widget on which will be displayed dialog
- \param langTo language witch is display in the comboBox as a startup item
- \param langFrom language witch is display in the comboBox as a startup item
+ \param parent parent widget on which dialog will be displayed
+ \param langTo language which is displayed in the comboBox as a startup item
+ \param langFrom language which is displayed in the comboBox as a startup item
\returns function return settings to GooglePlugin
*/
static Settings* getSettings(QWidget *parent,
Settings *pluginSettings=0,
QString acceptButtonLabel = tr("Add"));
/*!
- function set a new settings in plugin;
+ function sets a new settings in plugin;
\param plugin plugin whose settings you will change
- \param parent parent widget on which will be displayed dialog
+ \param parent parent widget on which dialog will be displayed
*/
static void changeSettings(GooglePlugin* plugin, QWidget *parent);
//! sets information about dictionary
void setDictionaryInfo(QString);
- //! \retrun whether given translation is taken from bookmarks
+ //! \return whether given translation is taken from bookmarks
bool isBookmark() const {
return _bookmark;
}
int seconds = float((100 - progress)*time) / (5*1000);
cachingLabel->setText(tr("Estimated time left: ") +
- QString::number(seconds) + tr(" seconds"));
+ /*QString::number(seconds)*/ tr("%n second(s)", "", seconds));
if(progress >= 100)
this->hide();
infoLabel = new QLabel(this);
- infoLabel->setText(tr("Plugin type: ") + plugin->type() +"\n" +
+ infoLabel->setText(tr("Plugin: ") + plugin->type().toUpper() +"\n" +
tr("From: ") + plugin->langFrom() + "\n" +
tr("To: ") + plugin->langTo() + "\n" +
tr("Description: ") + plugin->name());
if(!db.open()) {
qDebug() << "Database error" << db.lastError().text() << endl;
Q_EMIT notify(Notify::Warning, QString(tr("Cache database cannot be "
- "opened for %1 dictionary. Searching in xdxf file. "
+ "opened for %1 dictionary. Searching in XDXF file. "
"You may want to recache.").arg(name())));
return searchWordListFile(word, limit);
}
if(!dictionaryFile.open(QFile::ReadOnly | QFile::Text)) {
qDebug()<<"Error: could not open file";
Q_EMIT notify(Notify::Warning,
- QString(tr("Xdxf file cannot be read for %1").arg(name())));
+ QString(tr("XDXF file cannot be read for %1").arg(name())));
return translations.toList();
}
if(!db.open()) {
qDebug() << "Database error" << db.lastError().text() << endl;
Q_EMIT notify(Notify::Warning, QString(tr("Cache database cannot be "
- "opened for %1 dictionary. Searching in xdxf file. "
+ "opened for %1 dictionary. Searching in XDXF file. "
"You may want to recache.").arg(name())));
return searchFile(key);
}
QString resultString("");
if(!dictionaryFile.open(QFile::ReadOnly | QFile::Text)) {
Q_EMIT notify(Notify::Warning,
- QString(tr("Xdxf file cannot be read for %1").arg(name())));
+ QString(tr("XDXF file cannot be read for %1").arg(name())));
qDebug()<<"Error: could not open file";
return "";
}
QFile dictionaryFile(path);
if(!dictionaryFile.open(QFile::ReadOnly | QFile::Text)) {
Q_EMIT notify(Notify::Warning,
- QString(tr("Xdxf file cannot be read dictionary")));
+ QString(tr("XDXF dictionary cannot be read from file")));
qDebug()<<"Error: could not open file";
return;
}
QFile dictionaryFile(path);
if(!dictionaryFile.open(QFile::ReadOnly | QFile::Text)) {
Q_EMIT notify(Notify::Warning,
- QString(tr("Xdxf file cannot be read for %1 dictionary")
+ QString(tr("XDXF file cannot be read for %1 dictionary")
.arg(name())));
qDebug()<<"Error: could not open file";
return -1;
if (!dictionaryFile.open(QFile::ReadOnly | QFile::Text)) {
Q_EMIT updateCachingProgress(100, 0);
Q_EMIT notify(Notify::Warning,
- QString(tr("Xdxf file cannot be read for %1 dictionary")
+ QString(tr("XDXF file cannot be read for %1 dictionary")
.arg(name())));
return 0;
}
qDebug() << "Database error" << db.lastError().text() << endl;
Q_EMIT updateCachingProgress(100, 0);
Q_EMIT notify(Notify::Warning, QString(tr("Cache database cannot be "
- "opened for %1 dictionary. Searching in xdxf file. "
+ "opened for %1 dictionary. Searching in XDXF file. "
"You may want to recache.").arg(name())));
return false;
}