Sha256: e7a59bdf9599a93eda8d609972689962cc9d661de1d2a014bb0fa41e8e7c3dec

Contents?: true

Size: 1.66 KB

Versions: 11

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 = hammer-cli-foreman
VERSION = $(shell ruby -e 'require "rubygems";spec = Gem::Specification::load("../hammer_cli_foreman.gemspec");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 $@

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 $(POFILES) ; do \
		sed -i 's/^\("Project-Id-Version: \).*$$/\1$(DOMAIN) $(VERSION)\\n"/' $$f; \
	done

# Extract strings and update the .pot, prepare .edit.po files
extract-strings:
	bundle exec rake gettext:find

# Merge .edit.po into .po
update-po:
	bundle exec rake gettext:find

tx-update: extract-strings tx-pull $(MOFILES)
	git commit -m "i18n - extracting new, pulling from tx" ../locale
	-echo Changes commited!

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
hammer_cli_foreman-0.9.0 locale/Makefile
hammer_cli_foreman-0.8.0 locale/Makefile
hammer_cli_foreman-0.7.0 locale/Makefile
hammer_cli_foreman-0.6.2 locale/Makefile
hammer_cli_foreman-0.6.1 locale/Makefile
hammer_cli_foreman-0.6.0 locale/Makefile
hammer_cli_foreman-0.5.1 locale/Makefile
hammer_cli_foreman-0.5.0 locale/Makefile
hammer_cli_foreman-0.4.0 locale/Makefile
hammer_cli_foreman-0.3.0 locale/Makefile
hammer_cli_foreman-0.2.0 locale/Makefile