digiKam Developer Documentation: Digikam::DOnlineTranslatorOption Struct Reference

| digiKam Developer Documentation Professional Photo Management with the Power of Open Source

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Digikam::DOnlineTranslatorOption Struct Reference

Contains translation options for a single word. More...

## Public Member Functions
QJsonObject | toJson () const
| Converts the object to JSON.

## Public Attributes
QString | gender
| Gender of the word.
QStringList | translations
| Associated translations for the word.
QString | word
| Word that specified for translation options.

## Detailed Description

Can be obtained from the QOnlineTranslator object.

Example:

QOnlineTranslator translator;
// Obtain translation
QTextStream out(stdout);
for (auto it = translator.translationOptions().cbegin() ; it != translator.translationOptions().cend() ; ++it)
{
out << it.key() << ":" << endl; // Output the type of speech with a colon
for (const auto &[word, gender, translations] : it.value())
{
out << " " << word << ": "; // Print the word
out << translations; // Print translations
out << endl;
}
out << endl;
}

Possible output:

// verb:
// sagen: say, tell, speak, mean, utter
// sprechen: speak, talk, say, pronounce, militate, discourse
// meinen: think, mean, believe, say, opine, fancy
// heißen: mean, be called, be named, bid, tell, be titled
// äußern: express, comment, speak, voice, say, utter
// aussprechen: express, pronounce, say, speak, voice, enunciate
// vorbringen: make, put forward, raise, say, put, bring forward
// aufsagen: recite, say, speak
// noun:
// Sagen: say
// Mitspracherecht: say

## Member Function Documentation

## ◆ toJson()

QJsonObject Digikam::DOnlineTranslatorOption::toJson | ( |  | ) | const
| inline

Returns
  JSON representation