[virt-tools-list] [virt-viewer PATCH 00/14] po: improve translation handling

Daniel P. Berrangé berrange at redhat.com
Mon Mar 4 10:36:49 UTC 2019


ping...

On Wed, Feb 20, 2019 at 05:50:51PM +0000, Daniel P. Berrangé wrote:
> 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-handling-by-ditching-gettext-autotools-integration/
> 
> 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:
> 
>  193 files changed, 11904 insertions(+), 80334 deletions(-)
> 
> Daniel P. Berrangé (14):
>   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
>   po: minimize bn_IN bn bo br brx bs ca cs cy da
>   po: minimize de_CH 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 at kkcor kw kw at 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 at latin sr sv ta te tg th tr tw
>   po: minimize uk ur vi wba yo zh_CN zh_HK zh_TW zu
> 
>  Makefile.am                                   |    7 -
>  autogen.sh                                    |    1 -
>  build-aux/minimize-po.pl                      |   37 +
>  configure.ac                                  |    6 +-
>  data/Makefile.am                              |   12 +-
>  data/remote-viewer.appdata.xml.in             |   12 +-
>  data/remote-viewer.desktop.in                 |    4 +-
>  ...iewer-mime.xml.in => virt-viewer-mime.xml} |    0
>  m4/virt-nls.m4                                |   45 +
>  mingw-virt-viewer.spec.in                     |    2 +-
>  po/Makefile.am                                |  115 ++
>  po/POTFILES                                   |   26 +
>  po/POTFILES.in                                |   27 -
>  po/README.md                                  |   76 ++
>  po/af.mini.po                                 |   19 +
>  po/af.po                                      |  864 -------------
>  po/am.mini.po                                 |   19 +
>  po/am.po                                      |  864 -------------
>  po/anp.mini.po                                |   19 +
>  po/anp.po                                     |  864 -------------
>  po/ar.mini.po                                 |   20 +
>  po/ar.po                                      |  869 -------------
>  po/as.mini.po                                 |  327 +++++
>  po/as.po                                      |  884 -------------
>  po/ast.mini.po                                |   19 +
>  po/ast.po                                     |  864 -------------
>  po/bal.mini.po                                |   19 +
>  po/bal.po                                     |  863 -------------
>  po/be.mini.po                                 |   20 +
>  po/be.po                                      |  866 -------------
>  po/bg.mini.po                                 |  307 +++++
>  po/bg.po                                      |  881 -------------
>  po/bn.mini.po                                 |  256 ++++
>  po/bn.po                                      |  885 -------------
>  po/bn_IN.mini.po                              |  329 +++++
>  po/bn_IN.po                                   |  886 -------------
>  po/bo.mini.po                                 |   19 +
>  po/bo.po                                      |  863 -------------
>  po/br.mini.po                                 |   19 +
>  po/br.po                                      |  864 -------------
>  po/brx.mini.po                                |   19 +
>  po/brx.po                                     |  864 -------------
>  po/bs.mini.po                                 |   20 +
>  po/bs.po                                      |  866 -------------
>  po/{ca.po => ca.mini.po}                      | 1108 +++++++---------
>  po/cs.mini.po                                 |  151 +++
>  po/cs.po                                      |  907 --------------
>  po/cy.mini.po                                 |   20 +
>  po/cy.po                                      |  867 -------------
>  po/da.mini.po                                 |   19 +
>  po/da.po                                      |  864 -------------
>  po/{de.po => de.mini.po}                      | 1015 +++++----------
>  po/de_CH.mini.po                              |   19 +
>  po/de_CH.po                                   |  864 -------------
>  po/el.mini.po                                 |   19 +
>  po/el.po                                      |  864 -------------
>  po/en_GB.mini.po                              |   19 +
>  po/en_GB.po                                   |  864 -------------
>  po/eo.mini.po                                 |   19 +
>  po/eo.po                                      |  864 -------------
>  po/{es.po => es.mini.po}                      | 1100 +++++++---------
>  po/et.mini.po                                 |   19 +
>  po/et.po                                      |  864 -------------
>  po/eu.mini.po                                 |   67 +
>  po/eu.po                                      |  865 -------------
>  po/fa.mini.po                                 |   19 +
>  po/fa.po                                      |  863 -------------
>  po/fi.mini.po                                 |   19 +
>  po/fi.po                                      |  864 -------------
>  po/{fr.po => fr.mini.po}                      | 1023 +++++----------
>  po/gl.mini.po                                 |   19 +
>  po/gl.po                                      |  864 -------------
>  po/gu.mini.po                                 |  325 +++++
>  po/gu.po                                      |  882 -------------
>  po/he.mini.po                                 |   19 +
>  po/he.po                                      |  864 -------------
>  po/hi.mini.po                                 |  288 +++++
>  po/hi.po                                      |  879 -------------
>  po/hr.mini.po                                 |   20 +
>  po/hr.po                                      |  866 -------------
>  po/{hu.po => hu.mini.po}                      |  980 +++++----------
>  po/ia.mini.po                                 |   19 +
>  po/ia.po                                      |  864 -------------
>  po/id.mini.po                                 |   19 +
>  po/id.po                                      |  863 -------------
>  po/ilo.mini.po                                |   19 +
>  po/ilo.po                                     |  863 -------------
>  po/is.mini.po                                 |   19 +
>  po/is.po                                      |  864 -------------
>  po/{it.po => it.mini.po}                      | 1029 +++++----------
>  po/{ja.po => ja.mini.po}                      | 1045 ++++++----------
>  po/ka.mini.po                                 |   19 +
>  po/ka.po                                      |  863 -------------
>  po/kk.mini.po                                 |   19 +
>  po/kk.po                                      |  863 -------------
>  po/km.mini.po                                 |   19 +
>  po/km.po                                      |  863 -------------
>  po/kn.mini.po                                 |  329 +++++
>  po/kn.po                                      |  886 -------------
>  po/ko.mini.po                                 |  287 +++++
>  po/ko.po                                      |  882 -------------
>  po/kw.mini.po                                 |   20 +
>  po/kw.po                                      |  867 -------------
>  po/kw at kkcor.mini.po                           |   20 +
>  po/kw at kkcor.po                                |  867 -------------
>  po/kw at uccor.mini.po                           |   20 +
>  po/kw at uccor.po                                |  867 -------------
>  po/kw_GB.mini.po                              |   20 +
>  po/kw_GB.po                                   |  867 -------------
>  po/ky.mini.po                                 |   19 +
>  po/ky.po                                      |  863 -------------
>  po/lt.mini.po                                 |   20 +
>  po/lt.po                                      |  865 -------------
>  po/lv.mini.po                                 |   20 +
>  po/lv.po                                      |  866 -------------
>  po/mai.mini.po                                |   19 +
>  po/mai.po                                     |  864 -------------
>  po/mk.mini.po                                 |   19 +
>  po/mk.po                                      |  864 -------------
>  po/{ml.po => ml.mini.po}                      |  897 +++----------
>  po/mn.mini.po                                 |   19 +
>  po/mn.po                                      |  864 -------------
>  po/mr.mini.po                                 |  325 +++++
>  po/mr.po                                      |  882 -------------
>  po/ms.mini.po                                 |   19 +
>  po/ms.po                                      |  863 -------------
>  po/nb.mini.po                                 |   76 ++
>  po/nb.po                                      |  865 -------------
>  po/nds.mini.po                                |   19 +
>  po/nds.po                                     |  863 -------------
>  po/ne.mini.po                                 |   19 +
>  po/ne.po                                      |  864 -------------
>  po/nl.mini.po                                 |  326 +++++
>  po/nl.po                                      |  883 -------------
>  po/nn.mini.po                                 |   19 +
>  po/nn.po                                      |  864 -------------
>  po/nso.mini.po                                |   19 +
>  po/nso.po                                     |  864 -------------
>  po/or.mini.po                                 |  308 +++++
>  po/or.po                                      |  879 -------------
>  po/pa.mini.po                                 |  305 +++++
>  po/pa.po                                      |  879 -------------
>  po/{pl.po => pl.mini.po}                      | 1111 +++++++---------
>  po/pt.mini.po                                 |   65 +
>  po/pt.po                                      |  867 -------------
>  po/{pt_BR.po => pt_BR.mini.po}                | 1045 ++++++----------
>  po/ro.mini.po                                 |   20 +
>  po/ro.po                                      |  866 -------------
>  po/{ru.po => ru.mini.po}                      |  984 +++++----------
>  po/si.mini.po                                 |   19 +
>  po/si.po                                      |  864 -------------
>  po/sk.mini.po                                 |  124 ++
>  po/sk.po                                      |  865 -------------
>  po/sl.mini.po                                 |   20 +
>  po/sl.po                                      |  867 -------------
>  po/sq.mini.po                                 |   19 +
>  po/sq.po                                      |  864 -------------
>  po/sr.mini.po                                 |   20 +
>  po/sr.po                                      |  866 -------------
>  po/sr at latin.mini.po                           |   20 +
>  po/sr at latin.po                                |  866 -------------
>  po/{sv.po => sv.mini.po}                      | 1041 ++++++---------
>  po/ta.mini.po                                 |  331 +++++
>  po/ta.po                                      |  888 -------------
>  po/te.mini.po                                 |  310 +++++
>  po/te.po                                      |  881 -------------
>  po/tg.mini.po                                 |   19 +
>  po/tg.po                                      |  863 -------------
>  po/th.mini.po                                 |   19 +
>  po/th.po                                      |  863 -------------
>  po/tr.mini.po                                 |  122 ++
>  po/tr.po                                      |  865 -------------
>  po/tw.mini.po                                 |   19 +
>  po/tw.po                                      |  863 -------------
>  po/{uk.po => uk.mini.po}                      | 1113 +++++++----------
>  po/ur.mini.po                                 |   19 +
>  po/ur.po                                      |  864 -------------
>  po/vi.mini.po                                 |   19 +
>  po/vi.po                                      |  863 -------------
>  po/wba.mini.po                                |   19 +
>  po/wba.po                                     |  863 -------------
>  po/yo.mini.po                                 |   19 +
>  po/yo.po                                      |  864 -------------
>  po/zanata.xml                                 |   99 --
>  po/zh_CN.mini.po                              |  465 +++++++
>  po/zh_CN.po                                   |  887 -------------
>  po/zh_HK.mini.po                              |   19 +
>  po/zh_HK.po                                   |  863 -------------
>  po/zh_TW.mini.po                              |  469 +++++++
>  po/zh_TW.po                                   |  891 -------------
>  po/zu.mini.po                                 |   19 +
>  po/zu.po                                      |  863 -------------
>  virt-viewer.spec.in                           |    2 +-
>  193 files changed, 11904 insertions(+), 80334 deletions(-)
>  create mode 100755 build-aux/minimize-po.pl
>  rename data/{virt-viewer-mime.xml.in => virt-viewer-mime.xml} (100%)
>  create mode 100644 m4/virt-nls.m4
>  create mode 100644 po/Makefile.am
>  create mode 100644 po/POTFILES
>  delete mode 100644 po/POTFILES.in
>  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} (64%)
>  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
>  rename po/{de.po => de.mini.po} (55%)
>  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
>  create mode 100644 po/en_GB.mini.po
>  delete mode 100644 po/en_GB.po
>  create mode 100644 po/eo.mini.po
>  delete mode 100644 po/eo.po
>  rename po/{es.po => es.mini.po} (64%)
>  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} (56%)
>  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
>  create mode 100644 po/hi.mini.po
>  delete mode 100644 po/hi.po
>  create mode 100644 po/hr.mini.po
>  delete mode 100644 po/hr.po
>  rename po/{hu.po => hu.mini.po} (50%)
>  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
>  rename po/{it.po => it.mini.po} (57%)
>  rename po/{ja.po => ja.mini.po} (60%)
>  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 at kkcor.mini.po
>  delete mode 100644 po/kw at kkcor.po
>  create mode 100644 po/kw at uccor.mini.po
>  delete mode 100644 po/kw at 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
>  rename po/{ml.po => ml.mini.po} (51%)
>  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} (64%)
>  create mode 100644 po/pt.mini.po
>  delete mode 100644 po/pt.po
>  rename po/{pt_BR.po => pt_BR.mini.po} (57%)
>  create mode 100644 po/ro.mini.po
>  delete mode 100644 po/ro.po
>  rename po/{ru.po => ru.mini.po} (56%)
>  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 at latin.mini.po
>  delete mode 100644 po/sr at latin.po
>  rename po/{sv.po => sv.mini.po} (58%)
>  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} (69%)
>  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
> 

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the virt-tools-list mailing list