diff --git a/doc/translation_strings_policy.md b/doc/translation_strings_policy.md index db27b85ad..c3b11e526 100644 --- a/doc/translation_strings_policy.md +++ b/doc/translation_strings_policy.md @@ -102,6 +102,21 @@ versus The second example reduces the number of pluralized words that translators have to handle from three to one, at no cost to comprehensibility of the sentence. +### Finding strings to translate + +Translation files are in the directory `src/qt/locale/` and have the `.ts` suffix. + +If you have the `lupdate` Qt development tool installed, run `make translate language=...` from the `src/` directory. +This will update translation files in the locale directory. For the `language` argument, use a language suffix and +optional country code. For example, `make translate language=en_GB` will update the English language (`en`) file for +the United Kingdom (`GB`). Look at the translation files for examples of existing supported languages + +In the appropriate file for your language/locale, look for entries with the tags `type="unfinished"`. These are new, untranslated entries. +When you finish translating them, remove that tag. + +You may also see entries with the tag `type="vanished"`. These are entries where the original text has been removed from the source code. +Remove these in a separate step. + ### String freezes During a string freeze (often before a major release), no translation strings are to be added, modified or removed. diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 2dec37135..93b858061 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -445,10 +445,16 @@ $(srcdir)/qt/bitcoinstrings.cpp: $(libdogecoin_server_a_SOURCES) $(libdogecoin_w @test -n $(XGETTEXT) || echo "xgettext is required for updating translations" $(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) PACKAGE_NAME="$(PACKAGE_NAME)" COPYRIGHT_HOLDERS="$(COPYRIGHT_HOLDERS)" COPYRIGHT_HOLDERS_SUBSTITUTION="$(COPYRIGHT_HOLDERS_SUBSTITUTION)" $(PYTHON) ../share/qt/extract_strings_qt.py $^ -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) +translate_base: $(srcdir)/qt/bitcoinstrings.cpp $(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) $^ -locations relative -no-obsolete -ts $(srcdir)/qt/locale/bitcoin_en.ts +translate: $(srcdir)/qt/bitcoinstrings.cpp $(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" + @if [ "$(language)" = "" ]; then echo "you need to specify a language and optional country code, such as 'make translate language=fr' or 'make translate language=pt_BR'" && exit 1; fi + @if [ "$(language)" = "en" ]; then echo "cannot translate English; use make translate_base instead" && exit 1; fi + $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LUPDATE) $^ -ts $(srcdir)/qt/locale/bitcoin_$(language).ts + $(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM) @test -f $(RCC) @cp -f $< $(@D)/temp_$(