diff --git a/src/modules/shellprocess/ShellProcessJob.cpp b/src/modules/shellprocess/ShellProcessJob.cpp index ab00a0bdd..6e3db62aa 100644 --- a/src/modules/shellprocess/ShellProcessJob.cpp +++ b/src/modules/shellprocess/ShellProcessJob.cpp @@ -34,6 +34,10 @@ ShellProcessJob::~ShellProcessJob() {} QString ShellProcessJob::prettyName() const { + if ( m_name ) + { + return m_name->get(); + } return tr( "Shell Processes Job" ); } @@ -75,6 +79,16 @@ ShellProcessJob::setConfigurationMap( const QVariantMap& configurationMap ) { cWarning() << "No script given for ShellProcessJob" << moduleInstanceKey(); } + + bool labels_ok = false; + auto labels = CalamaresUtils::getSubMap( configurationMap, "i18n", labels_ok ); + if ( labels_ok ) + { + if ( labels.contains( "name" ) ) + { + m_name = std::make_unique< CalamaresUtils::Locale::TranslatedString >( labels, "name" ); + } + } } CALAMARES_PLUGIN_FACTORY_DEFINITION( ShellProcessJobFactory, registerPlugin< ShellProcessJob >(); ) diff --git a/src/modules/shellprocess/ShellProcessJob.h b/src/modules/shellprocess/ShellProcessJob.h index 468aded59..a931d1e1a 100644 --- a/src/modules/shellprocess/ShellProcessJob.h +++ b/src/modules/shellprocess/ShellProcessJob.h @@ -13,6 +13,7 @@ #include "CppJob.h" #include "DllMacro.h" +#include "locale/TranslatableConfiguration.h" #include "utils/CommandList.h" #include "utils/PluginFactory.h" @@ -37,6 +38,7 @@ public: private: std::unique_ptr< CalamaresUtils::CommandList > m_commands; + std::unique_ptr< CalamaresUtils::Locale::TranslatedString > m_name; }; CALAMARES_PLUGIN_FACTORY_DECLARATION( ShellProcessJobFactory ) diff --git a/src/modules/shellprocess/shellprocess.conf b/src/modules/shellprocess/shellprocess.conf index 44b6d145a..5d8a12d26 100644 --- a/src/modules/shellprocess/shellprocess.conf +++ b/src/modules/shellprocess/shellprocess.conf @@ -37,6 +37,8 @@ # be obtained with a single string and a global timeout, but when # there are multiple commands to execute, one of them might have # a different timeout than the others. +# +# To change the description of the job, set the *name* entries in *i18n*. --- dontChroot: false timeout: 10 @@ -63,3 +65,15 @@ script: - "/usr/bin/true" - command: "/usr/local/bin/slowloris" timeout: 3600 + +# You can change the description of the job (as it is displayed in the +# progress bar during installation) by defining an *i18n* key, which +# has a *name* field and optionally, translations as *name[lang]*. +# +# Without a translation here, the default name from the source code +# is used, "Shell Processes Job". +# +# i18n: +# name: "Shell process" +# name[nl]: "Schelpenpad" +# name[en_GB]: "Just a moment"