MCPcopy Create free account
hub / github.com/QNapi/qnapi / printHelpLanguages

Method printHelpLanguages

gui/src/qnapicli.cpp:384–413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384void QNapiCli::printHelpLanguages() {
385 printCli(
386 tr("List of languages recognized by QNapi, including corresponding"));
387 printCli(tr("two-letter language codes:"));
388 printCli();
389
390 SubtitleLanguage L, LB;
391 QStringList langs = L.listLanguages();
392
393 foreach (QString lang, langs) {
394 L.setLanguage(lang);
395 printCli(QString(" %1 - %2").arg(L.toTwoLetter()).arg(lang));
396 }
397
398 L.setLanguage(config.generalConfig().language());
399 LB.setLanguage(config.generalConfig().backupLanguage());
400
401 printCli();
402 printCli(tr("Current default subtitles language: %1 (%2)")
403 .arg(L.toFullName())
404 .arg(L.toTwoLetter()));
405
406 if (LB.toFullName().isEmpty()) {
407 printCli(tr("No alternative subtitles language has been set"));
408 } else {
409 printCli(tr("Current alternative subtitles language: %1 (%2)")
410 .arg(LB.toFullName())
411 .arg(LB.toTwoLetter()));
412 }
413}
414
415void QNapiCli::printCli(const QString &string) {
416 if (mode != CM_QUIET) std::cout << string.toStdString() << std::endl;

Callers

nothing calls this directly

Calls 7

listLanguagesMethod · 0.80
languageMethod · 0.80
generalConfigMethod · 0.80
backupLanguageMethod · 0.80
toFullNameMethod · 0.80
toTwoLetterMethod · 0.80
setLanguageMethod · 0.45

Tested by

no test coverage detected