mirror of
https://github.com/dogecoin/dogecoin.git
synced 2026-01-31 18:40:58 +00:00
Merge pull request #2870 from chromatic/add-lupdate-to-translation-policy
Add lupdate to translation policy
This commit is contained in:
commit
0e02aea03a
@ -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.
|
||||
|
||||
@ -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_$(<F)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user