aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile.qt.include
diff options
context:
space:
mode:
authorlaanwj <126646+laanwj@users.noreply.github.com>2022-02-04 13:42:59 +0100
committerlaanwj <126646+laanwj@users.noreply.github.com>2022-02-04 13:43:36 +0100
commita5edd191be93aff8f9c0f60f04e711e2e78ecc77 (patch)
tree9b4c3439e5d4bf2e2818435feb10d2a5af504b63 /src/Makefile.qt.include
parent5c6b3d5b350888b2a5ab93c757205f22601f95a2 (diff)
parent985d85e9a8d3dd6e52fef27f76b49c5aa4b34f30 (diff)
downloadbitcoin-a5edd191be93aff8f9c0f60f04e711e2e78ecc77.tar.xz
Merge bitcoin/bitcoin#22151: build: Follow Transifex docs to prepare XLIFF source
985d85e9a8d3dd6e52fef27f76b49c5aa4b34f30 Follow Transifex docs to prepare XLIFF source (Hennadii Stepanov) Pull request description: This PR is a #21694 follow up. From the Transifex [docs](https://docs.transifex.com/formats/xliff#how-to-distinguish-between-a-source-file-and-a-translation-file): > A source file is different than a translation file. The translation file contains \<Target> references, whereas a source file does not. This PR makes the `qt/locale/bitcoin_en.xlf` source file according to the docs. ACKs for top commit: laanwj: ACK 985d85e9a8d3dd6e52fef27f76b49c5aa4b34f30 Tree-SHA512: 537ef78f39a12f094b17fc902c5b59c7ae4d27e5fa35fbf6b33386843e4521236dac3275ba26ff2d1c435e53e8942284644d5de67b0b3543cec96cbcd4351607
Diffstat (limited to 'src/Makefile.qt.include')
-rw-r--r--src/Makefile.qt.include6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include
index f4d4641feb..85e3a6e16a 100644
--- a/src/Makefile.qt.include
+++ b/src/Makefile.qt.include
@@ -359,11 +359,15 @@ $(srcdir)/qt/bitcoinstrings.cpp: FORCE
@test -n $(XGETTEXT) || echo "xgettext is required for updating translations"
$(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) COPYRIGHT_HOLDERS="$(COPYRIGHT_HOLDERS)" $(PYTHON) ../share/qt/extract_strings_qt.py $(libbitcoin_node_a_SOURCES) $(libbitcoin_wallet_a_SOURCES) $(libbitcoin_common_a_SOURCES) $(libbitcoin_zmq_a_SOURCES) $(libbitcoin_consensus_a_SOURCES) $(libbitcoin_util_a_SOURCES)
+# The resulted bitcoin_en.xlf source file should follow Transifex requirements.
+# See: https://docs.transifex.com/formats/xliff#how-to-distinguish-between-a-source-file-and-a-translation-file
translate: $(srcdir)/qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_BASE_CPP) qt/bitcoin.cpp $(BITCOIN_QT_WINDOWS_CPP) $(BITCOIN_QT_WALLET_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM)
@test -n $(LUPDATE) || echo "lupdate is required for updating translations"
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LUPDATE) -no-obsolete -I $(srcdir) -locations relative $^ -ts $(srcdir)/qt/locale/bitcoin_en.ts
@test -n $(LCONVERT) || echo "lconvert is required for updating translations"
- $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LCONVERT) -o $(srcdir)/qt/locale/bitcoin_en.xlf -i $(srcdir)/qt/locale/bitcoin_en.ts
+ $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LCONVERT) -drop-translations -o $(srcdir)/qt/locale/bitcoin_en.xlf -i $(srcdir)/qt/locale/bitcoin_en.ts
+ @$(SED) -i.old -e 's|source-language="en" target-language="en"|source-language="en"|' -e '/<target xml:space="preserve"><\/target>/d' $(srcdir)/qt/locale/bitcoin_en.xlf
+ @rm -f $(srcdir)/qt/locale/bitcoin_en.xlf.old
$(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM)
@test -f $(RCC)