Sha256: 71c930f81ee01bb34346395d0e2cdf75534724a730120649b3f589a96f02beef

Contents?: true

Size: 1.9 KB

Versions: 88

Compression:

Stored size: 1.9 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 = $(shell ruby -rrubygems -e 'puts Gem::Specification::load(Dir.glob("../*.gemspec")[0]).name')
VERSION = $(shell ruby -rrubygems -e 'puts Gem::Specification::load(Dir.glob("../*.gemspec")[0]).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))
JSFILES = $(shell find ../app/assets/javascripts/*/locale -name '$(DOMAIN).js')

%.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)
	cd .. && tx pull -f --all
	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
	@echo then run rake plugin:po_to_json[$(DOMAIN)] from the Foreman installation
	@echo then run make -C locale mo-files to finish
	@echo

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

Version data entries

88 entries across 88 versions & 15 rubygems

Version Path
foreman_rh_cloud-9.0.59 locale/Makefile
foreman_virt_who_configure-0.5.25 locale/Makefile
foreman_rh_cloud-11.0.2 locale/Makefile
foreman_scc_manager-4.0.0 locale/Makefile
foreman_scc_manager-3.1.1 locale/Makefile
foreman_rh_cloud-11.0.1 locale/Makefile
foreman_remote_execution-13.2.6 locale/Makefile
foreman_rh_cloud-11.0.0 locale/Makefile
foreman_virt_who_configure-0.5.24 locale/Makefile
foreman_google-3.0.0 locale/Makefile
foreman_azure_rm-3.0.0 locale/Makefile
foreman_rh_cloud-9.0.58 locale/Makefile
foreman_openscap-10.0.0 locale/Makefile
foreman_puppet-8.0.0 locale/Makefile
foreman_leapp-2.0.0 locale/Makefile
foreman_bootdisk-22.0.0 locale/Makefile
foreman_salt-17.0.0 locale/Makefile
foreman_theme_satellite-14.0.1 locale/Makefile
foreman_theme_satellite-14.0.0 locale/Makefile
foreman_ansible-15.0.0 locale/Makefile