diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mumble/main.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mumble/main.cpp b/src/mumble/main.cpp index bad20b746..587e84b25 100644 --- a/src/mumble/main.cpp +++ b/src/mumble/main.cpp @@ -224,6 +224,7 @@ int main(int argc, char **argv) { bool suppressIdentity = false; bool customJackClientName = false; bool bRpcMode = false; + bool printTranslationDirs = false; QString rpcCommand; QUrl url; QStringList extraTranslationDirs; @@ -281,6 +282,10 @@ int main(int argc, char **argv) { " the bundled ones\n" " Directories added this way have higher priority than\n" " the default locations used otherwise\n" + " --print-translation-dirs\n" + " Print out the paths in which Mumble will search for\n" + " translation files that overwrite the bundled ones.\n" + " (Useful for translators testing their translations)\n" "\n"); QString rpcHelpBanner = MainWindow::tr("Remote controlling Mumble:\n" "\n"); @@ -369,6 +374,8 @@ int main(int argc, char **argv) { Global::get().bDebugDumpInput = true; } else if (args.at(i) == QLatin1String("--print-echocancel-queue")) { Global::get().bDebugPrintQueue = true; + } else if (args.at(i) == "--print-translation-dirs") { + printTranslationDirs = true; } else if (args.at(i) == "--translation-dir") { if (i + 1 < args.count()) { extraTranslationDirs.append(args.at(i + 1)); @@ -412,6 +419,24 @@ int main(int argc, char **argv) { extraTranslationDirs.append(QDir::cleanPath(currentHomePath + QDir::separator() + "MumbleTranslations")); } + if (printTranslationDirs) { + QString infoString = QObject::tr("The directories in which Mumble searches for extra translation files are:\n"); + + int counter = 1; + for (const QString ¤tTranslationDir : extraTranslationDirs) { + infoString += QString::fromLatin1("%1. ").arg(counter) + currentTranslationDir + "\n"; + counter++; + } + +#if defined(Q_OS_WIN) + QMessageBox::information(nullptr, QObject::tr("Invocation"), infoString); +#else + printf("%s", qUtf8Printable(infoString)); +#endif + + return 0; + } + #ifdef USE_DBUS # ifdef Q_OS_WIN // By default, windbus expects the path to dbus-daemon to be in PATH, and the path |