Skip to content

Commit

Permalink
partial bitcoin#21694: Use XLIFF file to provide more context to Tran…
Browse files Browse the repository at this point in the history
…sifex translators

Excludes 35d5239
  • Loading branch information
kwvg committed Apr 26, 2022
1 parent 7b69a4c commit 65f7794
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[main]
host = https://www.transifex.com

[dash.qt-translation-012x]
[dash.qt-translation-018x]
file_filter = src/qt/locale/dash_<lang>.ts
source_file = src/qt/locale/dash_en.ts
source_file = src/qt/locale/dash_en.xlf
source_lang = en
6 changes: 5 additions & 1 deletion build-aux/m4/bitcoin_qt.m4
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
BITCOIN_QT_PATH_PROGS([RCC], [rcc-qt5 rcc5 rcc], $qt_bin_path)
BITCOIN_QT_PATH_PROGS([LRELEASE], [lrelease-qt5 lrelease5 lrelease], $qt_bin_path)
BITCOIN_QT_PATH_PROGS([LUPDATE], [lupdate-qt5 lupdate5 lupdate],$qt_bin_path, yes)
BITCOIN_QT_PATH_PROGS([LCONVERT], [lconvert-qt5 lconvert5 lconvert], $qt_bin_path, yes)
BITCOIN_QT_CHECK([
AC_CACHE_CHECK([whether $RCC accepts --format-version option],
Expand Down Expand Up @@ -269,7 +270,10 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
AC_MSG_ERROR([libQtDBus not found. Install libQtDBus or remove --with-qtdbus.])
fi
if test "x$LUPDATE" = x; then
AC_MSG_WARN([lupdate is required to update qt translations])
AC_MSG_WARN([lupdate tool is required to update Qt translations.])
fi
if test "x$LCONVERT" = x; then
AC_MSG_WARN([lconvert tool is required to update Qt translations.])
fi
],[
bitcoin_enable_qt=no
Expand Down
5 changes: 4 additions & 1 deletion depends/packages/qt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -251,20 +251,23 @@ define $(package)_config_cmds
qtbase/bin/qmake -o qttranslations/Makefile qttranslations/qttranslations.pro && \
qtbase/bin/qmake -o qttranslations/translations/Makefile qttranslations/translations/translations.pro && \
qtbase/bin/qmake -o qttools/src/linguist/lrelease/Makefile qttools/src/linguist/lrelease/lrelease.pro && \
qtbase/bin/qmake -o qttools/src/linguist/lupdate/Makefile qttools/src/linguist/lupdate/lupdate.pro
qtbase/bin/qmake -o qttools/src/linguist/lupdate/Makefile qttools/src/linguist/lupdate/lupdate.pro && \
qtbase/bin/qmake -o qttools/src/linguist/lconvert/Makefile qttools/src/linguist/lconvert/lconvert.pro
endef

define $(package)_build_cmds
$(MAKE) -C qtbase/src $(addprefix sub-,$($(package)_qt_libs)) && \
$(MAKE) -C qttools/src/linguist/lrelease && \
$(MAKE) -C qttools/src/linguist/lupdate && \
$(MAKE) -C qttools/src/linguist/lconvert && \
$(MAKE) -C qttranslations
endef

define $(package)_stage_cmds
$(MAKE) -C qtbase/src INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_qt_libs))) && \
$(MAKE) -C qttools/src/linguist/lrelease INSTALL_ROOT=$($(package)_staging_dir) install_target && \
$(MAKE) -C qttools/src/linguist/lupdate INSTALL_ROOT=$($(package)_staging_dir) install_target && \
$(MAKE) -C qttools/src/linguist/lconvert INSTALL_ROOT=$($(package)_staging_dir) install_target && \
$(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets
endef

Expand Down
2 changes: 2 additions & 0 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ $(srcdir)/qt/dashstrings.cpp: FORCE
translate: $(srcdir)/qt/dashstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_BASE_CPP) qt/dash.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) $^ -I$(srcdir) -locations relative -no-obsolete -ts $(srcdir)/qt/locale/dash_en.ts
@test -n $(LCONVERT) || echo "lconvert is required for updating translations"
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LCONVERT) -o $(srcdir)/qt/locale/dash_en.xlf -i $(srcdir)/qt/locale/dash_en.ts

$(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM)
@test -f $(RCC)
Expand Down
3 changes: 2 additions & 1 deletion src/qt/addressbookpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ void AddressBookPage::on_exportButton_clicked()

if(!writer.write()) {
QMessageBox::critical(this, tr("Exporting Failed"),
tr("There was an error trying to save the address list to %1. Please try again.").arg(filename));
//: %1 is a name of the file (e.g., "addrbook.csv") that the bitcoin addresses were exported to.
tr("There was an error trying to save the address list to %1. Please try again.", "An error message.").arg(filename));
}
}

Expand Down

0 comments on commit 65f7794

Please sign in to comment.