diff --git a/.gitignore b/.gitignore index 0eebb31..e45fe25 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ src/lib/ *.pot POTFILES* tmp/ +/po/LINGUAS diff --git a/Makefile b/Makefile index 37defb7..7b3b841 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,9 @@ po/$(PACKAGE_NAME).metainfo.pot: org.cockpit-project.$(PACKAGE_NAME).metainfo.xm po/$(PACKAGE_NAME).pot: po/$(PACKAGE_NAME).html.pot po/$(PACKAGE_NAME).js.pot po/$(PACKAGE_NAME).manifest.pot po/$(PACKAGE_NAME).metainfo.pot msgcat --sort-output --output-file=$@ $^ +po/LINGUAS: + echo $(LINGUAS) | tr ' ' '\n' > $@ + # Update translations against current PO template update-po: po/$(PACKAGE_NAME).pot for lang in $(LINGUAS); do \ @@ -68,12 +71,15 @@ watch: clean: rm -rf dist/ rm -f $(SPEC) + rm -f po/LINGUAS -install: $(WEBPACK_TEST) +install: $(WEBPACK_TEST) po/LINGUAS mkdir -p $(DESTDIR)/usr/share/cockpit/$(PACKAGE_NAME) cp -r dist/* $(DESTDIR)/usr/share/cockpit/$(PACKAGE_NAME) mkdir -p $(DESTDIR)/usr/share/metainfo/ - cp org.cockpit-project.$(PACKAGE_NAME).metainfo.xml $(DESTDIR)/usr/share/metainfo/ + msgfmt --xml -d po \ + --template org.cockpit-project.$(PACKAGE_NAME).metainfo.xml \ + -o $(DESTDIR)/usr/share/metainfo/org.cockpit-project.$(PACKAGE_NAME).metainfo.xml # this requires a built source tree and avoids having to install anything system-wide devel-install: $(WEBPACK_TEST) diff --git a/packaging/cockpit-starter-kit.spec.in b/packaging/cockpit-starter-kit.spec.in index 7a0093c..8afadd9 100644 --- a/packaging/cockpit-starter-kit.spec.in +++ b/packaging/cockpit-starter-kit.spec.in @@ -10,6 +10,10 @@ BuildArch: noarch BuildRequires: nodejs BuildRequires: make BuildRequires: libappstream-glib +BuildRequires: gettext +%if 0%{?rhel} && 0%{?rhel} <= 8 +BuildRequires: libappstream-glib-devel +%endif Requires: cockpit-system