Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Adam <dev@robert-adam.de>2021-03-03 19:07:09 +0300
committerRobert Adam <dev@robert-adam.de>2021-03-12 13:57:52 +0300
commit8d1d77772ef0169a2e8eba81138f372df6d84632 (patch)
tree706c2b66b92f675ec51a358088674da7a45e7e79 /src
parent89ae4361d57886ba534a477cdbc4fce1556183e4 (diff)
FEAT(client): Add option to print translation dirs
In order to figure out where Mumble _really_ tries to look for translation files (*.qm) on the local disk, this commit adds an option that will cause Mumble to print out the list of directories it will search (in order).
Diffstat (limited to 'src')
-rw-r--r--src/mumble/main.cpp25
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 &currentTranslationDir : 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