summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile74
-rw-r--r--i18n.cpp6
-rw-r--r--i18n.h8
-rw-r--r--po/de_DE.po58
-rw-r--r--po/es_ES.po58
-rw-r--r--spider.cpp10
6 files changed, 190 insertions, 24 deletions
diff --git a/Makefile b/Makefile
index 4c0a521..64b237a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,18 +1,36 @@
#
-# Makefile for a Video Disk Recorder plugin
+# Spider-Arachnid: A plugin for the Video Disk Recorder
#
-# $Id: Makefile 23 2006-04-24 23:27:28Z tom $
+# Copyright (C) 2005-2007, Thomas Günther <tom@toms-cafe.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# $Id: Makefile 96 2007-09-23 13:18:41Z tom $
# 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 = spider
### The version number of this plugin (taken from the main source file):
VERSION = $(shell sed -ne '/static .* VERSION *=/s/^.*"\(.*\)".*$$/\1/p' \
- $(PLUGIN).c)
+ $(PLUGIN).cpp)
### The C++ compiler and options:
@@ -42,44 +60,62 @@ PACKAGE = vdr-$(ARCHIVE)
### Includes and Defines (add further entries here):
INCLUDES += -I$(VDRDIR)/include
-
DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
+CXXFLAGS += $(INCLUDES) $(DEFINES)
-### The object files (add further files here):
+### The source and object files
-OBJS = $(PLUGIN).o setup.o i18n.o bitmap.o \
- game.o deck.o tableau.o heap.o history.o
+SRCS = $(wildcard *.cpp)
+OBJS = $(SRCS:%.cpp=%.o)
-### Implicit rules:
+### The main target:
-%.o: %.c
- $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
+all: libvdr-$(PLUGIN).so i18n
-# Dependencies:
+### Dependencies:
-MAKEDEP = $(CXX) -MM -MG
DEPFILE = .dependencies
$(DEPFILE): Makefile
- @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+ @$(CXX) -MM -MG $(SRCS) > $@
-include $(DEPFILE)
-### Targets:
+### Internationalization (I18N):
-all: libvdr-$(PLUGIN).so
+PODIR = po
+LOCALEDIR = $(VDRDIR)/locale
+I18Npo = $(notdir $(wildcard $(PODIR)/*.po))
+I18Npot = $(PODIR)/$(PLUGIN).pot
+
+$(I18Npot): $(SRCS)
+ xgettext -C -cTRANSLATORS --no-wrap -F -k -ktr -ktrNOOP \
+ --msgid-bugs-address='<tom@toms-cafe.de>' -o $@ $^
+
+%.po: $(I18Npot)
+ msgmerge -U --no-wrap -F --backup=none -q $@ $<
+ @touch $@
+
+$(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.po
+ @mkdir -p $(dir $@)
+ msgfmt -c -o $@ $<
+
+.PHONY: i18n
+i18n: $(I18Npo:%.po=$(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo)
+
+### Targets:
libvdr-$(PLUGIN).so: $(OBJS)
- $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
- @cp $@ $(LIBDIR)/$@.$(APIVERSION)
+ $(CXX) $(CXXFLAGS) -shared $^ -o $@
+ @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
dist: clean
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@mkdir $(TMPDIR)/$(ARCHIVE)
@cp -a * $(TMPDIR)/$(ARCHIVE)
@tar czf $(PACKAGE).tgz -C $(TMPDIR) \
- --exclude debian --exclude CVS --exclude .svn $(ARCHIVE)
+ --exclude debian --exclude CVS --exclude .svn $(ARCHIVE)
@-rm -rf $(TMPDIR)/$(ARCHIVE)
@echo Distribution package created as $(PACKAGE).tgz
clean:
- @-rm -f $(OBJS) $(DEPFILE) *.so* *.tgz core* *~
+ @-rm -f $(DEPFILE) *.o *.so $(I18Npot) *.tgz core* *~
diff --git a/i18n.cpp b/i18n.cpp
index cfcf1e3..a85ce5e 100644
--- a/i18n.cpp
+++ b/i18n.cpp
@@ -17,7 +17,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * $Id: i18n.cpp 95 2007-09-21 23:01:10Z tom $
+ * $Id: i18n.cpp 96 2007-09-23 13:18:41Z tom $
*
*
* Translations provided by:
@@ -30,6 +30,8 @@
#include <vdr/config.h>
+#if VDRVERSNUM < 10507
+
const tI18nPhrase SpiderPlugin::Phrases[] = {
{ "Spider Arachnid", // English
"Spider Arachnid", // Deutsch / German
@@ -231,3 +233,5 @@ const tI18nPhrase SpiderPlugin::Phrases[] = {
},
{ NULL }
};
+
+#endif
diff --git a/i18n.h b/i18n.h
index 8f47922..bba3e28 100644
--- a/i18n.h
+++ b/i18n.h
@@ -17,7 +17,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * $Id: i18n.h 95 2007-09-21 23:01:10Z tom $
+ * $Id: i18n.h 96 2007-09-23 13:18:41Z tom $
*/
#ifndef VDR_SPIDER_I18N_H
@@ -28,6 +28,10 @@
#include <vdr/config.h>
+#if VDRVERSNUM < 10507
+
+#define trNOOP(s) (s)
+
namespace SpiderPlugin
{
@@ -35,4 +39,6 @@ namespace SpiderPlugin
} // namespace SpiderPlugin
+#endif
+
#endif // VDR_SPIDER_I18N_H
diff --git a/po/de_DE.po b/po/de_DE.po
new file mode 100644
index 0000000..22f4053
--- /dev/null
+++ b/po/de_DE.po
@@ -0,0 +1,58 @@
+# German translations for vdr-spider package.
+# Copyright (C) 2007 Thomas Günther <tom@toms-cafe.de>
+# This file is distributed under the same license as the vdr-spider package.
+# Thomas Günther <tom@toms-cafe.de>, 2005.
+#
+# $Id$
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vdr-spider 0.1.4\n"
+"Report-Msgid-Bugs-To: <tom@toms-cafe.de>\n"
+"POT-Creation-Date: 2007-09-23 14:56+0200\n"
+"PO-Revision-Date: 2007-09-23 14:56+0200\n"
+"Last-Translator: Thomas Günther <tom@toms-cafe.de>\n"
+"Language-Team: <vdr@linuxtv.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-15\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: game.cpp:190
+msgid "Only complete suits are allowed to remove"
+msgstr "Nur vollständige Sätze können entfernt werden"
+
+#: game.cpp:216
+msgid "No cards left"
+msgstr "Keine Karten übrig"
+
+#: game.cpp:218
+msgid "Deal not allowed with empty piles"
+msgstr "Neue Karten nur, wenn alle Reihen belegt"
+
+#: game.cpp:229
+msgid ""
+"Congratulations!\n"
+"Press OK to start a new game"
+msgstr ""
+"Herzlichen Glückwunsch!\n"
+"OK startet ein neues Spiel"
+
+#: setup.cpp:62
+msgid "Mini (one deck)"
+msgstr "Mini (ein Blatt)"
+
+#: setup.cpp:63
+msgid "Normal"
+msgstr "Normal"
+
+#: setup.cpp:64
+msgid "Variation"
+msgstr "Variante"
+
+#: spider.cpp:40
+msgid "Spider Arachnid - the best patience game"
+msgstr "Spider Arachnid - die beste Patience"
+
+#: spider.cpp:43
+msgid "Spider Arachnid"
+msgstr "Spider Arachnid"
diff --git a/po/es_ES.po b/po/es_ES.po
new file mode 100644
index 0000000..3f1ea29
--- /dev/null
+++ b/po/es_ES.po
@@ -0,0 +1,58 @@
+# Spanish translations for vdr-spider package.
+# Copyright (C) 2007 Thomas Günther <tom@toms-cafe.de>
+# This file is distributed under the same license as the vdr-spider package.
+# bittor from open7x0.org, 2007.
+#
+# $Id$
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vdr-spider 0.1.4\n"
+"Report-Msgid-Bugs-To: <tom@toms-cafe.de>\n"
+"POT-Creation-Date: 2007-09-23 14:56+0200\n"
+"PO-Revision-Date: 2007-09-23 14:56+0200\n"
+"Last-Translator: bittor from open7x0.org, 2007\n"
+"Language-Team: <vdr@linuxtv.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-15\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: game.cpp:190
+msgid "Only complete suits are allowed to remove"
+msgstr "Sólo puede eliminar los palos completos"
+
+#: game.cpp:216
+msgid "No cards left"
+msgstr "No dejó cartas"
+
+#: game.cpp:218
+msgid "Deal not allowed with empty piles"
+msgstr "Reparto no permitido con montones vacíos"
+
+#: game.cpp:229
+msgid ""
+"Congratulations!\n"
+"Press OK to start a new game"
+msgstr ""
+"¡Felicidades!\n"
+"Pulse OK para iniciar un nuevo juego"
+
+#: setup.cpp:62
+msgid "Mini (one deck)"
+msgstr "Mini (una baraja)"
+
+#: setup.cpp:63
+msgid "Normal"
+msgstr "Normal"
+
+#: setup.cpp:64
+msgid "Variation"
+msgstr "Variación"
+
+#: spider.cpp:40
+msgid "Spider Arachnid - the best patience game"
+msgstr "Spider Arachnid - mejor juego paciencia"
+
+#: spider.cpp:43
+msgid "Spider Arachnid"
+msgstr "Spider Arachnid"
diff --git a/spider.cpp b/spider.cpp
index 75e6d53..caaa0cc 100644
--- a/spider.cpp
+++ b/spider.cpp
@@ -17,7 +17,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * $Id: spider.cpp 95 2007-09-21 23:01:10Z tom $
+ * $Id: spider.cpp 96 2007-09-23 13:18:41Z tom $
*/
#include "spider.h"
@@ -25,6 +25,7 @@
#include "setup.h"
#include "i18n.h"
#include <vdr/plugin.h>
+#include <vdr/config.h>
/** 'Spider Arachnid' is a VDR plugin implementation of a patience game. */
@@ -35,10 +36,11 @@ namespace SpiderPlugin
static const char* VERSION = "0.1.4";
/** Short description of the plugin's purpose */
- static const char* DESCRIPTION = "Spider Arachnid - the best patience game";
+ static const char* DESCRIPTION =
+ trNOOP("Spider Arachnid - the best patience game");
/** Name of the entry in VDR's main menu */
- static const char* MAINMENUENTRY = "Spider Arachnid";
+ static const char* MAINMENUENTRY = trNOOP("Spider Arachnid");
//--- class SpiderPlugin::Plugin ---------------------------------------------
@@ -86,7 +88,9 @@ using namespace SpiderPlugin;
*/
bool Plugin::Start()
{
+#if VDRVERSNUM < 10507
RegisterI18n(Phrases);
+#endif
return true;
}