mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-03 12:11:52 +02:00
Merge #9735: devtools: Handle Qt formatting characters edge-case in update-translations.py
7179e7c
qt: Periodic translations update (Wladimir J. van der Laan)5e903a5
devtools: Handle Qt formatting characters edge-case in update-translations.py (Wladimir J. van der Laan)
This commit is contained in:
@ -65,6 +65,14 @@ def split_format_specifiers(specifiers):
|
||||
else:
|
||||
other.append(s)
|
||||
|
||||
# If both numeric format specifiers and "others" are used, assume we're dealing
|
||||
# with a Qt-formatted message. In the case of Qt formatting (see https://doc.qt.io/qt-5/qstring.html#arg)
|
||||
# only numeric formats are replaced at all. This means "(percentage: %1%)" is valid, without needing
|
||||
# any kind of escaping that would be necessary for strprintf. Without this, this function
|
||||
# would wrongly detect '%)' as a printf format specifier.
|
||||
if numeric:
|
||||
other = []
|
||||
|
||||
# numeric (Qt) can be present in any order, others (strprintf) must be in specified order
|
||||
return set(numeric),other
|
||||
|
||||
|
Reference in New Issue
Block a user