From d5f46832de900cee0801ca40bba743c9564cccb8 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Wed, 9 Dec 2015 10:53:12 +0000 Subject: Unify package name to as few places as possible without major changes --- share/qt/extract_strings_qt.py | 1 + 1 file changed, 1 insertion(+) (limited to 'share/qt/extract_strings_qt.py') diff --git a/share/qt/extract_strings_qt.py b/share/qt/extract_strings_qt.py index d4bd585138..045eb27f47 100755 --- a/share/qt/extract_strings_qt.py +++ b/share/qt/extract_strings_qt.py @@ -70,6 +70,7 @@ f.write(""" #endif """) f.write('static const char UNUSED *bitcoin_strings[] = {\n') +f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('PACKAGE_NAME'),)) messages.sort(key=operator.itemgetter(0)) for (msgid, msgstr) in messages: if msgid != EMPTY: -- cgit v1.2.3 From 917b1d03cf3afa6939113e2fb0bf89dbfd9db2d7 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Tue, 22 Dec 2015 12:29:13 +0000 Subject: Set copyright holders displayed in notices separately from the package name This helps avoid accidental removal of upstream copyright names --- share/qt/extract_strings_qt.py | 1 + 1 file changed, 1 insertion(+) (limited to 'share/qt/extract_strings_qt.py') diff --git a/share/qt/extract_strings_qt.py b/share/qt/extract_strings_qt.py index 045eb27f47..470d1f2b49 100755 --- a/share/qt/extract_strings_qt.py +++ b/share/qt/extract_strings_qt.py @@ -71,6 +71,7 @@ f.write(""" """) f.write('static const char UNUSED *bitcoin_strings[] = {\n') f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('PACKAGE_NAME'),)) +f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS'),)) messages.sort(key=operator.itemgetter(0)) for (msgid, msgstr) in messages: if msgid != EMPTY: -- cgit v1.2.3 From 3cae14056a1cd8f01dc4943fa0b78315734d741a Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Tue, 19 Jan 2016 08:42:05 +0000 Subject: Bugfix: Actually use _COPYRIGHT_HOLDERS_SUBSTITUTION everywhere --- share/qt/extract_strings_qt.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'share/qt/extract_strings_qt.py') diff --git a/share/qt/extract_strings_qt.py b/share/qt/extract_strings_qt.py index 470d1f2b49..2a6e4b930c 100755 --- a/share/qt/extract_strings_qt.py +++ b/share/qt/extract_strings_qt.py @@ -72,6 +72,8 @@ f.write(""" f.write('static const char UNUSED *bitcoin_strings[] = {\n') f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('PACKAGE_NAME'),)) f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS'),)) +if os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION') != os.getenv('PACKAGE_NAME'): + f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION'),)) messages.sort(key=operator.itemgetter(0)) for (msgid, msgstr) in messages: if msgid != EMPTY: -- cgit v1.2.3 From 18f05c765c800126b74a6d5b7f33cef7c9aae1b7 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sun, 20 Mar 2016 17:51:52 +0000 Subject: build: python 3 compatibility Ubuntu 16.04 "xenial xerus" does not come with Python 2.x by default. It is possible to install a python-2.7 package, but this has its own problem: no `python` or `python2` symlink (see #7717). This fixes the following scripts to work with python 3: - `make check` (bctest,py, bitcoin-util-test.py) - `make translate` (extract_strings_qt.py) - `make symbols-check` (symbol-check.py) - `make security-check` (security-check.py) Explicitly call the python commands using $(PYTHON) instead of relying on the interpreter line at the top of the scripts. --- share/qt/extract_strings_qt.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'share/qt/extract_strings_qt.py') diff --git a/share/qt/extract_strings_qt.py b/share/qt/extract_strings_qt.py index 2a6e4b930c..7728a43775 100755 --- a/share/qt/extract_strings_qt.py +++ b/share/qt/extract_strings_qt.py @@ -1,8 +1,9 @@ #!/usr/bin/python ''' -Extract _("...") strings for translation and convert to Qt4 stringdefs so that +Extract _("...") strings for translation and convert to Qt stringdefs so that they can be picked up by Qt linguist. ''' +from __future__ import division,print_function,unicode_literals from subprocess import Popen, PIPE import glob import operator @@ -52,10 +53,14 @@ files = sys.argv[1:] # xgettext -n --keyword=_ $FILES XGETTEXT=os.getenv('XGETTEXT', 'xgettext') +if not XGETTEXT: + print('Cannot extract strings: xgettext utility is not installed or not configured.',file=sys.stderr) + print('Please install package "gettext" and re-run \'./configure\'.',file=sys.stderr) + exit(1) child = Popen([XGETTEXT,'--output=-','-n','--keyword=_'] + files, stdout=PIPE) (out, err) = child.communicate() -messages = parse_po(out) +messages = parse_po(out.decode('utf-8')) f = open(OUT_CPP, 'w') f.write(""" -- cgit v1.2.3 From 678513cc94995a243a7e56593fe3e44e003cb597 Mon Sep 17 00:00:00 2001 From: Mitchell Cash Date: Tue, 24 May 2016 10:43:01 +1000 Subject: Correct small typo in extract_strings_qt.py --- share/qt/extract_strings_qt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'share/qt/extract_strings_qt.py') diff --git a/share/qt/extract_strings_qt.py b/share/qt/extract_strings_qt.py index 7728a43775..2ba8bb9b3a 100755 --- a/share/qt/extract_strings_qt.py +++ b/share/qt/extract_strings_qt.py @@ -32,7 +32,7 @@ def parse_po(text): in_msgstr = False # message start in_msgid = True - + msgid = [line[6:]] elif line.startswith('msgstr '): in_msgid = False @@ -67,7 +67,7 @@ f.write(""" #include -// Automatically generated by extract_strings.py +// Automatically generated by extract_strings_qt.py #ifdef __GNUC__ #define UNUSED __attribute__((unused)) #else -- cgit v1.2.3