Skip to content

Commit d5c141f

Browse files
committed
qt: apply translator comments to reset options confirmation dialog
Follow-up to #617. This applies translator strings to the reset options confirmation dialog and also refactors the way we pass the strings to the dialog in order to allow the comments to be applied. Because the strings were being concatenated, we can not apply translator comments to all of the relevant strings. What we want to do instead is have a variable in which the translatable strings are appended to using the QString append function. This satisfies the Qt translator engine and the comments are then properly applied within the `extracomment` field in the translation file.
1 parent 5bc10b3 commit d5c141f

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/qt/optionsdialog.cpp

+12-4
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,19 @@ void OptionsDialog::on_resetButton_clicked()
286286
{
287287
if (model) {
288288
// confirmation dialog
289+
/*: Text explaining that the settings changed will not come into effect
290+
until the client is restarted. */
291+
QString reset_dialog_text = tr("Client restart required to activate changes.") + "<br><br>";
292+
/*: Text explaining to the user that the client's current settings
293+
will be backed up at a specific location. %1 is a stand-in
294+
argument for the backup location's path. */
295+
reset_dialog_text.append(tr("Current settings will be backed up at \"%1\".").arg(m_client_model->dataDir()) + "<br><br>");
296+
/*: Text asking the user to confirm if they would like to proceed
297+
with a client shutdown. */
298+
reset_dialog_text.append(tr("Client will be shut down. Do you want to proceed?"));
299+
//: Window title text of pop-up window shown when the user has chosen to reset options.
289300
QMessageBox::StandardButton btnRetVal = QMessageBox::question(this, tr("Confirm options reset"),
290-
tr("Client restart required to activate changes.") + "<br><br>" +
291-
tr("Current settings will be backed up at \"%1\".").arg(m_client_model->dataDir()) + "<br><br>" +
292-
tr("Client will be shut down. Do you want to proceed?"),
293-
QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
301+
reset_dialog_text, QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
294302

295303
if (btnRetVal == QMessageBox::Cancel)
296304
return;

0 commit comments

Comments
 (0)