db.setDatabaseName(cacheFilePath);
if(!db.open()) {
qDebug() << "Database error" << db.lastError().text() << endl;
- Q_EMIT notify(Notify::Warning, QString("Cache database cannot be "
+ Q_EMIT notify(Notify::Warning, QString(tr("Cache database cannot be "
"opened for %1 dictionary. Searching in xdxf file. "
- "You may want to recache.").arg(name()));
+ "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("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("Cache database cannot be "
+ Q_EMIT notify(Notify::Warning, QString(tr("Cache database cannot be "
"opened for %1 dictionary. Searching in xdxf file. "
- "You may want to recache.").arg(name()));
+ "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("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 "";
}
while(reader.name()!="ar" && !reader.atEnd()) {
if(reader.name()!="" && reader.name()!="k") {
if(reader.tokenType()==QXmlStreamReader::EndElement)
- temp+=tr("</");
+ temp+="</";
if(reader.tokenType()==QXmlStreamReader::StartElement)
- temp+=tr("<");
+ temp+="<";
temp+=reader.name().toString();
if(reader.name().toString()=="c" &&
reader.tokenType()==QXmlStreamReader::StartElement)
- temp= temp + tr(" c=\"") + reader.attributes().
- value(tr("c")).toString() + tr("\"");
- temp+=tr(">");
+ temp= temp + " c=\"" + reader.attributes().
+ value("c").toString() + "\"";
+ temp+=">";
}
temp+= reader.text().toString().replace("<","<").
replace(">",">");
}
if(temp.at(0)==QChar('\n'))
temp.remove(0,1);
- resultString+=tr("<key>") + a +tr("</key>");
- resultString+=tr("<t>") + temp + tr("</t>");
+ resultString+="<key>" + a +"</key>";
+ resultString+="<t>" + temp + "</t>";
match=false;
}
this->thread()->yieldCurrentThread();
QFile dictionaryFile(path);
if(!dictionaryFile.open(QFile::ReadOnly | QFile::Text)) {
Q_EMIT notify(Notify::Warning,
- QString("Xdxf file cannot be read dictionary"));
+ QString(tr("Xdxf file cannot be read dictionary")));
qDebug()<<"Error: could not open file";
return;
}
_infoNote=reader.readElementText();
QString format = "png";
- QString initialPath = QDir::currentPath() + tr("/xdxf.") + format;
+ QString initialPath = QDir::currentPath() + "/xdxf." + format;
_infoNote="path=\""+initialPath+"\"> \n" + _name + " [" + _langFrom + "-" + _langTo + "] (" + _type + ")";
dictionaryFile.close();
QFile dictionaryFile(path);
if(!dictionaryFile.open(QFile::ReadOnly | QFile::Text)) {
Q_EMIT notify(Notify::Warning,
- QString("Xdxf file cannot be read for %1 dictionary")
- .arg(name()));
+ 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("Xdxf file cannot be read for %1 dictionary")
- .arg(name()));
+ QString(tr("Xdxf file cannot be read for %1 dictionary")
+ .arg(name())));
return 0;
}
QXmlStreamReader reader(&dictionaryFile);
if(!db.open()) {
qDebug() << "Database error" << db.lastError().text() << endl;
Q_EMIT updateCachingProgress(100, 0);
- Q_EMIT notify(Notify::Warning, QString("Cache database cannot be "
+ Q_EMIT notify(Notify::Warning, QString(tr("Cache database cannot be "
"opened for %1 dictionary. Searching in xdxf file. "
- "You may want to recache.").arg(name()));
+ "You may want to recache.").arg(name())));
return false;
}
QCoreApplication::processEvents();
cur.exec("PRAGMA synchronous = 0");
cur.exec("drop table dict");
QCoreApplication::processEvents();
- cur.exec("create table dict(word text, normalized text ,translation text)");
+ cur.exec("create table dict(word text, normalized text ,tanslation text)");
int counter = 0;
cur.exec("BEGIN;");
while(reader.name()!="ar" && !reader.atEnd()) {
if(reader.name()!="" && reader.name()!="k") {
if(reader.tokenType()==QXmlStreamReader::EndElement)
- temp+=tr("</");
+ temp+="</";
if(reader.tokenType()==QXmlStreamReader::StartElement)
- temp+=tr("<");
+ temp+="<";
temp+=reader.name().toString();
if(reader.name().toString()=="c" && reader.tokenType()==QXmlStreamReader::StartElement)
- temp= temp + tr(" c=\"") + reader.attributes().value(tr("c")).toString() + tr("\"");
- temp+=tr(">");
+ temp= temp + " c=\"" + reader.attributes().value("c").toString() + "\"";
+ temp+=">";
}
temp+= reader.text().toString().replace("<","<").replace(">",">");;
reader.readNext();
}
if(temp.at(0)==QChar('\n'))
temp.remove(0,1);
- temp=tr("<key>") + a + tr("</key>") + tr("<t>") + temp+ tr("</t>");
+ temp="<key>" + a + "</key>" + "<t>" + temp+ "</t>";
match=false;
cur.prepare("insert into dict values(?,?,?)");
cur.addBindValue(a);
{
Q_EMIT updateCachingProgress(100, timer.restart());
Q_EMIT notify(Notify::Warning,
- QString("Database caching error, please try againg."));
+ QString(tr("Database caching error, please try againg.")));
db.close();
return false;
}