From a5ef4713263043b7f40e2c4e82e580fbb7999e90 Mon Sep 17 00:00:00 2001 From: vertoe Date: Fri, 30 Jan 2015 12:31:22 +0100 Subject: [PATCH] Fix translation makefiles and documentation. --- doc/translation_process.md | 34 +++++++++--------- src/qt/Makefile.am | 74 ++------------------------------------ src/qt/bitcoin.qrc | 72 +------------------------------------ 3 files changed, 20 insertions(+), 160 deletions(-) diff --git a/doc/translation_process.md b/doc/translation_process.md index 2f0845a877..d0af33e4e0 100644 --- a/doc/translation_process.md +++ b/doc/translation_process.md @@ -7,7 +7,7 @@ handle those translations. Files and Folders ----------------- -### bitcoin-qt.pro +### darkcoin-qt.pro This file takes care of generating `.qm` files from `.ts` files. It is mostly automated. @@ -18,7 +18,7 @@ This file must be updated whenever a new translation is added. Please note that files must end with `.qm`, not `.ts`. - locale/bitcoin_en.qm + locale/darkcoin_en.qm ... @@ -26,25 +26,25 @@ files must end with `.qm`, not `.ts`. This directory contains all translations. Filenames must adhere to this format: - bitcoin_xx_YY.ts or bitcoin_xx.ts + darkcoin_xx_YY.ts or darkcoin_xx.ts -#### bitcoin_en.ts (Source file) +#### darkcoin_en.ts (Source file) -`src/qt/locale/bitcoin_en.ts` is treated in a special way. It is used as the +`src/qt/locale/darkcoin_en.ts` is treated in a special way. It is used as the source for all other translations. Whenever a string in the code is changed -this file must be updated to reflect those changes. A custom script is used +this file must be updated to reflect those changes. A custom script is used to extract strings from the non-Qt parts. This script makes use of `gettext`, -so make sure that utility is installed (ie, `apt-get install gettext` on -Ubuntu/Debian). Once this has been updated, lupdate (included in the Qt SDK) -is used to update bitcoin_en.ts. This process has been automated, from src/qt, -simply run: - make translate - +so make sure that utility is installed (ie, `apt-get install gettext` on +Ubuntu/Debian). Once this has been updated, lupdate-qt4 (included in the Qt SDK) +is used to update darkcoin_en.ts. Simply run: + + lupdate-qt4 ./contrib/darkcoin-qt.pro -ts ./src/qt/locale/darkcoin_en.ts + ##### Handling of plurals in the source file When new plurals are added to the source file, it's important to do the following steps: -1. Open bitcoin_en.ts in Qt Linguist (also included in the Qt SDK) +1. Open darkcoin_en.ts in Qt Linguist (also included in the Qt SDK) 2. Search for `%n`, which will take you to the parts in the translation that use plurals 3. Look for empty `English Translation (Singular)` and `English Translation (Plural)` fields 4. Add the appropriate strings for the singular and plural form of the base string @@ -60,7 +60,7 @@ in Transifex and can be translated. To create the pull-request you have to do: - git add src/qt/bitcoinstrings.cpp src/qt/locale/bitcoin_en.ts + git add src/qt/bitcoinstrings.cpp src/qt/locale/darkcoin_en.ts git commit Syncing with Transifex @@ -68,7 +68,7 @@ Syncing with Transifex We are using https://transifex.com as a frontend for translating the client. -https://www.transifex.com/projects/p/bitcoin/resource/tx/ +https://www.transifex.com/projects/p/darkcoin/ The "Transifex client" (see: http://support.transifex.com/customer/portal/topics/440187-transifex-client/articles) is used to fetch new translations from Transifex. The configuration for this client (`.tx/config`) @@ -81,7 +81,7 @@ postprocessing steps before committing the translations. 1. `python contrib/devtools/update-translations.py` 2. update `src/qt/bitcoin.qrc` manually or via - `ls src/qt/locale/*ts|xargs -n1 basename|sed 's/\(bitcoin_\(.*\)\).ts/locale\/\1.qm<\/file>/'` + `ls src/qt/locale/*ts|xargs -n1 basename|sed 's/\(darkcoin_\(.*\)\).ts/locale\/\1.qm<\/file>/'` 3. update `src/qt/Makefile.am` manually or via - `ls src/qt/locale/*ts|xargs -n1 basename|sed 's/\(bitcoin_\(.*\)\).ts/ locale\/\1.ts \\/'` + `ls src/qt/locale/*ts|xargs -n1 basename|sed 's/\(darkcoin_\(.*\)\).ts/ locale\/\1.ts \\/'` 4. `git add` new translations from `src/qt/locale/` diff --git a/src/qt/Makefile.am b/src/qt/Makefile.am index c171efac7b..225acfab54 100644 --- a/src/qt/Makefile.am +++ b/src/qt/Makefile.am @@ -12,77 +12,7 @@ DIST_SUBDIRS = . test # darkcoin qt core # QT_TS = \ - locale/bitcoin_ach.ts \ - locale/bitcoin_af_ZA.ts \ - locale/bitcoin_ar.ts \ - locale/bitcoin_be_BY.ts \ - locale/bitcoin_bg.ts \ - locale/bitcoin_bs.ts \ - locale/bitcoin_ca_ES.ts \ - locale/bitcoin_ca.ts \ - locale/bitcoin_ca@valencia.ts \ - locale/bitcoin_cmn.ts \ - locale/bitcoin_cs.ts \ - locale/bitcoin_cy.ts \ - locale/bitcoin_da.ts \ - locale/bitcoin_de.ts \ - locale/bitcoin_el_GR.ts \ - locale/bitcoin_en.ts \ - locale/bitcoin_eo.ts \ - locale/bitcoin_es_CL.ts \ - locale/bitcoin_es_DO.ts \ - locale/bitcoin_es_MX.ts \ - locale/bitcoin_es.ts \ - locale/bitcoin_es_UY.ts \ - locale/bitcoin_et.ts \ - locale/bitcoin_eu_ES.ts \ - locale/bitcoin_fa_IR.ts \ - locale/bitcoin_fa.ts \ - locale/bitcoin_fi.ts \ - locale/bitcoin_fr_CA.ts \ - locale/bitcoin_fr.ts \ - locale/bitcoin_gl.ts \ - locale/bitcoin_gu_IN.ts \ - locale/bitcoin_he.ts \ - locale/bitcoin_hi_IN.ts \ - locale/bitcoin_hr.ts \ - locale/bitcoin_hu.ts \ - locale/bitcoin_id_ID.ts \ - locale/bitcoin_it.ts \ - locale/bitcoin_ja.ts \ - locale/bitcoin_ka.ts \ - locale/bitcoin_kk_KZ.ts \ - locale/bitcoin_ko_KR.ts \ - locale/bitcoin_ky.ts \ - locale/bitcoin_la.ts \ - locale/bitcoin_lt.ts \ - locale/bitcoin_lv_LV.ts \ - locale/bitcoin_mn.ts \ - locale/bitcoin_ms_MY.ts \ - locale/bitcoin_nb.ts \ - locale/bitcoin_nl.ts \ - locale/bitcoin_pam.ts \ - locale/bitcoin_pl.ts \ - locale/bitcoin_pt_BR.ts \ - locale/bitcoin_pt_PT.ts \ - locale/bitcoin_ro_RO.ts \ - locale/bitcoin_ru.ts \ - locale/bitcoin_sah.ts \ - locale/bitcoin_sk.ts \ - locale/bitcoin_sl_SI.ts \ - locale/bitcoin_sq.ts \ - locale/bitcoin_sr.ts \ - locale/bitcoin_sv.ts \ - locale/bitcoin_th_TH.ts \ - locale/bitcoin_tr.ts \ - locale/bitcoin_uk.ts \ - locale/bitcoin_ur_PK.ts \ - locale/bitcoin_uz@Cyrl.ts \ - locale/bitcoin_vi.ts \ - locale/bitcoin_vi_VN.ts \ - locale/bitcoin_zh_CN.ts \ - locale/bitcoin_zh_HK.ts \ - locale/bitcoin_zh_TW.ts + locale/darkcoin_en.ts QT_FORMS_UI = \ forms/aboutdialog.ui \ @@ -373,7 +303,7 @@ bitcoinstrings.cpp: FORCE translate: bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM) @test -n $(LUPDATE) || echo "lupdate is required for updating translations" - @QT_SELECT=$(QT_SELECT) $(LUPDATE) $^ -locations relative -no-obsolete -ts locale/bitcoin_en.ts + @QT_SELECT=$(QT_SELECT) $(LUPDATE) $^ -locations relative -no-obsolete -ts locale/darkcoin_en.ts $(QT_QRC_CPP): $(QT_QRC) $(QT_QM) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H) @cd $(abs_srcdir); test -f $(RCC) && QT_SELECT=$(QT_SELECT) $(RCC) -name darkcoin -o $(abs_builddir)/$@ $< || \ diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index e1c739b022..2e563a38c0 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -85,76 +85,6 @@ res/movies/spinner-034.png - locale/bitcoin_ach.qm - locale/bitcoin_af_ZA.qm - locale/bitcoin_ar.qm - locale/bitcoin_be_BY.qm - locale/bitcoin_bg.qm - locale/bitcoin_bs.qm - locale/bitcoin_ca_ES.qm - locale/bitcoin_ca.qm - locale/bitcoin_ca@valencia.qm - locale/bitcoin_cmn.qm - locale/bitcoin_cs.qm - locale/bitcoin_cy.qm - locale/bitcoin_da.qm - locale/bitcoin_de.qm - locale/bitcoin_el_GR.qm - locale/bitcoin_en.qm - locale/bitcoin_eo.qm - locale/bitcoin_es_CL.qm - locale/bitcoin_es_DO.qm - locale/bitcoin_es_MX.qm - locale/bitcoin_es.qm - locale/bitcoin_es_UY.qm - locale/bitcoin_et.qm - locale/bitcoin_eu_ES.qm - locale/bitcoin_fa_IR.qm - locale/bitcoin_fa.qm - locale/bitcoin_fi.qm - locale/bitcoin_fr_CA.qm - locale/bitcoin_fr.qm - locale/bitcoin_gl.qm - locale/bitcoin_gu_IN.qm - locale/bitcoin_he.qm - locale/bitcoin_hi_IN.qm - locale/bitcoin_hr.qm - locale/bitcoin_hu.qm - locale/bitcoin_id_ID.qm - locale/bitcoin_it.qm - locale/bitcoin_ja.qm - locale/bitcoin_ka.qm - locale/bitcoin_kk_KZ.qm - locale/bitcoin_ko_KR.qm - locale/bitcoin_ky.qm - locale/bitcoin_la.qm - locale/bitcoin_lt.qm - locale/bitcoin_lv_LV.qm - locale/bitcoin_mn.qm - locale/bitcoin_ms_MY.qm - locale/bitcoin_nb.qm - locale/bitcoin_nl.qm - locale/bitcoin_pam.qm - locale/bitcoin_pl.qm - locale/bitcoin_pt_BR.qm - locale/bitcoin_pt_PT.qm - locale/bitcoin_ro_RO.qm - locale/bitcoin_ru.qm - locale/bitcoin_sah.qm - locale/bitcoin_sk.qm - locale/bitcoin_sl_SI.qm - locale/bitcoin_sq.qm - locale/bitcoin_sr.qm - locale/bitcoin_sv.qm - locale/bitcoin_th_TH.qm - locale/bitcoin_tr.qm - locale/bitcoin_uk.qm - locale/bitcoin_ur_PK.qm - locale/bitcoin_uz@Cyrl.qm - locale/bitcoin_vi.qm - locale/bitcoin_vi_VN.qm - locale/bitcoin_zh_CN.qm - locale/bitcoin_zh_HK.qm - locale/bitcoin_zh_TW.qm + locale/darkcoin_en.qm