I would suggest two ways of doing it:
First would be declaring special translator field like:
tr("__LANGNAME__")
that would be in every translation file filled with proper language name (even native). Then you could list all available translations, load them one by one and use QTranslator::translate(const char * context, const char * sourceText, const char * disambiguation = 0)
method.
Example:
QStringList availableLanguages;
QDirIterator qmIt(pathToQm, QStringList() << "*.qm", QDir::Files);
while(qmIt.hasNext())
{
qmIt.next();
QFileInfo finfo = qmIt.fileInfo();
QTranslator translator;
translator.load(finfo.baseName(), pathToQm);
availableLanguages << translator.translate("__LANGNAME__");
}
qDebug() << availableLanguages;
My second aproach would be with QLocale and QLocale::Language. I would create QLocale object for each base name of file in qm dir, and then use QLocale::Language enum to get language name with QLocale::languageToString
method.