A .mini.po file is exactly the same format as a .po file. We just used the alternative extension as we wanted to be able to store both full and minimized forms in the same directory. This complicates integration with some translation tools, however, which only really expect to see $LANG.po as a filename. With this change we drop the rules for creating non-minimized po files, and thus the po/*.po are always minimized. A useful side effect is that we no longer run msgmerge during creation of the gmo files, and thus don't need to have a date override to get reproducible builds. Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx> --- po/Makefile.am | 29 +++++++--------------------- po/{as.mini.po => as.po} | 0 po/{bg.mini.po => bg.po} | 0 po/{bn_IN.mini.po => bn_IN.po} | 0 po/{bs.mini.po => bs.po} | 0 po/{ca.mini.po => ca.po} | 0 po/{cs.mini.po => cs.po} | 0 po/{da.mini.po => da.po} | 0 po/{de.mini.po => de.po} | 0 po/{el.mini.po => el.po} | 0 po/{en_GB.mini.po => en_GB.po} | 0 po/{es.mini.po => es.po} | 0 po/{fi.mini.po => fi.po} | 0 po/{fr.mini.po => fr.po} | 0 po/{gu.mini.po => gu.po} | 0 po/{hi.mini.po => hi.po} | 0 po/{hu.mini.po => hu.po} | 0 po/{id.mini.po => id.po} | 0 po/{it.mini.po => it.po} | 0 po/{ja.mini.po => ja.po} | 0 po/{kn.mini.po => kn.po} | 0 po/{ko.mini.po => ko.po} | 0 po/{mk.mini.po => mk.po} | 0 po/{ml.mini.po => ml.po} | 0 po/{mr.mini.po => mr.po} | 0 po/{ms.mini.po => ms.po} | 0 po/{nb.mini.po => nb.po} | 0 po/{nl.mini.po => nl.po} | 0 po/{or.mini.po => or.po} | 0 po/{pa.mini.po => pa.po} | 0 po/{pl.mini.po => pl.po} | 0 po/{pt.mini.po => pt.po} | 0 po/{pt_BR.mini.po => pt_BR.po} | 0 po/{ru.mini.po => ru.po} | 0 po/{sr.mini.po => sr.po} | 0 po/{sr@xxxxxxxxxxxxx => sr@xxxxxxxx} | 0 po/{sv.mini.po => sv.po} | 0 po/{ta.mini.po => ta.po} | 0 po/{te.mini.po => te.po} | 0 po/{uk.mini.po => uk.po} | 0 po/{vi.mini.po => vi.po} | 0 po/{zh_CN.mini.po => zh_CN.po} | 0 po/{zh_TW.mini.po => zh_TW.po} | 0 43 files changed, 7 insertions(+), 22 deletions(-) rename po/{as.mini.po => as.po} (100%) rename po/{bg.mini.po => bg.po} (100%) rename po/{bn_IN.mini.po => bn_IN.po} (100%) rename po/{bs.mini.po => bs.po} (100%) rename po/{ca.mini.po => ca.po} (100%) rename po/{cs.mini.po => cs.po} (100%) rename po/{da.mini.po => da.po} (100%) rename po/{de.mini.po => de.po} (100%) rename po/{el.mini.po => el.po} (100%) rename po/{en_GB.mini.po => en_GB.po} (100%) rename po/{es.mini.po => es.po} (100%) rename po/{fi.mini.po => fi.po} (100%) rename po/{fr.mini.po => fr.po} (100%) rename po/{gu.mini.po => gu.po} (100%) rename po/{hi.mini.po => hi.po} (100%) rename po/{hu.mini.po => hu.po} (100%) rename po/{id.mini.po => id.po} (100%) rename po/{it.mini.po => it.po} (100%) rename po/{ja.mini.po => ja.po} (100%) rename po/{kn.mini.po => kn.po} (100%) rename po/{ko.mini.po => ko.po} (100%) rename po/{mk.mini.po => mk.po} (100%) rename po/{ml.mini.po => ml.po} (100%) rename po/{mr.mini.po => mr.po} (100%) rename po/{ms.mini.po => ms.po} (100%) rename po/{nb.mini.po => nb.po} (100%) rename po/{nl.mini.po => nl.po} (100%) rename po/{or.mini.po => or.po} (100%) rename po/{pa.mini.po => pa.po} (100%) rename po/{pl.mini.po => pl.po} (100%) rename po/{pt.mini.po => pt.po} (100%) rename po/{pt_BR.mini.po => pt_BR.po} (100%) rename po/{ru.mini.po => ru.po} (100%) rename po/{sr.mini.po => sr.po} (100%) rename po/{sr@xxxxxxxxxxxxx => sr@xxxxxxxx} (100%) rename po/{sv.mini.po => sv.po} (100%) rename po/{ta.mini.po => ta.po} (100%) rename po/{te.mini.po => te.po} (100%) rename po/{uk.mini.po => uk.po} (100%) rename po/{vi.mini.po => vi.po} (100%) rename po/{zh_CN.mini.po => zh_CN.po} (100%) rename po/{zh_TW.mini.po => zh_TW.po} (100%) diff --git a/po/Makefile.am b/po/Makefile.am index ce9338aa94..224f16e993 100644 --- a/po/Makefile.am +++ b/po/Makefile.am @@ -11,16 +11,15 @@ POTFILES: $(POTFILES_IN) $(SED) 's|[@]BUILDDIR[@]|$(top_builddir)|' > $@ POTFILE_DEPS = $(shell cat POTFILES) POTFILE := $(DOMAIN).pot -POMINIFILES := $(LANGS:%=%.mini.po) POFILES := $(LANGS:%=%.po) GMOFILES := $(LANGS:%=%.gmo) -CLEANFILES = $(POTFILE) $(POFILES) $(GMOFILES) POTFILES +CLEANFILES = $(POTFILE) $(GMOFILES) POTFILES EXTRA_DIST = \ LINGUAS \ $(POTFILES_IN) \ - $(POMINIFILES) + $(POFILES) if HAVE_GNU_GETTEXT_TOOLS @@ -35,33 +34,23 @@ XGETTEXT_ARGS = \ --msgid-bugs-address="$(MSGID_BUGS_ADDRESS)" \ $(NULL) -POT_CREATION_DATE = $(shell \ - if test -n "$$SOURCE_DATE_EPOCH"; \ - then \ - date --date="@$$SOURCE_DATE_EPOCH" +"%F %R%z"; \ - else \ - date +'%F %R%z'; \ - fi) - SED_PO_FIXUP_ARGS = \ -e "s|text/plain; charset=CHARSET|text/plain; charset=UTF-8|g" \ -e "s|SOME DESCRIPTIVE TITLE|Libvirt package strings|g" \ -e "s|Copyright (C) YEAR|Copyright (C) $$(date +'%Y')|" \ - -e "s|POT-Creation-Date:[^\]*|POT-Creation-Date: $(POT_CREATION_DATE)|" \ $(NULL) -update-po: $(POFILES) - update-gmo: $(GMOFILES) -update-mini-po: $(POTFILE) +update-po: $(POTFILE) for lang in $(LANGS); do \ echo "Minimizing $$lang content" && \ $(MSGMERGE) --no-location --no-fuzzy-matching --sort-output \ $$lang.po $(POTFILE) | \ $(SED) $(SED_PO_FIXUP_ARGS) | \ $(RUNUTF8) $(PYTHON) $(top_srcdir)/scripts/minimize-po.py > \ - $(srcdir)/$$lang.mini.po ; \ + $(srcdir)/$$lang.po-t && \ + mv $$lang.po-t $$lang.po done push-pot: $(POTFILE) @@ -77,7 +66,7 @@ pull-po: $(POTFILE) --create-skeletons \ --transdir $(builddir) \ --srcdir $(srcdir) - $(MAKE) update-mini-po + $(MAKE) update-po $(MAKE) update-gmo $(POTFILE): POTFILES $(POTFILE_DEPS) @@ -86,16 +75,12 @@ $(POTFILE): POTFILES $(POTFILE_DEPS) $(SED) $(SED_PO_FIXUP_ARGS) < $@-t > $@ rm -f $@-t -%.po: %.mini.po $(POTFILE) - $(MSGMERGE) --no-fuzzy-matching $< $(POTFILE) | \ - $(SED) $(SED_PO_FIXUP_ARGS) > $@ - %.gmo: %.po rm -f $@ $@-t $(MSGFMT) -c -o $@-t $< mv $@-t $@ -.PRECIOUS: $(POTFILE) $(POFILES) +.PRECIOUS: $(POTFILE) endif HAVE_GNU_GETTEXT_TOOLS diff --git a/po/as.mini.po b/po/as.po similarity index 100% rename from po/as.mini.po rename to po/as.po diff --git a/po/bg.mini.po b/po/bg.po similarity index 100% rename from po/bg.mini.po rename to po/bg.po diff --git a/po/bn_IN.mini.po b/po/bn_IN.po similarity index 100% rename from po/bn_IN.mini.po rename to po/bn_IN.po diff --git a/po/bs.mini.po b/po/bs.po similarity index 100% rename from po/bs.mini.po rename to po/bs.po diff --git a/po/ca.mini.po b/po/ca.po similarity index 100% rename from po/ca.mini.po rename to po/ca.po diff --git a/po/cs.mini.po b/po/cs.po similarity index 100% rename from po/cs.mini.po rename to po/cs.po diff --git a/po/da.mini.po b/po/da.po similarity index 100% rename from po/da.mini.po rename to po/da.po diff --git a/po/de.mini.po b/po/de.po similarity index 100% rename from po/de.mini.po rename to po/de.po diff --git a/po/el.mini.po b/po/el.po similarity index 100% rename from po/el.mini.po rename to po/el.po diff --git a/po/en_GB.mini.po b/po/en_GB.po similarity index 100% rename from po/en_GB.mini.po rename to po/en_GB.po diff --git a/po/es.mini.po b/po/es.po similarity index 100% rename from po/es.mini.po rename to po/es.po diff --git a/po/fi.mini.po b/po/fi.po similarity index 100% rename from po/fi.mini.po rename to po/fi.po diff --git a/po/fr.mini.po b/po/fr.po similarity index 100% rename from po/fr.mini.po rename to po/fr.po diff --git a/po/gu.mini.po b/po/gu.po similarity index 100% rename from po/gu.mini.po rename to po/gu.po diff --git a/po/hi.mini.po b/po/hi.po similarity index 100% rename from po/hi.mini.po rename to po/hi.po diff --git a/po/hu.mini.po b/po/hu.po similarity index 100% rename from po/hu.mini.po rename to po/hu.po diff --git a/po/id.mini.po b/po/id.po similarity index 100% rename from po/id.mini.po rename to po/id.po diff --git a/po/it.mini.po b/po/it.po similarity index 100% rename from po/it.mini.po rename to po/it.po diff --git a/po/ja.mini.po b/po/ja.po similarity index 100% rename from po/ja.mini.po rename to po/ja.po diff --git a/po/kn.mini.po b/po/kn.po similarity index 100% rename from po/kn.mini.po rename to po/kn.po diff --git a/po/ko.mini.po b/po/ko.po similarity index 100% rename from po/ko.mini.po rename to po/ko.po diff --git a/po/mk.mini.po b/po/mk.po similarity index 100% rename from po/mk.mini.po rename to po/mk.po diff --git a/po/ml.mini.po b/po/ml.po similarity index 100% rename from po/ml.mini.po rename to po/ml.po diff --git a/po/mr.mini.po b/po/mr.po similarity index 100% rename from po/mr.mini.po rename to po/mr.po diff --git a/po/ms.mini.po b/po/ms.po similarity index 100% rename from po/ms.mini.po rename to po/ms.po diff --git a/po/nb.mini.po b/po/nb.po similarity index 100% rename from po/nb.mini.po rename to po/nb.po diff --git a/po/nl.mini.po b/po/nl.po similarity index 100% rename from po/nl.mini.po rename to po/nl.po diff --git a/po/or.mini.po b/po/or.po similarity index 100% rename from po/or.mini.po rename to po/or.po diff --git a/po/pa.mini.po b/po/pa.po similarity index 100% rename from po/pa.mini.po rename to po/pa.po diff --git a/po/pl.mini.po b/po/pl.po similarity index 100% rename from po/pl.mini.po rename to po/pl.po diff --git a/po/pt.mini.po b/po/pt.po similarity index 100% rename from po/pt.mini.po rename to po/pt.po diff --git a/po/pt_BR.mini.po b/po/pt_BR.po similarity index 100% rename from po/pt_BR.mini.po rename to po/pt_BR.po diff --git a/po/ru.mini.po b/po/ru.po similarity index 100% rename from po/ru.mini.po rename to po/ru.po diff --git a/po/sr.mini.po b/po/sr.po similarity index 100% rename from po/sr.mini.po rename to po/sr.po diff --git a/po/sr@xxxxxxxxxxxxx b/po/sr@xxxxxxxx similarity index 100% rename from po/sr@xxxxxxxxxxxxx rename to po/sr@xxxxxxxx diff --git a/po/sv.mini.po b/po/sv.po similarity index 100% rename from po/sv.mini.po rename to po/sv.po diff --git a/po/ta.mini.po b/po/ta.po similarity index 100% rename from po/ta.mini.po rename to po/ta.po diff --git a/po/te.mini.po b/po/te.po similarity index 100% rename from po/te.mini.po rename to po/te.po diff --git a/po/uk.mini.po b/po/uk.po similarity index 100% rename from po/uk.mini.po rename to po/uk.po diff --git a/po/vi.mini.po b/po/vi.po similarity index 100% rename from po/vi.mini.po rename to po/vi.po diff --git a/po/zh_CN.mini.po b/po/zh_CN.po similarity index 100% rename from po/zh_CN.mini.po rename to po/zh_CN.po diff --git a/po/zh_TW.mini.po b/po/zh_TW.po similarity index 100% rename from po/zh_TW.mini.po rename to po/zh_TW.po -- 2.26.2