Skip to content

Commit 5090303

Browse files
committed
qt: Pick translation messages only from necessary files
Utility libraries (common, util) as well as extra tools shouldn't be parsed for translation messages, only the server and wallet part qualify here.
1 parent 4ed2315 commit 5090303

File tree

3 files changed

+46
-37
lines changed

3 files changed

+46
-37
lines changed

share/qt/extract_strings_qt.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
import glob
88
import operator
99
import os
10+
import sys
1011

11-
OUT_CPP="src/qt/bitcoinstrings.cpp"
12+
OUT_CPP="qt/bitcoinstrings.cpp"
1213
EMPTY=['""']
1314

1415
def parse_po(text):
@@ -47,7 +48,7 @@ def parse_po(text):
4748

4849
return messages
4950

50-
files = glob.glob('src/*.cpp') + glob.glob('src/*.h')
51+
files = sys.argv[1:]
5152

5253
# xgettext -n --keyword=_ $FILES
5354
XGETTEXT=os.getenv('XGETTEXT', 'xgettext')

src/Makefile.qt.include

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,9 @@ QT_QM=$(QT_TS:.ts=.qm)
367367

368368
.SECONDARY: $(QT_QM)
369369

370-
qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_common_a_SOURCES) $(libbitcoin_cli_a_SOURCES) $(libbitcoin_util_a_SOURCES)
370+
qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_wallet_a_SOURCES)
371371
@test -n $(XGETTEXT) || echo "xgettext is required for updating translations"
372-
$(AM_V_GEN) cd $(top_srcdir); XGETTEXT=$(XGETTEXT) share/qt/extract_strings_qt.py
372+
$(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) ../share/qt/extract_strings_qt.py $^
373373

374374
translate: qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM)
375375
@test -n $(LUPDATE) || echo "lupdate is required for updating translations"

src/qt/bitcoinstrings.cpp

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,42 @@ QT_TRANSLATE_NOOP("bitcoin-core", ""
2222
"It is also recommended to set alertnotify so you are notified of problems;\n"
2323
"for example: alertnotify=echo %%s | mail -s \"Bitcoin Alert\" [email protected]\n"),
2424
QT_TRANSLATE_NOOP("bitcoin-core", ""
25+
"(default: 1, 1 = keep tx meta data e.g. account owner and payment request "
26+
"information, 2 = drop tx meta data)"),
27+
QT_TRANSLATE_NOOP("bitcoin-core", ""
2528
"Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!"
2629
"3DES:@STRENGTH)"),
2730
QT_TRANSLATE_NOOP("bitcoin-core", ""
28-
"An error occurred while setting up the RPC port %u for listening on IPv4: %s"),
31+
"Allow JSON-RPC connections from specified source. Valid for <ip> are a "
32+
"single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or "
33+
"a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times"),
2934
QT_TRANSLATE_NOOP("bitcoin-core", ""
30-
"An error occurred while setting up the RPC port %u for listening on IPv6, "
31-
"falling back to IPv4: %s"),
35+
"An error occurred while setting up the RPC address %s port %u for listening: "
36+
"%s"),
3237
QT_TRANSLATE_NOOP("bitcoin-core", ""
3338
"Bind to given address and always listen on it. Use [host]:port notation for "
3439
"IPv6"),
3540
QT_TRANSLATE_NOOP("bitcoin-core", ""
41+
"Bind to given address to listen for JSON-RPC connections. Use [host]:port "
42+
"notation for IPv6. This option can be specified multiple times (default: "
43+
"bind to all interfaces)"),
44+
QT_TRANSLATE_NOOP("bitcoin-core", ""
3645
"Cannot obtain a lock on data directory %s. Bitcoin Core is probably already "
3746
"running."),
3847
QT_TRANSLATE_NOOP("bitcoin-core", ""
3948
"Continuously rate-limit free transactions to <n>*1000 bytes per minute "
4049
"(default:15)"),
4150
QT_TRANSLATE_NOOP("bitcoin-core", ""
42-
"Enter regression test mode, which uses a special chain in which blocks can "
43-
"be solved instantly. This is intended for regression testing tools and app "
44-
"development."),
51+
"Delete all wallet transactions and only recover those part of the blockchain "
52+
"through -rescan on startup"),
53+
QT_TRANSLATE_NOOP("bitcoin-core", ""
54+
"Distributed under the MIT/X11 software license, see the accompanying file "
55+
"COPYING or <http://www.opensource.org/licenses/mit-license.php>."),
4556
QT_TRANSLATE_NOOP("bitcoin-core", ""
4657
"Enter regression test mode, which uses a special chain in which blocks can "
4758
"be solved instantly."),
4859
QT_TRANSLATE_NOOP("bitcoin-core", ""
49-
"Error: Listening for incoming connections failed (listen returned error %d)"),
60+
"Error: Listening for incoming connections failed (listen returned error %s)"),
5061
QT_TRANSLATE_NOOP("bitcoin-core", ""
5162
"Error: The transaction was rejected! This might happen if some of the coins "
5263
"in your wallet were already spent, such as if you used a copy of wallet.dat "
@@ -55,6 +66,9 @@ QT_TRANSLATE_NOOP("bitcoin-core", ""
5566
"Error: This transaction requires a transaction fee of at least %s because of "
5667
"its amount, complexity, or use of recently received funds!"),
5768
QT_TRANSLATE_NOOP("bitcoin-core", ""
69+
"Execute command when a network tx respends wallet tx input (%s=respend TxID, "
70+
"%t=wallet TxID)"),
71+
QT_TRANSLATE_NOOP("bitcoin-core", ""
5872
"Execute command when a relevant alert is received or we see a really long "
5973
"fork (%s in cmd is replaced by message)"),
6074
QT_TRANSLATE_NOOP("bitcoin-core", ""
@@ -64,8 +78,11 @@ QT_TRANSLATE_NOOP("bitcoin-core", ""
6478
"Execute command when the best block changes (%s in cmd is replaced by block "
6579
"hash)"),
6680
QT_TRANSLATE_NOOP("bitcoin-core", ""
67-
"Fees smaller than this are considered zero fee (for transaction creation) "
68-
"(default:"),
81+
"Fees (in BTC/Kb) smaller than this are considered zero fee for relaying "
82+
"(default: %s)"),
83+
QT_TRANSLATE_NOOP("bitcoin-core", ""
84+
"Fees (in BTC/Kb) smaller than this are considered zero fee for transaction "
85+
"creation (default: %s)"),
6986
QT_TRANSLATE_NOOP("bitcoin-core", ""
7087
"Flush database activity from memory pool to disk log every <n> megabytes "
7188
"(default: 100)"),
@@ -93,6 +110,10 @@ QT_TRANSLATE_NOOP("bitcoin-core", ""
93110
"This is a pre-release test build - use at your own risk - do not use for "
94111
"mining or merchant applications"),
95112
QT_TRANSLATE_NOOP("bitcoin-core", ""
113+
"This product includes software developed by the OpenSSL Project for use in "
114+
"the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software "
115+
"written by Eric Young and UPnP software written by Thomas Bernard."),
116+
QT_TRANSLATE_NOOP("bitcoin-core", ""
96117
"Unable to bind to %s on this computer. Bitcoin Core is probably already "
97118
"running."),
98119
QT_TRANSLATE_NOOP("bitcoin-core", ""
@@ -117,34 +138,26 @@ QT_TRANSLATE_NOOP("bitcoin-core", ""
117138
"Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as "
118139
"wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect "
119140
"you should restore from a backup."),
120-
QT_TRANSLATE_NOOP("bitcoin-core", ""
121-
"You must set rpcpassword=<password> in the configuration file:\n"
122-
"%s\n"
123-
"If the file does not exist, create it with owner-readable-only file "
124-
"permissions."),
125141
QT_TRANSLATE_NOOP("bitcoin-core", "(default: 1)"),
126142
QT_TRANSLATE_NOOP("bitcoin-core", "(default: wallet.dat)"),
127143
QT_TRANSLATE_NOOP("bitcoin-core", "<category> can be:"),
128144
QT_TRANSLATE_NOOP("bitcoin-core", "Accept command line and JSON-RPC commands"),
129145
QT_TRANSLATE_NOOP("bitcoin-core", "Accept connections from outside (default: 1 if no -proxy or -connect)"),
130146
QT_TRANSLATE_NOOP("bitcoin-core", "Add a node to connect to and attempt to keep the connection open"),
131147
QT_TRANSLATE_NOOP("bitcoin-core", "Allow DNS lookups for -addnode, -seednode and -connect"),
132-
QT_TRANSLATE_NOOP("bitcoin-core", "Allow JSON-RPC connections from specified IP address"),
133148
QT_TRANSLATE_NOOP("bitcoin-core", "Attempt to recover private keys from a corrupt wallet.dat"),
134-
QT_TRANSLATE_NOOP("bitcoin-core", "Bitcoin Core Daemon"),
135-
QT_TRANSLATE_NOOP("bitcoin-core", "Bitcoin Core RPC client version"),
136149
QT_TRANSLATE_NOOP("bitcoin-core", "Block creation options:"),
137150
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot downgrade wallet"),
138151
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -bind address: '%s'"),
139152
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -externalip address: '%s'"),
140153
QT_TRANSLATE_NOOP("bitcoin-core", "Cannot write default address"),
141-
QT_TRANSLATE_NOOP("bitcoin-core", "Clear list of wallet transactions (diagnostic tool; implies -rescan)"),
142154
QT_TRANSLATE_NOOP("bitcoin-core", "Connect only to the specified node(s)"),
143155
QT_TRANSLATE_NOOP("bitcoin-core", "Connect through SOCKS proxy"),
144-
QT_TRANSLATE_NOOP("bitcoin-core", "Connect to JSON-RPC on <port> (default: 8332 or testnet: 18332)"),
145156
QT_TRANSLATE_NOOP("bitcoin-core", "Connect to a node to retrieve peer addresses, and disconnect"),
146157
QT_TRANSLATE_NOOP("bitcoin-core", "Connection options:"),
158+
QT_TRANSLATE_NOOP("bitcoin-core", "Copyright (C) 2009-%i The Bitcoin Core Developers"),
147159
QT_TRANSLATE_NOOP("bitcoin-core", "Corrupted block database detected"),
160+
QT_TRANSLATE_NOOP("bitcoin-core", "Could not parse -rpcbind value %s as network address"),
148161
QT_TRANSLATE_NOOP("bitcoin-core", "Debugging/Testing options:"),
149162
QT_TRANSLATE_NOOP("bitcoin-core", "Disable safemode, override a real safe mode event (default: 0)"),
150163
QT_TRANSLATE_NOOP("bitcoin-core", "Discover own IP address (default: 1 when listening and no -externalip)"),
@@ -160,6 +173,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet requires new
160173
QT_TRANSLATE_NOOP("bitcoin-core", "Error opening block database"),
161174
QT_TRANSLATE_NOOP("bitcoin-core", "Error"),
162175
QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is low!"),
176+
QT_TRANSLATE_NOOP("bitcoin-core", "Error: Unsupported argument -tor found, use -onion."),
163177
QT_TRANSLATE_NOOP("bitcoin-core", "Error: Wallet locked, unable to create transaction!"),
164178
QT_TRANSLATE_NOOP("bitcoin-core", "Error: system error: "),
165179
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to listen on any port. Use -listen=0 if you want this."),
@@ -173,27 +187,26 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write file info"),
173187
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write to coin database"),
174188
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write transaction index"),
175189
QT_TRANSLATE_NOOP("bitcoin-core", "Failed to write undo data"),
176-
QT_TRANSLATE_NOOP("bitcoin-core", "Fee per kB to add to transactions you send"),
177-
QT_TRANSLATE_NOOP("bitcoin-core", "Fees smaller than this are considered zero fee (for relaying) (default:"),
190+
QT_TRANSLATE_NOOP("bitcoin-core", "Fee (in BTC/kB) to add to transactions you send (default: %s)"),
178191
QT_TRANSLATE_NOOP("bitcoin-core", "Find peers using DNS lookup (default: 1 unless -connect)"),
179192
QT_TRANSLATE_NOOP("bitcoin-core", "Force safe mode (default: 0)"),
180193
QT_TRANSLATE_NOOP("bitcoin-core", "Generate coins (default: 0)"),
181-
QT_TRANSLATE_NOOP("bitcoin-core", "Get help for a command"),
182194
QT_TRANSLATE_NOOP("bitcoin-core", "How many blocks to check at startup (default: 288, 0 = all)"),
183195
QT_TRANSLATE_NOOP("bitcoin-core", "If <category> is not supplied, output all debugging information."),
184196
QT_TRANSLATE_NOOP("bitcoin-core", "Importing..."),
185197
QT_TRANSLATE_NOOP("bitcoin-core", "Imports blocks from external blk000??.dat file"),
186198
QT_TRANSLATE_NOOP("bitcoin-core", "Incorrect or no genesis block found. Wrong datadir for network?"),
187199
QT_TRANSLATE_NOOP("bitcoin-core", "Information"),
200+
QT_TRANSLATE_NOOP("bitcoin-core", "Initialization sanity check failed. Bitcoin Core is shutting down."),
188201
QT_TRANSLATE_NOOP("bitcoin-core", "Insufficient funds"),
189202
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -onion address: '%s'"),
190203
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -proxy address: '%s'"),
191204
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -minrelaytxfee=<amount>: '%s'"),
192205
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -mintxfee=<amount>: '%s'"),
193206
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -paytxfee=<amount>: '%s'"),
194207
QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount"),
208+
QT_TRANSLATE_NOOP("bitcoin-core", "Keep at most <n> unconnectable blocks in memory (default: %u)"),
195209
QT_TRANSLATE_NOOP("bitcoin-core", "Limit size of signature cache to <n> entries (default: 50000)"),
196-
QT_TRANSLATE_NOOP("bitcoin-core", "List commands"),
197210
QT_TRANSLATE_NOOP("bitcoin-core", "Listen for connections on <port> (default: 8333 or testnet: 18333)"),
198211
QT_TRANSLATE_NOOP("bitcoin-core", "Loading addresses..."),
199212
QT_TRANSLATE_NOOP("bitcoin-core", "Loading block index..."),
@@ -203,6 +216,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Maintain a full transaction index (default: 0
203216
QT_TRANSLATE_NOOP("bitcoin-core", "Maintain at most <n> connections to peers (default: 125)"),
204217
QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)"),
205218
QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)"),
219+
QT_TRANSLATE_NOOP("bitcoin-core", "Node relay options:"),
206220
QT_TRANSLATE_NOOP("bitcoin-core", "Not enough file descriptors available."),
207221
QT_TRANSLATE_NOOP("bitcoin-core", "Only accept block chain matching built-in checkpoints (default: 1)"),
208222
QT_TRANSLATE_NOOP("bitcoin-core", "Only connect to nodes in network <net> (IPv4, IPv6 or Tor)"),
@@ -212,19 +226,16 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Prepend debug output with timestamp (default:
212226
QT_TRANSLATE_NOOP("bitcoin-core", "Print block on startup, if found in block index"),
213227
QT_TRANSLATE_NOOP("bitcoin-core", "Print block tree on startup (default: 0)"),
214228
QT_TRANSLATE_NOOP("bitcoin-core", "RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions)"),
215-
QT_TRANSLATE_NOOP("bitcoin-core", "RPC client options:"),
216229
QT_TRANSLATE_NOOP("bitcoin-core", "RPC server options:"),
217230
QT_TRANSLATE_NOOP("bitcoin-core", "Randomly drop 1 of every <n> network messages"),
218231
QT_TRANSLATE_NOOP("bitcoin-core", "Randomly fuzz 1 of every <n> network messages"),
219232
QT_TRANSLATE_NOOP("bitcoin-core", "Rebuild block chain index from current blk000??.dat files"),
233+
QT_TRANSLATE_NOOP("bitcoin-core", "Relay and mine data carrier transactions (default: 1)"),
220234
QT_TRANSLATE_NOOP("bitcoin-core", "Rescan the block chain for missing wallet transactions"),
221235
QT_TRANSLATE_NOOP("bitcoin-core", "Rescanning..."),
222236
QT_TRANSLATE_NOOP("bitcoin-core", "Run a thread to flush wallet periodically (default: 1)"),
223237
QT_TRANSLATE_NOOP("bitcoin-core", "Run in the background as a daemon and accept commands"),
224-
QT_TRANSLATE_NOOP("bitcoin-core", "SSL options: (see the Bitcoin Wiki for SSL setup instructions)"),
225238
QT_TRANSLATE_NOOP("bitcoin-core", "Select SOCKS version for -proxy (4 or 5, default: 5)"),
226-
QT_TRANSLATE_NOOP("bitcoin-core", "Send command to Bitcoin Core"),
227-
QT_TRANSLATE_NOOP("bitcoin-core", "Send commands to node running on <ip> (default: 127.0.0.1)"),
228239
QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to console instead of debug.log file"),
229240
QT_TRANSLATE_NOOP("bitcoin-core", "Server certificate file (default: server.cert)"),
230241
QT_TRANSLATE_NOOP("bitcoin-core", "Server private key (default: server.pem)"),
@@ -245,29 +256,27 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Specify pid file (default: bitcoind.pid)"),
245256
QT_TRANSLATE_NOOP("bitcoin-core", "Specify wallet file (within data directory)"),
246257
QT_TRANSLATE_NOOP("bitcoin-core", "Specify your own public address"),
247258
QT_TRANSLATE_NOOP("bitcoin-core", "Spend unconfirmed change when sending transactions (default: 1)"),
248-
QT_TRANSLATE_NOOP("bitcoin-core", "Start Bitcoin Core Daemon"),
259+
QT_TRANSLATE_NOOP("bitcoin-core", "Stop running after importing blocks from disk (default: 0)"),
249260
QT_TRANSLATE_NOOP("bitcoin-core", "System error: "),
250261
QT_TRANSLATE_NOOP("bitcoin-core", "This help message"),
262+
QT_TRANSLATE_NOOP("bitcoin-core", "This is experimental software."),
251263
QT_TRANSLATE_NOOP("bitcoin-core", "This is intended for regression testing tools and app development."),
252264
QT_TRANSLATE_NOOP("bitcoin-core", "Threshold for disconnecting misbehaving peers (default: 100)"),
253265
QT_TRANSLATE_NOOP("bitcoin-core", "To use the %s option"),
254266
QT_TRANSLATE_NOOP("bitcoin-core", "Transaction amount too small"),
255267
QT_TRANSLATE_NOOP("bitcoin-core", "Transaction amounts must be positive"),
256268
QT_TRANSLATE_NOOP("bitcoin-core", "Transaction too large"),
257-
QT_TRANSLATE_NOOP("bitcoin-core", "Unable to bind to %s on this computer (bind returned error %d, %s)"),
269+
QT_TRANSLATE_NOOP("bitcoin-core", "Unable to bind to %s on this computer (bind returned error %s)"),
258270
QT_TRANSLATE_NOOP("bitcoin-core", "Unknown -socks proxy version requested: %i"),
259271
QT_TRANSLATE_NOOP("bitcoin-core", "Unknown network specified in -onlynet: '%s'"),
260272
QT_TRANSLATE_NOOP("bitcoin-core", "Upgrade wallet to latest format"),
261-
QT_TRANSLATE_NOOP("bitcoin-core", "Usage (deprecated, use bitcoin-cli):"),
262-
QT_TRANSLATE_NOOP("bitcoin-core", "Usage:"),
263273
QT_TRANSLATE_NOOP("bitcoin-core", "Use OpenSSL (https) for JSON-RPC connections"),
264274
QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: 0)"),
265275
QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: 1 when listening)"),
266276
QT_TRANSLATE_NOOP("bitcoin-core", "Use the test network"),
267277
QT_TRANSLATE_NOOP("bitcoin-core", "Username for JSON-RPC connections"),
268278
QT_TRANSLATE_NOOP("bitcoin-core", "Verifying blocks..."),
269279
QT_TRANSLATE_NOOP("bitcoin-core", "Verifying wallet..."),
270-
QT_TRANSLATE_NOOP("bitcoin-core", "Wait for RPC server to start"),
271280
QT_TRANSLATE_NOOP("bitcoin-core", "Wallet %s resides outside data directory %s"),
272281
QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart Bitcoin to complete"),
273282
QT_TRANSLATE_NOOP("bitcoin-core", "Wallet options:"),
@@ -277,6 +286,5 @@ QT_TRANSLATE_NOOP("bitcoin-core", "Warning: This version is obsolete, upgrade re
277286
QT_TRANSLATE_NOOP("bitcoin-core", "You need to rebuild the database using -reindex to change -txindex"),
278287
QT_TRANSLATE_NOOP("bitcoin-core", "Zapping all transactions from wallet..."),
279288
QT_TRANSLATE_NOOP("bitcoin-core", "on startup"),
280-
QT_TRANSLATE_NOOP("bitcoin-core", "version"),
281289
QT_TRANSLATE_NOOP("bitcoin-core", "wallet.dat corrupt, salvage failed"),
282290
};

0 commit comments

Comments
 (0)