locale/Makefile in foreman_bootdisk-6.1.0 vs locale/Makefile in foreman_bootdisk-7.0.0
- old
+ new
@@ -8,13 +8,14 @@
#
DOMAIN = foreman_bootdisk
VERSION = $(shell ruby -e 'require "rubygems";spec = Gem::Specification::load(Dir.glob("../*.gemspec")[0]);puts spec.version')
POTFILE = $(DOMAIN).pot
MOFILE = $(DOMAIN).mo
-POFILES = $(shell find . -name '*.po')
+POFILES = $(shell find . -name '$(DOMAIN).po')
MOFILES = $(patsubst %.po,%.mo,$(POFILES))
POXFILES = $(patsubst %.po,%.pox,$(POFILES))
+EDITFILES = $(patsubst %.po,%.edit.po,$(POFILES))
%.mo: %.po
mkdir -p $(shell dirname $@)/LC_MESSAGES
msgfmt -o $(shell dirname $@)/LC_MESSAGES/$(MOFILE) $<
@@ -27,36 +28,33 @@
pofilter --nofuzzy -t variables -t blank -t urls -t emails -t long -t newlines \
-t endwhitespace -t endpunc -t puncspacing -t options -t printf -t validchars --gnome $< > $@
cat $@
! grep -q msgid $@
+%.edit.po:
+ touch $@
+
check: $(POXFILES)
- msgfmt -c ${POTFILE}
-# Merge PO files
-update-po:
- for f in $(shell find ./ -name "*.po") ; do \
- msgmerge -N --backup=none -U $$f ${POTFILE} ; \
- done
-
# Unify duplicate translations
uniq-po:
for f in $(shell find ./ -name "*.po") ; do \
msguniq $$f -o $$f ; \
done
-tx-pull:
+tx-pull: $(EDITFILES)
tx pull -f
- for f in $(POFILES) ; do \
+ for f in $(EDITFILES) ; do \
sed -i 's/^\("Project-Id-Version: \).*$$/\1$(DOMAIN) $(VERSION)\\n"/' $$f; \
done
- -git commit -a -m "i18n - pulling from tx"
-reset-po:
- # merging po files is unnecessary when using transifex.com
- git checkout -- ../locale/*/*po
+tx-update: tx-pull
+ @echo
+ @echo Run rake plugin:gettext[$(DOMAIN)] from the Foreman installation, then make -C locale mo-files to finish
+ @echo
-tx-update: tx-pull reset-po $(MOFILES)
- # amend mo files
- git add ../locale/*/LC_MESSAGES
- git commit -a --amend -m "i18n - pulling from tx"
- -echo Changes commited!
+mo-files: $(MOFILES)
+ git add $(POFILES) $(POTFILE) ../locale/*/LC_MESSAGES
+ git commit -m "i18n - pulling from tx"
+ @echo
+ @echo Changes commited!
+ @echo