This applies the same improvements previously done in libvirt:
https://www.redhat.com/archives/libvir-list/2018-April/msg01004.html
https://www.berrange.com/posts/2018/11/29/improved-translation-po-file-ha...
The key problems with our current approach are:
- The pot & po files stored in GIT contain huge set of
annotations about source file names & line numbers.
These are out of date as soon as a change is commited
to git following a translation refresh. This makes
diffs impossible to meaningfully review, as they are
98% noise, 2% signal.
- The po file messages are sorted by source location,
so when we move code between files, or rename files,
the po file message order changes for no good reason.
This makes diffs even more impossible to review.
- The po files contain entries for all messages even
if most have no translation, bloating size of po/
data stored in git
- Whenever 'make dist' is run, it alters all the pot
and po files, so developers need to then reset their
content to match git HEAD manually. This is caused
by having auto-generated content (source file locations)
mixed in with the static content (the actual translated
strings)
After this series, we only minimized po files in git, with
the redundated & outdated source locations info stripped.
This stripped info is re-added automatically during build
to create the real .po files, that we distribute, and/or
upload to translators in Zanata.
As a result the po directory is smaller in size, and
when refreshing from Zanata, we have git commits that
clearly show *only* the altered translations, nothing
else. The importance of this cannot be overstated - by
having these clear diffs when doing this change in libvirt,
I discovered a serious bug in the Zanata client that has
been screwing up translations in every project that uses
Zanata by adding bogus "fuzzy" annotations.
The particularly attractive statistic:
194 files changed, 2607 insertions(+), 14146 deletions(-)
Changed in v2:
- Fix a number of problems with VPATH builds
Daniel P. Berrangé (15):
po: provide custom make rules for po file management
po: remove language list from zanata configuration
po: add rules for integration with zanata
po: minimize & canonicalize translations stored in git
po: minimize af am anp ar as ast bal be bg bn_IN
po: minimize bn bo br brx bs ca cs cy da de_CH
po: minimize de el en_GB eo es et eu fa fi
po: minimize fr gl gu he hi hr hu ia
po: minimize id ilo is it ja ka kk km kn ko
po: minimize kw_GB kw@kkcor kw kw@uccor ky lt lv mai mk ml
po: minimize mn mr ms nb nds ne nl nn nso
po: minimize or pa pl pt_BR pt ro ru si sk sl
po: minimize sq sr@latin sr sv ta te tg th tr tw
po: minimize uk ur vi wba yo zh_CN zh_HK zh_TW zu
po: refresh translations from zanata
.gitignore | 11 +--
autogen.sh | 3 +-
build-aux/minimize-po.pl | 37 ++++++++
configure.ac | 8 +-
libvirt-gconfig/Makefile.am | 1 +
libvirt-glib.spec.in | 2 +-
libvirt-glib/Makefile.am | 1 +
libvirt-gobject/Makefile.am | 1 +
m4/virt-gettext.m4 | 5 --
m4/virt-nls.m4 | 45 ++++++++++
mingw-libvirt-glib.spec.in | 2 +-
po/Makefile.am | 111 +++++++++++++++++++++++
po/{POTFILES.in => POTFILES} | 0
po/README.md | 76 ++++++++++++++++
po/af.mini.po | 20 +++++
po/af.po | 153 --------------------------------
po/am.mini.po | 20 +++++
po/am.po | 153 --------------------------------
po/anp.mini.po | 19 ++++
po/anp.po | 152 -------------------------------
po/ar.mini.po | 21 +++++
po/ar.po | 154 --------------------------------
po/as.mini.po | 20 +++++
po/as.po | 153 --------------------------------
po/ast.mini.po | 20 +++++
po/ast.po | 153 --------------------------------
po/bal.mini.po | 20 +++++
po/bal.po | 153 --------------------------------
po/be.mini.po | 21 +++++
po/be.po | 154 --------------------------------
po/bg.mini.po | 20 +++++
po/bg.po | 153 --------------------------------
po/bn.mini.po | 20 +++++
po/bn.po | 153 --------------------------------
po/bn_IN.mini.po | 20 +++++
po/bn_IN.po | 153 --------------------------------
po/bo.mini.po | 20 +++++
po/bo.po | 153 --------------------------------
po/br.mini.po | 20 +++++
po/br.po | 153 --------------------------------
po/brx.mini.po | 20 +++++
po/brx.po | 153 --------------------------------
po/bs.mini.po | 21 +++++
po/bs.po | 154 --------------------------------
po/{ca.po => ca.mini.po} | 152 ++++++++++++-------------------
po/cs.mini.po | 119 +++++++++++++++++++++++++
po/cs.po | 155 --------------------------------
po/cy.mini.po | 21 +++++
po/cy.po | 154 --------------------------------
po/da.mini.po | 20 +++++
po/da.po | 153 --------------------------------
po/de.mini.po | 20 +++++
po/de.po | 153 --------------------------------
po/de_CH.mini.po | 20 +++++
po/de_CH.po | 153 --------------------------------
po/el.mini.po | 20 +++++
po/el.po | 153 --------------------------------
po/{en_GB.po => en_GB.mini.po} | 141 ++++++++++-------------------
po/eo.mini.po | 20 +++++
po/eo.po | 153 --------------------------------
po/{es.po => es.mini.po} | 153 ++++++++++++--------------------
po/et.mini.po | 20 +++++
po/et.po | 153 --------------------------------
po/eu.mini.po | 20 +++++
po/eu.po | 153 --------------------------------
po/fa.mini.po | 20 +++++
po/fa.po | 153 --------------------------------
po/fi.mini.po | 44 +++++++++
po/fi.po | 154 --------------------------------
po/{fr.po => fr.mini.po} | 157 +++++++++++++--------------------
po/gl.mini.po | 20 +++++
po/gl.po | 153 --------------------------------
po/gu.mini.po | 20 +++++
po/gu.po | 153 --------------------------------
po/he.mini.po | 20 +++++
po/he.po | 153 --------------------------------
po/{hi.po => hi.mini.po} | 141 ++++++++++-------------------
po/hr.mini.po | 21 +++++
po/hr.po | 154 --------------------------------
po/hu.mini.po | 20 +++++
po/hu.po | 153 --------------------------------
po/ia.mini.po | 20 +++++
po/ia.po | 153 --------------------------------
po/id.mini.po | 20 +++++
po/id.po | 153 --------------------------------
po/ilo.mini.po | 20 +++++
po/ilo.po | 153 --------------------------------
po/is.mini.po | 20 +++++
po/is.po | 153 --------------------------------
po/it.mini.po | 20 +++++
po/it.po | 153 --------------------------------
po/{ja.po => ja.mini.po} | 141 ++++++++++-------------------
po/ka.mini.po | 20 +++++
po/ka.po | 153 --------------------------------
po/kk.mini.po | 20 +++++
po/kk.po | 153 --------------------------------
po/km.mini.po | 20 +++++
po/km.po | 153 --------------------------------
po/kn.mini.po | 20 +++++
po/kn.po | 153 --------------------------------
po/ko.mini.po | 20 +++++
po/ko.po | 153 --------------------------------
po/kw.mini.po | 20 +++++
po/kw.po | 153 --------------------------------
po/kw(a)kkcor.mini.po | 20 +++++
po/kw(a)kkcor.po | 153 --------------------------------
po/kw(a)uccor.mini.po | 20 +++++
po/kw(a)uccor.po | 153 --------------------------------
po/kw_GB.mini.po | 20 +++++
po/kw_GB.po | 153 --------------------------------
po/ky.mini.po | 20 +++++
po/ky.po | 153 --------------------------------
po/lt.mini.po | 21 +++++
po/lt.po | 154 --------------------------------
po/lv.mini.po | 21 +++++
po/lv.po | 154 --------------------------------
po/mai.mini.po | 20 +++++
po/mai.po | 153 --------------------------------
po/mk.mini.po | 20 +++++
po/mk.po | 153 --------------------------------
po/ml.mini.po | 20 +++++
po/ml.po | 153 --------------------------------
po/mn.mini.po | 20 +++++
po/mn.po | 153 --------------------------------
po/mr.mini.po | 20 +++++
po/mr.po | 153 --------------------------------
po/ms.mini.po | 20 +++++
po/ms.po | 153 --------------------------------
po/nb.mini.po | 20 +++++
po/nb.po | 153 --------------------------------
po/nds.mini.po | 20 +++++
po/nds.po | 153 --------------------------------
po/ne.mini.po | 20 +++++
po/ne.po | 153 --------------------------------
po/nl.mini.po | 20 +++++
po/nl.po | 153 --------------------------------
po/nn.mini.po | 20 +++++
po/nn.po | 153 --------------------------------
po/nso.mini.po | 20 +++++
po/nso.po | 153 --------------------------------
po/or.mini.po | 20 +++++
po/or.po | 153 --------------------------------
po/pa.mini.po | 20 +++++
po/pa.po | 153 --------------------------------
po/{pl.po => pl.mini.po} | 152 ++++++++++++-------------------
po/pt.mini.po | 20 +++++
po/pt.po | 153 --------------------------------
po/{pt_BR.po => pt_BR.mini.po} | 141 ++++++++++-------------------
po/ro.mini.po | 21 +++++
po/ro.po | 154 --------------------------------
po/ru.mini.po | 26 ++++++
po/ru.po | 155 --------------------------------
po/si.mini.po | 20 +++++
po/si.po | 153 --------------------------------
po/sk.mini.po | 20 +++++
po/sk.po | 153 --------------------------------
po/sl.mini.po | 21 +++++
po/sl.po | 154 --------------------------------
po/sq.mini.po | 20 +++++
po/sq.po | 153 --------------------------------
po/sr.mini.po | 21 +++++
po/sr.po | 154 --------------------------------
po/sr(a)latin.mini.po | 21 +++++
po/sr(a)latin.po | 154 --------------------------------
po/sv.mini.po | 20 +++++
po/sv.po | 153 --------------------------------
po/ta.mini.po | 20 +++++
po/ta.po | 153 --------------------------------
po/te.mini.po | 20 +++++
po/te.po | 153 --------------------------------
po/tg.mini.po | 20 +++++
po/tg.po | 153 --------------------------------
po/th.mini.po | 20 +++++
po/th.po | 153 --------------------------------
po/tr.mini.po | 20 +++++
po/tr.po | 153 --------------------------------
po/tw.mini.po | 19 ++++
po/tw.po | 152 -------------------------------
po/{uk.po => uk.mini.po} | 152 ++++++++++++-------------------
po/ur.mini.po | 20 +++++
po/ur.po | 153 --------------------------------
po/vi.mini.po | 20 +++++
po/vi.po | 153 --------------------------------
po/wba.mini.po | 19 ++++
po/wba.po | 152 -------------------------------
po/yo.mini.po | 19 ++++
po/yo.po | 152 -------------------------------
po/zanata.xml | 99 ---------------------
po/zh_CN.mini.po | 20 +++++
po/zh_CN.po | 153 --------------------------------
po/zh_HK.mini.po | 20 +++++
po/zh_HK.po | 153 --------------------------------
po/zh_TW.mini.po | 20 +++++
po/zh_TW.po | 153 --------------------------------
po/zu.mini.po | 20 +++++
po/zu.po | 153 --------------------------------
196 files changed, 2609 insertions(+), 14149 deletions(-)
create mode 100755 build-aux/minimize-po.pl
delete mode 100644 m4/virt-gettext.m4
create mode 100644 m4/virt-nls.m4
create mode 100644 po/Makefile.am
rename po/{POTFILES.in => POTFILES} (100%)
create mode 100644 po/README.md
create mode 100644 po/af.mini.po
delete mode 100644 po/af.po
create mode 100644 po/am.mini.po
delete mode 100644 po/am.po
create mode 100644 po/anp.mini.po
delete mode 100644 po/anp.po
create mode 100644 po/ar.mini.po
delete mode 100644 po/ar.po
create mode 100644 po/as.mini.po
delete mode 100644 po/as.po
create mode 100644 po/ast.mini.po
delete mode 100644 po/ast.po
create mode 100644 po/bal.mini.po
delete mode 100644 po/bal.po
create mode 100644 po/be.mini.po
delete mode 100644 po/be.po
create mode 100644 po/bg.mini.po
delete mode 100644 po/bg.po
create mode 100644 po/bn.mini.po
delete mode 100644 po/bn.po
create mode 100644 po/bn_IN.mini.po
delete mode 100644 po/bn_IN.po
create mode 100644 po/bo.mini.po
delete mode 100644 po/bo.po
create mode 100644 po/br.mini.po
delete mode 100644 po/br.po
create mode 100644 po/brx.mini.po
delete mode 100644 po/brx.po
create mode 100644 po/bs.mini.po
delete mode 100644 po/bs.po
rename po/{ca.po => ca.mini.po} (62%)
create mode 100644 po/cs.mini.po
delete mode 100644 po/cs.po
create mode 100644 po/cy.mini.po
delete mode 100644 po/cy.po
create mode 100644 po/da.mini.po
delete mode 100644 po/da.po
create mode 100644 po/de.mini.po
delete mode 100644 po/de.po
create mode 100644 po/de_CH.mini.po
delete mode 100644 po/de_CH.po
create mode 100644 po/el.mini.po
delete mode 100644 po/el.po
rename po/{en_GB.po => en_GB.mini.po} (51%)
create mode 100644 po/eo.mini.po
delete mode 100644 po/eo.po
rename po/{es.po => es.mini.po} (59%)
create mode 100644 po/et.mini.po
delete mode 100644 po/et.po
create mode 100644 po/eu.mini.po
delete mode 100644 po/eu.po
create mode 100644 po/fa.mini.po
delete mode 100644 po/fa.po
create mode 100644 po/fi.mini.po
delete mode 100644 po/fi.po
rename po/{fr.po => fr.mini.po} (59%)
create mode 100644 po/gl.mini.po
delete mode 100644 po/gl.po
create mode 100644 po/gu.mini.po
delete mode 100644 po/gu.po
create mode 100644 po/he.mini.po
delete mode 100644 po/he.po
rename po/{hi.po => hi.mini.po} (62%)
create mode 100644 po/hr.mini.po
delete mode 100644 po/hr.po
create mode 100644 po/hu.mini.po
delete mode 100644 po/hu.po
create mode 100644 po/ia.mini.po
delete mode 100644 po/ia.po
create mode 100644 po/id.mini.po
delete mode 100644 po/id.po
create mode 100644 po/ilo.mini.po
delete mode 100644 po/ilo.po
create mode 100644 po/is.mini.po
delete mode 100644 po/is.po
create mode 100644 po/it.mini.po
delete mode 100644 po/it.po
rename po/{ja.po => ja.mini.po} (55%)
create mode 100644 po/ka.mini.po
delete mode 100644 po/ka.po
create mode 100644 po/kk.mini.po
delete mode 100644 po/kk.po
create mode 100644 po/km.mini.po
delete mode 100644 po/km.po
create mode 100644 po/kn.mini.po
delete mode 100644 po/kn.po
create mode 100644 po/ko.mini.po
delete mode 100644 po/ko.po
create mode 100644 po/kw.mini.po
delete mode 100644 po/kw.po
create mode 100644 po/kw(a)kkcor.mini.po
delete mode 100644 po/kw(a)kkcor.po
create mode 100644 po/kw(a)uccor.mini.po
delete mode 100644 po/kw(a)uccor.po
create mode 100644 po/kw_GB.mini.po
delete mode 100644 po/kw_GB.po
create mode 100644 po/ky.mini.po
delete mode 100644 po/ky.po
create mode 100644 po/lt.mini.po
delete mode 100644 po/lt.po
create mode 100644 po/lv.mini.po
delete mode 100644 po/lv.po
create mode 100644 po/mai.mini.po
delete mode 100644 po/mai.po
create mode 100644 po/mk.mini.po
delete mode 100644 po/mk.po
create mode 100644 po/ml.mini.po
delete mode 100644 po/ml.po
create mode 100644 po/mn.mini.po
delete mode 100644 po/mn.po
create mode 100644 po/mr.mini.po
delete mode 100644 po/mr.po
create mode 100644 po/ms.mini.po
delete mode 100644 po/ms.po
create mode 100644 po/nb.mini.po
delete mode 100644 po/nb.po
create mode 100644 po/nds.mini.po
delete mode 100644 po/nds.po
create mode 100644 po/ne.mini.po
delete mode 100644 po/ne.po
create mode 100644 po/nl.mini.po
delete mode 100644 po/nl.po
create mode 100644 po/nn.mini.po
delete mode 100644 po/nn.po
create mode 100644 po/nso.mini.po
delete mode 100644 po/nso.po
create mode 100644 po/or.mini.po
delete mode 100644 po/or.po
create mode 100644 po/pa.mini.po
delete mode 100644 po/pa.po
rename po/{pl.po => pl.mini.po} (62%)
create mode 100644 po/pt.mini.po
delete mode 100644 po/pt.po
rename po/{pt_BR.po => pt_BR.mini.po} (54%)
create mode 100644 po/ro.mini.po
delete mode 100644 po/ro.po
create mode 100644 po/ru.mini.po
delete mode 100644 po/ru.po
create mode 100644 po/si.mini.po
delete mode 100644 po/si.po
create mode 100644 po/sk.mini.po
delete mode 100644 po/sk.po
create mode 100644 po/sl.mini.po
delete mode 100644 po/sl.po
create mode 100644 po/sq.mini.po
delete mode 100644 po/sq.po
create mode 100644 po/sr.mini.po
delete mode 100644 po/sr.po
create mode 100644 po/sr(a)latin.mini.po
delete mode 100644 po/sr(a)latin.po
create mode 100644 po/sv.mini.po
delete mode 100644 po/sv.po
create mode 100644 po/ta.mini.po
delete mode 100644 po/ta.po
create mode 100644 po/te.mini.po
delete mode 100644 po/te.po
create mode 100644 po/tg.mini.po
delete mode 100644 po/tg.po
create mode 100644 po/th.mini.po
delete mode 100644 po/th.po
create mode 100644 po/tr.mini.po
delete mode 100644 po/tr.po
create mode 100644 po/tw.mini.po
delete mode 100644 po/tw.po
rename po/{uk.po => uk.mini.po} (65%)
create mode 100644 po/ur.mini.po
delete mode 100644 po/ur.po
create mode 100644 po/vi.mini.po
delete mode 100644 po/vi.po
create mode 100644 po/wba.mini.po
delete mode 100644 po/wba.po
create mode 100644 po/yo.mini.po
delete mode 100644 po/yo.po
create mode 100644 po/zh_CN.mini.po
delete mode 100644 po/zh_CN.po
create mode 100644 po/zh_HK.mini.po
delete mode 100644 po/zh_HK.po
create mode 100644 po/zh_TW.mini.po
delete mode 100644 po/zh_TW.po
create mode 100644 po/zu.mini.po
delete mode 100644 po/zu.po
--
2.20.1