kexec-tools/po/Makefile
Dave Young 7f92db4f60 Cleanup and recreate po files
Resolves: bz859783

Old po/ folder are not well maintained. All po files are just
same as the outdated pot file.

Translating team need kexec-tools to update it to
the conventional mode so it become available for translating.

Currently old translated po files are not maintained in git.
Instead it's a kexec-tools-po.tar.gz in dist git server.
see kexec-tools.spec: Source13. This patch will maintain them
in po/ and update the contents from lastest source code.

The refresh include below items:
1. update pot file from latest source code.
2. merge old translated po files with the new pot file
3. maintain translated po files in po/ folder
Also updated the Makefile to make the process more easier.

Usage after the update is like below:
a) simple `make` will generate the mo files for installation
b) `make install` will install mo files to locale directory
Above two command are used in rpm spec to install mo files

c) `make merge` will update pot file from source code and merge
translated po files with latest pot file. So it become ready for
translation team to translate

For kexec-tools maintaining, what we need to do is:
Once firstboot_kdump.py is modifed, we should run `make merge`
to update the po files for translation
After po files get translated they need to be copied to po/
and commit to git. Then create a kexec-tools-po.tar.gz and
upload the tar.gz to dist git, also update the checksum in spec
file.
2012-11-30 17:34:16 +08:00

56 lines
1.3 KiB
Makefile

#
# Makefile for the PO files (translation) catalog
#
# $Id: Makefile,v 1.1.1.1 2007/03/08 02:27:37 ccheng Exp $
# What is this package?
NLSPACKAGE = kexec-tools
POTFILE = $(NLSPACKAGE).pot
INSTALL = /usr/bin/install -c
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_DIR = /usr/bin/install -d
# destination directory
INSTALL_NLS_DIR = $(DESTDIR)/usr/share/locale
# PO catalog handling
MSGMERGE = msgmerge -v --update
XGETTEXT = xgettext --default-domain=$(NLSPACKAGE) \
--add-comments
MSGFMT = msgfmt --statistics --verbose
# What do we need to do
POFILES = $(wildcard *.po)
MOFILES = $(patsubst %.po,%.mo,$(POFILES))
PYSRC = $(wildcard ../*.py)
SRCFILES = $(PYSRC)
#default:: clean
all:: $(MOFILES)
clean:
@rm -fv *mo *~ .depend
install: $(MOFILES)
@for n in $(MOFILES); do \
l=`basename $$n .mo`; \
$(INSTALL_DIR) $(INSTALL_NLS_DIR)/$$l/LC_MESSAGES; \
$(INSTALL_DATA) --verbose $$n $(INSTALL_NLS_DIR)/$$l/LC_MESSAGES/$(NLSPACKAGE).mo; \
done
%.mo: %.po
$(MSGFMT) -o $@ $<
$(POTFILE): $(SRCFILES)
$(XGETTEXT) --output=$(POTFILE) $(SRCFILES)
merge: $(POTFILE) $(POFILES)
for file in $(POFILES); do \
base=`basename $$file`; \
echo "$(MSGMERGE) $$base $(NLSPACKAGE).pot"; \
$(MSGMERGE) $$base $(NLSPACKAGE).pot; \
done
.PHONY: missing depend