From f9472b1e58f206defb77c5caf55fcef1618829ba Mon Sep 17 00:00:00 2001 From: Andreas Brachold Date: Wed, 22 Aug 2007 09:27:33 +0000 Subject: - begin developer series 0.3.x - Use now gettext for i18n texts, introduced with vdr-1.5.8 (Required) --- Makefile | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1963e1e..b5b247f 100644 --- a/Makefile +++ b/Makefile @@ -121,7 +121,7 @@ endif ### The object files (add further files here): -OBJS = ${PLUGIN}.o i18n.o data.o menu.o data-image.o menu-image.o \ +OBJS = ${PLUGIN}.o data.o menu.o data-image.o menu-image.o \ setup-image.o player-image.o control-image.o commands.o menu-commands.o \ list.o @@ -148,9 +148,34 @@ $(DEPFILE): Makefile -include $(DEPFILE) +### Internationalization (I18N): + +PODIR = po +LOCALEDIR = $(VDRDIR)/locale +I18Npo = $(wildcard $(PODIR)/*.po) +I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) +I18Ndirs = $(notdir $(foreach file, $(I18Npo), $(basename $(file)))) +I18Npot = $(PODIR)/$(PLUGIN).pot + +%.mo: %.po + msgfmt -c -o $@ $< + +$(I18Npot): $(wildcard *.c) + xgettext -C -cTRANSLATORS --no-wrap -F -k -ktr -ktrNOOP --msgid-bugs-address='' -o $@ $(wildcard *.c) + +$(I18Npo): $(I18Npot) + msgmerge -U --no-wrap -F --backup=none -q $@ $< + +i18n: $(I18Nmo) + @mkdir -p $(LOCALEDIR) + for i in $(I18Ndirs); do\ + mkdir -p $(LOCALEDIR)/$$i/LC_MESSAGES;\ + cp $(PODIR)/$$i.mo $(LOCALEDIR)/$$i/LC_MESSAGES/vdr-$(PLUGIN).mo;\ + done + ### Targets: -all: subdirs libvdr-$(PLUGIN).so +all: subdirs libvdr-$(PLUGIN).so i18n libvdr-$(PLUGIN).so: $(OBJS) $(CXX) $(CXXFLAGS) -shared -export-dynamic $(OBJS) $(LIBS) -o $@ @@ -189,4 +214,5 @@ subdirs-clean: done clean: subdirs-clean + @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot @-rm -f $(OBJS) $(DEPFILE) *.so *.tar.gz core* *~ contrib/*~ examples/*~ scripts/*~ -- cgit v1.2.3