QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
ComponentInformationTranslation Class Reference

#include <ComponentInformationTranslation.h>

+ Inheritance diagram for ComponentInformationTranslation:
+ Collaboration diagram for ComponentInformationTranslation:

Signals

void downloadComplete (QString translatedJsonTempFile, QString errorMsg)
 

Public Member Functions

 ComponentInformationTranslation (QObject *parent, QGCCachedFileDownload *cachedFileDownload)
 
bool downloadAndTranslate (const QString &summaryJsonFile, const QString &toTranslateJsonFile, int maxCacheAgeSec, const QString &componentName)
 
QString translateJsonUsingTS (const QString &toTranslateJsonFile, const QString &tsFile)
 

Detailed Description

Definition at line 13 of file ComponentInformationTranslation.h.

Constructor & Destructor Documentation

◆ ComponentInformationTranslation()

ComponentInformationTranslation::ComponentInformationTranslation ( QObject *  parent,
QGCCachedFileDownload cachedFileDownload 
)

Definition at line 15 of file ComponentInformationTranslation.cc.

Member Function Documentation

◆ downloadAndTranslate()

bool ComponentInformationTranslation::downloadAndTranslate ( const QString &  summaryJsonFile,
const QString &  toTranslateJsonFile,
int  maxCacheAgeSec,
const QString &  componentName 
)

Download translation file according to the currently set locale and translate the json file. emits downloadComplete() when done (with a temporary file that should be deleted)

Parameters
summaryJsonFilejson file with url's to translation files (.ts)
toTranslateJsonFilejson file to be translated
maxCacheAgeSecMaximum age of cached item in seconds
Returns
true: Asynchronous download has started, false: Download initialization failed

Definition at line 21 of file ComponentInformationTranslation.cc.

References QGCCachedFileDownload::download(), and QGCCachedFileDownload::finished().

◆ downloadComplete

void ComponentInformationTranslation::downloadComplete ( QString  translatedJsonTempFile,
QString  errorMsg 
)
signal

◆ translateJsonUsingTS()

QString ComponentInformationTranslation::translateJsonUsingTS ( const QString &  toTranslateJsonFile,
const QString &  tsFile 
)

Definition at line 105 of file ComponentInformationTranslation.cc.

References errorString, and JsonParsing::isJsonFile().


The documentation for this class was generated from the following files: