diff --git a/changelog/unreleased/11300 b/changelog/unreleased/11300 new file mode 100644 index 00000000000..94f935affe5 --- /dev/null +++ b/changelog/unreleased/11300 @@ -0,0 +1,10 @@ +Change: Make messages translatable that occur early in start-up + +These messages include the command-line messages (both errors and the +help text). To do this, the deprecated `--confdir` option has been +removed. This option was only used on windows before roaming profiles +were supported. + +https://github.com/owncloud/client/issues/11142 +https://github.com/owncloud/client/issues/11246 +https://github.com/owncloud/client/pull/11300 diff --git a/src/gui/main.cpp b/src/gui/main.cpp index c42fee6b949..1629f0ea91b 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -94,9 +94,9 @@ CommandLineOptions parseOptions(const QStringList &arguments) QString descriptionText; QTextStream descriptionTextStream(&descriptionText); - descriptionTextStream - << QStringLiteral("%1 version %2\r\nFile synchronization desktop utility.").arg(Theme::instance()->appName(), OCC::Version::displayString()) - << Qt::endl; + descriptionTextStream << QApplication::translate("CommandLine", "%1 version %2\r\nFile synchronization desktop utility.") + .arg(Theme::instance()->appName(), OCC::Version::displayString()) + << Qt::endl; if (Theme::instance()->appName() == QLatin1String("ownCloud")) { descriptionTextStream @@ -116,24 +116,26 @@ CommandLineOptions parseOptions(const QStringList &arguments) return option; }; - auto showSettingsLegacyOption = QCommandLineOption{{QStringLiteral("showsettings")}, QStringLiteral("Hidden legacy option")}; + auto showSettingsLegacyOption = QCommandLineOption{{QStringLiteral("showsettings")}, QApplication::translate("CommandLine", "Hidden legacy option")}; showSettingsLegacyOption.setFlags(QCommandLineOption::HiddenFromHelp); parser.addOption(showSettingsLegacyOption); auto showOption = addOption({{QStringLiteral("s"), QStringLiteral("show")}, - QStringLiteral( + QApplication::translate("CommandLine", "Start with the main window visible, or if it is already running, bring it to the front. By default, the client launches in the background.")}); - auto quitInstanceOption = addOption({{QStringLiteral("q"), QStringLiteral("quit")}, QStringLiteral("Quit the running instance.")}); - auto logFileOption = addOption({QStringLiteral("logfile"), QStringLiteral("Write log to file (use - to write to stdout)."), QStringLiteral("filename")}); - auto logDirOption = addOption({QStringLiteral("logdir"), QStringLiteral("Write each sync log output in a new file in folder."), QStringLiteral("name")}); - auto logFlushOption = addOption({QStringLiteral("logflush"), QStringLiteral("Flush the log file after every write.")}); - auto logDebugOption = addOption({QStringLiteral("logdebug"), QStringLiteral("Output debug-level messages in the log.")}); - auto debugOption = addOption({QStringLiteral("debug"), QStringLiteral("Enable debug mode.")}); - addOption({QStringLiteral("cmd"), QStringLiteral("Forward all arguments to the cmd client. This argument must be the first.")}); + auto quitInstanceOption = addOption({{QStringLiteral("q"), QStringLiteral("quit")}, QApplication::translate("CommandLine", "Quit the running instance.")}); + auto logFileOption = addOption( + {QStringLiteral("logfile"), QApplication::translate("CommandLine", "Write log to file (use - to write to stdout)."), QStringLiteral("filename")}); + auto logDirOption = addOption( + {QStringLiteral("logdir"), QApplication::translate("CommandLine", "Write each sync log output in a new file in folder."), QStringLiteral("name")}); + auto logFlushOption = addOption({QStringLiteral("logflush"), QApplication::translate("CommandLine", "Flush the log file after every write.")}); + auto logDebugOption = addOption({QStringLiteral("logdebug"), QApplication::translate("CommandLine", "Output debug-level messages in the log.")}); + auto debugOption = addOption({QStringLiteral("debug"), QApplication::translate("CommandLine", "Enable debug mode.")}); + addOption({QStringLiteral("cmd"), QApplication::translate("CommandLine", "Forward all arguments to the cmd client. This argument must be the first.")}); // virtual file system parameters (optional) - parser.addPositionalArgument( - QStringLiteral("vfs file"), QStringLiteral("Virtual file system file to be opened (optional)."), {QStringLiteral("[]")}); + parser.addPositionalArgument(QStringLiteral("vfs file"), QApplication::translate("CommandLine", "Virtual file system file to be opened (optional)."), + {QStringLiteral("[]")}); parser.process(arguments); @@ -149,7 +151,7 @@ CommandLineOptions parseOptions(const QStringList &arguments) } if (parser.isSet(logDirOption)) { if (parser.isSet(logFileOption)) { - displayHelpText(QStringLiteral("--logfile and --logdir are mutually exclusive")); + displayHelpText(QApplication::translate("CommandLine", "--logfile and --logdir are mutually exclusive")); std::exit(1); } out.logDir = parser.value(logDirOption);