This is a followup to #617. Because the strings were being concatenated, we can not apply translator comments to all of the revelant strings. This can be tested by applying the following diff to current master and running make translate
; then check the resulting diff:
0diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
1index 462b923d6..3cf165004 100644
2--- a/src/qt/optionsdialog.cpp
3+++ b/src/qt/optionsdialog.cpp
4@@ -286,9 +286,17 @@ void OptionsDialog::on_resetButton_clicked()
5 {
6 if (model) {
7 // confirmation dialog
8+ //: Window title text of pop-up window shown when the user has chosen to reset options.
9 QMessageBox::StandardButton btnRetVal = QMessageBox::question(this, tr("Confirm options reset"),
10+ /*: Text explaining that the settings the user changed will not come
11+ into effect until the client is restarted. */
12 tr("Client restart required to activate changes.") + "<br><br>" +
13+ /*: Text explaining to the user that the client's current settings
14+ will be backed up at a specific location. %1 is a stand-in
15+ argument for the backup location's path. */
16 tr("Current settings will be backed up at \"%1\".").arg(m_client_model->dataDir()) + "<br><br>" +
17+ /*: Text asking the user to confirm if they would like to proceed
18+ with a client shutdown. */
19 tr("Client will be shut down. Do you want to proceed?"),
20 QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
To apply the above translator comments, what we want to do instead is have a variable in which the translatable strings are appended to using the QString append function.
When you run make translate
with this PR, you will see the translator comments properly applied, as shown below:
0diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts
1index 35d820187..9e5158b3e 100644
2--- a/src/qt/locale/bitcoin_en.ts
3+++ b/src/qt/locale/bitcoin_en.ts
4@@ -1942,28 +1942,37 @@ Signing is only possible with addresses of the type 'legacy'.</source>
5 <translation>default</translation>
6 </message>
7 <message>
8- <location line="+81"/>
9+ <location line="+86"/>
10 <source>none</source>
11 <translation type="unfinished"></translation>
12 </message>
13 <message>
14- <location line="+97"/>
15+ <location line="+107"/>
16 <source>Confirm options reset</source>
17+ <extracomment>Window title text of pop-up window shown when the user has chosen to reset options.</extracomment>
18 <translation>Confirm options reset</translation>
19 </message>
20 <message>
21- <location line="+1"/>
22- <location line="+70"/>
23+ <location line="-9"/>
24+ <location line="+79"/>
25 <source>Client restart required to activate changes.</source>
26+ <extracomment>Text explaining that the settings changed will not come into effect until the client is restarted.</extracomment>
27+ <translation type="unfinished"></translation>
28+ </message>
29+ <message>
30+ <location line="-75"/>
31+ <source>Current settings will be backed up at "%1".</source>
32+ <extracomment>Text explaining to the user that the client's current settings will be backed up at a specific location. %1 is a stand-in argument for the backup location's path.</extracomment>
33 <translation type="unfinished"></translation>
34 </message>
35 <message>
36- <location line="-70"/>
37+ <location line="+3"/>
38 <source>Client will be shut down. Do you want to proceed?</source>
39+ <extracomment>Text asking the user to confirm if they would like to proceed with a client shutdown.</extracomment>
40 <translation type="unfinished"></translation>
41 </message>
42 <message>
43- <location line="+18"/>
44+ <location line="+20"/>
45 <source>Configuration options</source>
46 <extracomment>Window title text of pop-up box that allows opening up of configuration file.</extracomment>
47 <translation type="unfinished"></translation>
No difference in rendering between master and PR
master | PR |
---|---|