diff options
| author | Jochen Dolze <vdr@dolze.de> | 2010-08-01 08:42:12 +0200 |
|---|---|---|
| committer | Jochen Dolze <vdr@dolze.de> | 2010-07-31 22:32:15 +0200 |
| commit | 415f957ea35045b32b96831def310465b35035e1 (patch) | |
| tree | 571819cd67f6d0da19e8d290d65db240473da1fb | |
| parent | 5785295a438e1ddd874f27b0f89b391d7c976fd7 (diff) | |
| download | vdr-plugin-tvonscreen-415f957ea35045b32b96831def310465b35035e1.tar.gz vdr-plugin-tvonscreen-415f957ea35045b32b96831def310465b35035e1.tar.bz2 | |
Added gettext support
| -rw-r--r-- | Makefile | 78 | ||||
| -rw-r--r-- | anyfont.cpp (renamed from anyfont.c) | 0 | ||||
| -rw-r--r-- | config.cpp (renamed from config.c) | 0 | ||||
| -rw-r--r-- | gfxtools.cpp (renamed from gfxtools.c) | 0 | ||||
| -rw-r--r-- | i18n.cpp (renamed from i18n.c) | 0 | ||||
| -rw-r--r-- | magazine.cpp (renamed from magazine.c) | 0 | ||||
| -rw-r--r-- | po/de_DE.po | 98 | ||||
| -rw-r--r-- | search.cpp (renamed from search.c) | 0 | ||||
| -rw-r--r-- | timer.cpp (renamed from timer.c) | 0 | ||||
| -rw-r--r-- | tvonscreen.cpp (renamed from tvonscreen.c) | 4 |
10 files changed, 148 insertions, 32 deletions
@@ -1,30 +1,26 @@ # # Makefile for a Video Disk Recorder plugin # -# $Id: Makefile,v 1.7 2006/06/18 13:59:36 schmitzj Exp $ # The official name of this plugin. # This name will be used in the '-P...' option of VDR to load the plugin. # By default the main source file also carries this name. +# IMPORTANT: the presence of this macro is important for the Make.config +# file. So it must be defined, even if it is not used here! # PLUGIN = tvonscreen ### The version number of this plugin (taken from the main source file): -VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') - -### The version number of VDR's plugin API (taken from VDR's "config.h"): - -APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h) +VERSION = $(shell grep 'static const char \*VERSION *=' $PLUGIN.cpp | awk '{ print $$6 }' | sed -e 's/[";]//g') ### The C++ compiler and options: CXX ?= g++ -CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual +CXXFLAGS ?= -fPIC -g -O2 -Wall -Wextra -Woverloaded-virtual -Wno-parentheses ### The directory environment: -DVBDIR = ../../../../DVB VDRDIR = ../../.. LIBDIR = ../../lib TMPDIR = /tmp @@ -33,9 +29,9 @@ TMPDIR = /tmp -include $(VDRDIR)/Make.config -### The version number of VDR (taken from VDR's "config.h"): +### The version number of VDR's plugin API (taken from VDR's "config.h"): -VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g') +APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h) ### The name of the distribution archive: @@ -44,44 +40,66 @@ PACKAGE = vdr-$(ARCHIVE) ### Includes and Defines (add further entries here): -INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include +INCLUDES += -I$(VDRDIR)/include +INCLUDES += -I.. -DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' -D_GNU_SOURCE +DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' +DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE ### The object files (add further files here): -OBJS = $(PLUGIN).o i18n.o magazine.o anyfont.o config.o gfxtools.o timer.o search.o +OBJS = $(PLUGIN).o anyfont.o config.o gfxtools.o i18n.o magazine.o search.o timer.o + +### The main target: + +all: libvdr-$(PLUGIN).so i18n ### Implicit rules: -%.o: %.c +%.o: %.cpp $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< -# Dependencies: +### Dependencies: -MAKEDEP = g++ -MM -MG +MAKEDEP = $(CXX) -MM -MG DEPFILE = .dependencies $(DEPFILE): Makefile - @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ + @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.cpp) > $@ -include $(DEPFILE) +### Internationalization (I18N): + +PODIR = po +LOCALEDIR = $(VDRDIR)/locale +I18Npo = $(wildcard $(PODIR)/*.po) +I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) +I18Npot = $(PODIR)/$(PLUGIN).pot + +%.mo: %.po + msgfmt -c -o $@ $< + +$(I18Npot): $(wildcard *.cpp *.h) + xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<see README>' -o $@ $^ + +%.po: $(I18Npot) + msgmerge -U --no-wrap --no-location --backup=none -q $@ $< + @touch $@ + +$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo + @mkdir -p $(dir $@) + cp $< $@ + +.PHONY: i18n +i18n: $(I18Nmsgs) $(I18Npot) + ### Targets: -all: libvdr-$(PLUGIN).so +install: libvdr-$(PLUGIN).so: $(OBJS) - $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@ - @cp $@ $(LIBDIR)/$@.$(APIVERSION) - -dist: clean - @-rm -rf $(TMPDIR)/$(ARCHIVE) - @mkdir $(TMPDIR)/$(ARCHIVE) - @cp -a * $(TMPDIR)/$(ARCHIVE) - @rm -rf `find $(TMPDIR)/$(ARCHIVE) -name CVS -print` - @tar czf $(PACKAGE).tar.gz -C $(TMPDIR) $(ARCHIVE) - @-rm -rf $(TMPDIR)/$(ARCHIVE) - @echo Distribution package created as $(PACKAGE).tgz + $(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -o $@ + @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION) clean: - @-rm -f $(OBJS) $(DEPFILE) *.so *.tar.gz core* *~ + @-rm -f $(OBJS) $(DEPFILE) *.so *.so.* *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot diff --git a/gfxtools.c b/gfxtools.cpp index a7f4dca..a7f4dca 100644 --- a/gfxtools.c +++ b/gfxtools.cpp diff --git a/magazine.c b/magazine.cpp index 8dcf801..8dcf801 100644 --- a/magazine.c +++ b/magazine.cpp diff --git a/po/de_DE.po b/po/de_DE.po new file mode 100644 index 0000000..8b5ef4a --- /dev/null +++ b/po/de_DE.po @@ -0,0 +1,98 @@ +# This file is distributed under the same license as the tvonscreen package. +# +msgid "" +msgstr "" +"Project-Id-Version: vdr\n" +"Report-Msgid-Bugs-To: <see README>\n" +"POT-Creation-Date: 2010-08-01 13:08+0200\n" +"PO-Revision-Date: 2010-07-31 19:58+0200\n" +"Last-Translator: Jochen Dolze <vdr@dolze.de>\n" +"Language-Team: <vdr@linuxtv.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "show channel logos" +msgstr "zeige Kanal-Logos" + +msgid "show channel names" +msgstr "zeige Kanal-Namen" + +msgid "show logos in black&white" +msgstr "zeige Kanal-Logos in Schwarz/Weiß" + +msgid "enable color problem work around" +msgstr "Farbproblem Umgehung aktivieren" + +msgid "use XL fonts" +msgstr "benutze XL Schrift" + +msgid "hide info line" +msgstr "verstecke Info Zeile" + +msgid "user point in time 1 (Key 4)" +msgstr "Anwenderzeitpunkt 1 (Taste 4)" + +msgid "user point in time 2 (Key 5)" +msgstr "Anwenderzeitpunkt 2 (Taste 5)" + +msgid "user point in time 3 (Key 6)" +msgstr "Anwenderzeitpunkt 3 (Taste 6)" + +msgid "jump to next day point if ago" +msgstr "Gehe zum nächsten Tag wenn vorbei" + +msgid "Show search item itself" +msgstr "Zeige auch Suchbegriff" + +msgid "Press 1 for help" +msgstr "Für Hilfe die 1 drücken" + +#, c-format +msgid "%d-%m" +msgstr "%d-%m" + +msgid "o'clock" +msgstr "Uhr" + +msgid "Timer conflict!" +msgstr "Timer Konflikt!" + +msgid "Added AutoTimer to vdradmin." +msgstr "AutoTimer in vdradmin aufgenommen" + +msgid "Startoption 'vdradminfile' not set!" +msgstr "Startoption 'vdradminfile' nicht gesetzt!" + +msgid "Search" +msgstr "Suchen" + +msgid "Search for" +msgstr "Suche nach" + +msgid "Searching..." +msgstr "Suchen..." + +msgid "Record" +msgstr "Aufnehmen" + +msgid "Details" +msgstr "Details" + +msgid "in all" +msgstr "in allen" + +msgid "Back" +msgstr "Zurück" + +msgid "Nothing found!" +msgstr "Nichts gefunden!" + +msgid "AutoTimer" +msgstr "AutoTimer" + +msgid "Shows the EPG info in form of a typical TV magazine" +msgstr "Zeigt EPG Infos in Form einer TV Zeitschrift" + +msgid "TV-OnScreen" +msgstr "TV-OnScreen" diff --git a/tvonscreen.c b/tvonscreen.cpp index afce3f2..501f5a4 100644 --- a/tvonscreen.c +++ b/tvonscreen.cpp @@ -13,8 +13,8 @@ #include "i18n.h" static const char *VERSION = "1.0.141"; -static const char *DESCRIPTION = "Shows the EPG info in form of a typical TV magazine"; -static const char *MAINMENUENTRY = "TV-OnScreen"; +static const char *DESCRIPTION = trNOOP("Shows the EPG info in form of a typical TV magazine"); +static const char *MAINMENUENTRY = trNOOP("TV-OnScreen"); class cPluginTvOnscreen : public cPlugin { private: |
