"
- "
"
- + tr("Please, remember to activate the device to use")
- + "
";
- }
-
- // TODO: requested new version to Semantix that returns empty string to avoid this check
- if(translatedWord.empty() || translatedWord.size() <= EMPTY_DICTIO_RESULT )
- return ""
- ""
- + tr("Couldn't find any result for the given word")
- + "
";
- else
- return QString::fromUtf8(translatedWord.c_str());
-}
-
-string
-Dictionary::getDictCode() const
-{
- QString dictSettingsCode = QBook::settings().value("setting/dictionary", "").toString();
-
- if(dictSettingsCode.isEmpty() || dictSettingsCode == "0")
- return "";
-
- return dictSettingsCode.toStdString();
-}
-
-QString Dictionary::getCurrentDictCode() const
-{
- QString dictSettingsCode = QBook::settings().value("setting/dictionary", "").toString();
-
- if(dictSettingsCode.isEmpty() || dictSettingsCode == "0")
- return "";
-
- return dictSettingsCode;
-}
-
-QByteArray Dictionary::getJsonDictionaries() const
-{
- qDebug() << Q_FUNC_INFO;
-
- if (!initialized)
- return tr("You need to link the device to see available dictionaries").toAscii();
-
- //QByteArray dictsJson = "{\"dictionaries\":[{\"id\":\"000200\",\"commercialName\":\"Definiciones Inglés\",\"shortName\":\"wordne\"},{\"id\":\"000300\",\"commercialName\":\"Semantix Inglés-Español\",\"shortName\":\"semEnEs\"},{\"id\":\"000400\",\"commercialName\":\"Semantix Español-Inglés\",\"shortName\":\"semEsEn\"},{\"id\":\"001000\",\"commercialName\":\"Definiciones Español\",\"shortName\":\"clave\"},{\"id\":\"001300\",\"commercialName\":\"Semantix Inglés básico\",\"shortName\":\"simple\"}]}";
- //return dictsJson;
-
- return QString::fromStdString(getWorkingDictionariesEx()).toAscii();
-}
-
-QByteArray Dictionary::getJsonAvailableDicts() const
-{
- qDebug() << Q_FUNC_INFO;
-
- if (!initialized)
- return tr("You need to link the device to see available dictionaries").toAscii();
-
- bqDeviceServices* services = QBookApp::instance()->getDeviceServices();
- QByteArray availableDictsJson = services->getDictionaries().toAscii();
- qDebug() << Q_FUNC_INFO << "availableDictsJson: " << availableDictsJson;
- return availableDictsJson;
-}
-
-QMap