summaryrefslogtreecommitdiff
path: root/newplugin
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2007-08-11 12:39:06 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2007-08-11 12:39:06 +0200
commit0f7a4af1683abfe892cb6d05536818a964d8cfe6 (patch)
tree13bb325aa8f5b390db1227c7875b0e406a43efec /newplugin
parent5b8fe34a0e8398a901eebe42c9385622d9bd7a22 (diff)
downloadvdr-0f7a4af1683abfe892cb6d05536818a964d8cfe6.tar.gz
vdr-0f7a4af1683abfe892cb6d05536818a964d8cfe6.tar.bz2
Switched I18N to gettext
Diffstat (limited to 'newplugin')
-rwxr-xr-xnewplugin33
1 files changed, 29 insertions, 4 deletions
diff --git a/newplugin b/newplugin
index 30622868..ff14982a 100755
--- a/newplugin
+++ b/newplugin
@@ -12,7 +12,7 @@
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
-# $Id: newplugin 1.32 2007/04/28 14:46:39 kls Exp $
+# $Id: newplugin 1.33 2007/08/10 15:54:46 kls Exp $
$PLUGIN_NAME = $ARGV[0] || die "Usage: newplugin <name>\n";
@@ -109,7 +109,7 @@ OBJS = \$(PLUGIN).o
%.o: %.c
\$(CXX) \$(CXXFLAGS) -c \$(DEFINES) \$(INCLUDES) \$<
-# Dependencies:
+### Dependencies:
MAKEDEP = \$(CXX) -MM -MG
DEPFILE = .dependencies
@@ -118,9 +118,34 @@ DEPFILE = .dependencies
-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='<see README>' -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/\$(PLUGIN).mo;\\
+ done
+
### Targets:
-all: libvdr-\$(PLUGIN).so
+all: libvdr-\$(PLUGIN).so i18n
libvdr-\$(PLUGIN).so: \$(OBJS)
\$(CXX) \$(CXXFLAGS) -shared \$(OBJS) -o \$\@
@@ -135,7 +160,7 @@ dist: clean
\@echo Distribution package created as \$(PACKAGE).tgz
clean:
- \@-rm -f \$(OBJS) \$(DEPFILE) *.so *.tgz core* *~
+ \@-rm -f \$(OBJS) \$(DEPFILE) *.so *.tgz core* *~ \$(PODIR)/*.mo \$(PODIR)/*.pot
};
$MAIN = qq