Sha256: 53cf91e5531e9d75e02972f7112abe7c9c5d33ddf0049d48a3521c737904eb2e

Contents?: true

Size: 1.72 KB

Versions: 51

Compression:

Stored size: 1.72 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 = redhat_access
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')
MOFILES = $(patsubst %.po,%.mo,$(POFILES))
POXFILES = $(patsubst %.po,%.pox,$(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)
	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 -f
	for f in $(POFILES) ; 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 reset-po $(MOFILES)
	# amend mo files
	git add ../locale/*/LC_MESSAGES
	git commit -a --amend -m "i18n - pulling from tx"
	-echo Changes commited!

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
redhat_access-2.9.1 locale/Makefile
redhat_access-2.8.1 locale/Makefile
redhat_access-2.2.20 locale/Makefile
redhat_access-2.2.19 locale/Makefile
redhat_access-2.2.18 locale/Makefile
redhat_access-2.2.17 locale/Makefile
redhat_access-2.2.16 locale/Makefile
redhat_access-2.2.15 locale/Makefile
redhat_access-2.2.14 locale/Makefile
redhat_access-2.2.13 locale/Makefile
redhat_access-2.2.12 locale/Makefile
redhat_access-2.2.11 locale/Makefile
redhat_access-2.2.10 locale/Makefile
redhat_access-2.2.9 locale/Makefile
redhat_access-2.2.8 locale/Makefile
redhat_access-2.2.7 locale/Makefile
redhat_access-2.1.10 locale/Makefile
redhat_access-2.0.17 locale/Makefile
redhat_access-2.0.16 locale/Makefile
redhat_access-2.1.9 locale/Makefile