summaryrefslogtreecommitdiff
path: root/plugins/text2skin/text2skin-1.1-cvs-locale.diff
blob: 22ff48cb338422115dc9c4d613297ccc430887af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
#! /bin/sh /usr/share/dpatch/dpatch-run
## 95_text2skin-1.1-cvs-locale.dpatch by Thomas Günther <tom@toms-cafe.de>
## http://toms-cafe.de/vdr/download/text2skin-1.1-cvs-locale.diff
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Locales for text2skin plug-in (VDR >= 1.5.7, skins + locale patch).
## DP: Bases on cvs snapshot from 2008-01-22 22:30:00Z + 2 patches:
## DP: - libfreetype6-2.2.1.diff by Jerome <jlacvdr@jlac.dyndns.org>
## DP:   http://vdrportal.de/board/thread.php?postid=489175#post489175
## DP: - text2skin-1.1-cvs_ext-0.10-vdr-1.5.4.diff by Stone <syphyr@gmail.com>
## DP:   http://vdrportal.de/board/thread.php?postid=621984#post621984
## DP: The skins have to be patched, too:
## DP: - DeepBlue (http://vdr.pfroen.de)
## DP:   http://toms-cafe.de/vdr/download/deepblue-0.1.4-locale.diff
## DP: - Enigma (http://home.pages.at/brougs78/vdr_enigma.htm)
## DP:   http://toms-cafe.de/vdr/download/enigma-0.3a-locale.diff
## DP: - enElchi (http://www.saunalahti.fi/~rahrenbe/vdr/soppalusikka/files/)
## DP:   http://toms-cafe.de/vdr/download/enelchi-0.7.2-locale.diff
## DP: - to patch other skins the Makefile from these patches could be used
## DP:   without any changes, missing translation entries should be added to
## DP:   the *.skin file (e.g. as comments <!-- trans('Volume') -->)

@DPATCH@
--- text2skin-1.0+cvs20080122.2311/Makefile
+++ text2skin-1.0+cvs20080122.2311/Makefile
@@ -19,6 +19,8 @@
 # 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 = text2skin
 
@@ -29,28 +31,28 @@
 ### The C++ compiler and options:
 
 CXX      ?= g++
-CXXFLAGS ?= -Wall -Woverloaded-virtual
+CXXFLAGS ?= -fPIC -Wall -Woverloaded-virtual
 
 ### The directory environment:
 
-DVBDIR = ../../../../DVB
 VDRDIR = ../../..
 LIBDIR = ../../lib
 TMPDIR = /tmp
 
-### The version number of VDR (taken from VDR's "config.h"):
+### Allow user defined options to overwrite defaults:
+
+-include $(VDRDIR)/Make.config
+
+### 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:
 
 ARCHIVE = $(PLUGIN)-$(VERSION)
 PACKAGE = vdr-$(ARCHIVE)
 
-### Allow user defined options to overwrite defaults:
-
--include $(VDRDIR)/Make.config
-
 ### The object files (add further files here):
 
 OBJS = $(PLUGIN).o loader.o display.o render.o common.o bitmap.o \
@@ -95,43 +97,67 @@
 endif
 endif
 
-INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/linux/include -I$(DVBDIR)/include -I.
+INCLUDES += -I$(VDRDIR)/include -I.
 
 DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
 
+### The main target:
+
+all: libvdr-$(PLUGIN).so i18n
+
 ### Implicit rules:
 
 %.o: %.c
 	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
 
-# Dependencies:
+### Dependencies:
 
-MAKEDEP = g++ -MM -MG
+MAKEDEP = $(CXX) -MM -MG
 DEPFILE = .dependencies
 $(DEPFILE): Makefile
 	@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
 
 -include $(DEPFILE)
 
-### Targets:
+### Internationalization (I18N):
+
+PODIR     = po
+LOCALEDIR = $(VDRDIR)/locale
+I18Npo    = $(notdir $(wildcard $(PODIR)/*.po))
+I18Npot   = $(PODIR)/$(PLUGIN).pot
+
+$(I18Npot): $(wildcard *.c)
+	xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP \
+	         --msgid-bugs-address='<sascha@akv-soft.de>' -o $@ $^
+
+%.po: $(I18Npot)
+	msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
+	@touch $@
+
+$(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.po
+	@mkdir -p $(dir $@)
+	msgfmt -c -o $@ $<
 
-all: libvdr-$(PLUGIN).so
+.PHONY: i18n
+i18n: $(I18Npo:%.po=$(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo)
+
+### Targets:
 
 libvdr-$(PLUGIN).so: $(OBJS)
 	$(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -o $@
-	@cp $@ $(LIBDIR)/$@.$(VDRVERSION)
+	@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
 ifndef DEBUG
-	strip $(LIBDIR)/$@.$(VDRVERSION)
+	strip $(LIBDIR)/$@.$(APIVERSION)
 endif
 
 dist: clean
 	@-rm -rf $(TMPDIR)/$(ARCHIVE)
 	@mkdir $(TMPDIR)/$(ARCHIVE)
 	@cp -a * $(TMPDIR)/$(ARCHIVE)
-	@ln -s $(ARCHIVE) $(TMPDIR)/$(PLUGIN)
-	@tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE) $(PLUGIN)
-	@-rm -rf $(TMPDIR)/$(ARCHIVE) $(TMPDIR)/$(PLUGIN)
+	@tar czf $(PACKAGE).tgz -C $(TMPDIR) \
+	     --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* *~ SKINS SKINS.de
+	@-rm -f $(OBJS) $(DEPFILE) *.so $(I18Npot) *.tgz core* *~ SKINS SKINS.de
--- text2skin-1.0+cvs20080122.2311/font.c
+++ text2skin-1.0+cvs20080122.2311/font.c
@@ -31,8 +31,13 @@
 	const cFont *res = NULL;
 #ifdef HAVE_FREETYPE
 	char *cachename;
+#if VDRVERSNUM >= 10507
+	asprintf(&cachename, "%s_%d_%d_%d", Filename.c_str(), Size, Width, I18nCurrentLanguage());
+	if (mFontCache.Load(Path + "/" + Filename, cachename, Size, I18nCurrentLanguage(), Width))
+#else
 	asprintf(&cachename, "%s_%d_%d_%d", Filename.c_str(), Size, Width, Setup.OSDLanguage);
 	if (mFontCache.Load(Path + "/" + Filename, cachename, Size, Setup.OSDLanguage, Width))
+#endif
 		res = mFontCache.GetFont(cachename);
 	else
 		esyslog("ERROR: Text2Skin: Couldn't load font %s:%d", Filename.c_str(), Size);
--- text2skin-1.0+cvs20080122.2311/i18n.c
+++ text2skin-1.0+cvs20080122.2311/i18n.c
@@ -5,6 +5,7 @@
 #include "i18n.h"
 #include <vdr/config.h>
 
+#if VDRVERSNUM < 10507
 const tI18nPhrase Phrases[] = {
 	/*
   { "English",
@@ -156,14 +157,22 @@
   },
 	{ NULL }
 };
+#endif
 
+#if VDRVERSNUM >= 10507
+cText2SkinI18n::cText2SkinI18n(const char *Skin) {
+	mIdentity   = std::string("vdr-"PLUGIN_NAME_I18N"-") + Skin;
+	I18nRegister(mIdentity.substr(mIdentity.find('-') + 1).c_str());
+#else
 cText2SkinI18n::cText2SkinI18n(const char *Skin): cText2SkinFile(Skin) {
 	mIdentity   = (std::string)"text2skin_" + Skin;
 	mNumPhrases = 0;
 	mPhrases    = (tI18nPhrase*)malloc(sizeof(tI18nPhrase));
 	memset(mPhrases[mNumPhrases], 0, sizeof(tI18nPhrase));
+#endif
 }
 
+#if VDRVERSNUM < 10507
 cText2SkinI18n::~cText2SkinI18n() {
 	for (int i = 0; mPhrases[i][0]; ++i) {
 		for (int j = 0; j < I18nNumLanguages; ++j)
@@ -219,3 +228,4 @@
 	}
 	return false;
 }
+#endif
--- text2skin-1.0+cvs20080122.2311/i18n.h
+++ text2skin-1.0+cvs20080122.2311/i18n.h
@@ -9,22 +9,32 @@
 #include "file.h"
 #include <vdr/i18n.h>
 
+#if VDRVERSNUM < 10507
+#define trNOOP(s) (s)
+
 extern const tI18nPhrase Phrases[];
 
 class cText2SkinI18n: public cText2SkinFile {
+#else
+class cText2SkinI18n {
+#endif
 private:
 	std::string  mIdentity;
+#if VDRVERSNUM < 10507
 	tI18nPhrase *mPhrases;
 	int          mNumPhrases;
 
 protected:
 	virtual bool Parse(const char *Text);
+#endif
 
 public:
 	cText2SkinI18n(const char *Skin);
+#if VDRVERSNUM < 10507
 	virtual ~cText2SkinI18n();
 
 	virtual bool Load(const std::string &Filename);
+#endif
 	std::string Translate(const std::string &Text) { return I18nTranslate(Text.c_str(), mIdentity.c_str()); }
 };
 
--- text2skin-1.0+cvs20080122.2311/loader.c
+++ text2skin-1.0+cvs20080122.2311/loader.c
@@ -34,6 +34,9 @@
 }
 
 void cText2SkinLoader::Load(const char *Skin) {
+#if VDRVERSNUM >= 10507
+	cText2SkinI18n *translations = new cText2SkinI18n(Skin);
+#else
 	cText2SkinI18n *translations = NULL;
 	std::string transfile = SkinPath() + "/" + Skin + "/" + Skin + ".trans";
 	if (access(transfile.c_str(), F_OK) == 0) {
@@ -41,6 +44,7 @@
 		if (!translations->Load(transfile))
 			DELETENULL(translations);
 	}
+#endif
 
 	cText2SkinTheme *theme = new cText2SkinTheme(Skin);
 	std::string themefile = SkinPath() + "/" + Skin + "/" + Skin + ".colors";
--- text2skin-1.0+cvs20080122.2311/status.c
+++ text2skin-1.0+cvs20080122.2311/status.c
@@ -109,8 +109,13 @@
 
 void cText2SkinStatus::OsdClear(void) 
 {
+#if VDRVERSNUM >= 10507
+	if (I18nCurrentLanguage() != mLastLanguage) {
+		mLastLanguage = I18nCurrentLanguage();
+#else
 	if (Setup.OSDLanguage != mLastLanguage) {
 		mLastLanguage = Setup.OSDLanguage;
+#endif
 		cxString::Reparse();
 	}
 }
--- text2skin-1.0+cvs20080122.2311/text2skin.c
+++ text2skin-1.0+cvs20080122.2311/text2skin.c
@@ -15,7 +15,7 @@
 
 const char *cText2SkinPlugin::VERSION        = "1.1-cvs";
 const char *cText2SkinPlugin::SKINVERSION    = "1.0";
-const char *cText2SkinPlugin::DESCRIPTION    = "Loader for text-based skins";
+const char *cText2SkinPlugin::DESCRIPTION    = trNOOP("Loader for text-based skins");
 
 cText2SkinPlugin::cText2SkinPlugin(void) {
 }
@@ -24,8 +24,12 @@
 }
 
 bool cText2SkinPlugin::Start(void) {
+#if VDRVERSNUM < 10507
 	RegisterI18n(Phrases);
 	Text2SkinStatus.SetLanguage(Setup.OSDLanguage);
+#else
+	Text2SkinStatus.SetLanguage(I18nCurrentLanguage());
+#endif
 	cText2SkinLoader::Start();
 	return true;
 }
--- text2skin-1.0+cvs20080122.2311/po/de_DE.po	1970-01-01 00:00:00.000000000 +0000
+++ text2skin-1.0+cvs20080122.2311/po/de_DE.po
@@ -0,0 +1,36 @@
+# German translations for vdr-text2skin package.
+# Copyright (C) Sascha Volkenandt <sascha@akv-soft.de>
+# This file is distributed under the same license as the vdr-text2skin package.
+# Sascha Volkenandt <sascha@akv-soft.de>, 2004, 2005.
+#
+# $Id$
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vdr-text2skin 1.0\n"
+"Report-Msgid-Bugs-To: <sascha@akv-soft.de>\n"
+"POT-Creation-Date: 2008-01-26 14:59+0100\n"
+"PO-Revision-Date: 2008-01-26 12:38+0100\n"
+"Last-Translator: Sascha Volkenandt <sascha@akv-soft.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"
+
+msgid "*** Invalid Channel ***"
+msgstr ""
+
+msgid "Skin too large or incorrectly aligned"
+msgstr "Skin zu groß oder nicht korrekt ausgerichtet"
+
+msgid "Flush image cache"
+msgstr "Bildspeicher leeren"
+
+msgid "Max. image cache size"
+msgstr "Max. Größe des Bildspeichers"
+
+msgid "Flushing image cache..."
+msgstr "Bildspeicher wird geleert..."
+
+msgid "Loader for text-based skins"
+msgstr "Lader für textbasierte Skins"
--- text2skin-1.0+cvs20080122.2311/po/fi_FI.po	1970-01-01 00:00:00.000000000 +0000
+++ text2skin-1.0+cvs20080122.2311/po/fi_FI.po
@@ -0,0 +1,36 @@
+# Finnish translations for vdr-text2skin package.
+# Copyright (C) Sascha Volkenandt <sascha@akv-soft.de>
+# This file is distributed under the same license as the vdr-text2skin package.
+# Rolf Ahrenberg <rahrenbe@cc.hut.fi>, 2004, 2005.
+#
+# $Id$
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: vdr-text2skin 1.0\n"
+"Report-Msgid-Bugs-To: <sascha@akv-soft.de>\n"
+"POT-Creation-Date: 2008-01-26 14:59+0100\n"
+"PO-Revision-Date: 2008-01-26 12:38+0100\n"
+"Last-Translator: Rolf Ahrenberg <rahrenbe@cc.hut.fi>\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"
+
+msgid "*** Invalid Channel ***"
+msgstr ""
+
+msgid "Skin too large or incorrectly aligned"
+msgstr "Ulkoasu on liian suuri tai väärin asemoitu"
+
+msgid "Flush image cache"
+msgstr "Tyhjennä kuvat välimuistista"
+
+msgid "Max. image cache size"
+msgstr "Välimuistin maksimikoko"
+
+msgid "Flushing image cache..."
+msgstr "Tyhjennetään välimuistia..."
+
+msgid "Loader for text-based skins"
+msgstr "Helposti muokattavat ulkoasut"