Sha256: 02138755195206818da3059f30faf37e8d49a6a7b04433063e37b650b7e15588

Contents?: true

Size: 1.66 KB

Versions: 18

Compression:

Stored size: 1.66 KB

Contents

#
# Makefile for PO merging and MO generation. More info in the README.
#
# make all-mo (default) - generate MO files
# make check - check translations using translate-tool
# make tx-update - download and merge translations from Transifex
# make clean - clean everything
#
DOMAIN = foreman_yupana
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 '$(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) $<

# Generate MO files from PO files
all-mo: $(MOFILES)

# Check for malformed strings
%.pox: %.po
	msgfmt -c $<
	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)

# Unify duplicate translations
uniq-po:
	for f in $(shell find ./ -name "*.po") ; do \
		msguniq $$f -o $$f ; \
	done

tx-pull: $(EDITFILES)
	tx pull -f
	for f in $(EDITFILES) ; do \
		sed -i 's/^\("Project-Id-Version: \).*$$/\1$(DOMAIN) $(VERSION)\\n"/' $$f; \
	done

tx-update: tx-pull
	@echo
	@echo Run rake plugin:gettext[$(DOMAIN)] from the Foreman installation, then make -C locale mo-files to finish
	@echo

mo-files: $(MOFILES)
	git add $(POFILES) $(POTFILE) ../locale/*/LC_MESSAGES
	git commit -m "i18n - pulling from tx"
	@echo
	@echo Changes commited!
	@echo

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
foreman_inventory_upload-2.0.4.pre.2 locale/Makefile
foreman_inventory_upload-2.0.4.pre.1 locale/Makefile
foreman_inventory_upload-2.0.3 locale/Makefile
foreman_inventory_upload-1.0.3 locale/Makefile
foreman_inventory_upload-0.9.2 locale/Makefile
foreman_inventory_upload-1.0.2 locale/Makefile
foreman_inventory_upload-0.9.1 locale/Makefile
foreman_inventory_upload-1.0.1 locale/Makefile
foreman_inventory_upload-0.9.0 locale/Makefile
foreman_inventory_upload-1.0.0 locale/Makefile
foreman_inventory_upload-1.0.0.beta7 locale/Makefile
foreman_inventory_upload-1.0.0.beta6 locale/Makefile
foreman_inventory_upload-1.0.0.beta5 locale/Makefile
foreman_inventory_upload-1.0.0.beta4 locale/Makefile
foreman_inventory_upload-1.0.0.beta3 locale/Makefile
foreman_inventory_upload-1.0.0.beta2 locale/Makefile
foreman_inventory_upload-1.0.0.beta1 locale/Makefile
foreman_inventory_upload-0.0.1.dev1 locale/Makefile