* updated knights (21.12.1 -> 21.12.2), untested
[t2-trunk.git] / package / vdr / vdr-text2skin / locale.patch
blob2f64cddaecf3247ccce0755c452e25076da8cda3
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../vdr-text2skin/locale.patch
5 # Copyright (C) 2008 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 http://toms-cafe.de/vdr/download/text2skin-1.1-cvs-locale.diff
19 --- text2skin-1.0+cvs20080122.2311/Makefile
20 +++ text2skin-1.0+cvs20080122.2311/Makefile
21 @@ -19,6 +19,8 @@
22 # The official name of this plugin.
23 # This name will be used in the '-P...' option of VDR to load the plugin.
24 # By default the main source file also carries this name.
25 +# IMPORTANT: the presence of this macro is important for the Make.config
26 +# file. So it must be defined, even if it is not used here!
28 PLUGIN = text2skin
30 @@ -29,28 +31,28 @@
31 ### The C++ compiler and options:
33 CXX ?= g++
34 -CXXFLAGS ?= -Wall -Woverloaded-virtual
35 +CXXFLAGS ?= -fPIC -Wall -Woverloaded-virtual
37 ### The directory environment:
39 -DVBDIR = ../../../../DVB
40 VDRDIR = ../../..
41 LIBDIR = ../../lib
42 TMPDIR = /tmp
44 -### The version number of VDR (taken from VDR's "config.h"):
45 +### Allow user defined options to overwrite defaults:
47 +-include $(VDRDIR)/Make.config
49 +### The version number of VDR's plugin API (taken from VDR's "config.h"):
51 -VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
52 +APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' \
53 + $(VDRDIR)/config.h)
55 ### The name of the distribution archive:
57 ARCHIVE = $(PLUGIN)-$(VERSION)
58 PACKAGE = vdr-$(ARCHIVE)
60 -### Allow user defined options to overwrite defaults:
62 --include $(VDRDIR)/Make.config
64 ### The object files (add further files here):
66 OBJS = $(PLUGIN).o loader.o display.o render.o common.o bitmap.o \
67 @@ -95,43 +97,67 @@
68 endif
69 endif
71 -INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/linux/include -I$(DVBDIR)/include -I.
72 +INCLUDES += -I$(VDRDIR)/include -I.
74 DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
76 +### The main target:
78 +all: libvdr-$(PLUGIN).so i18n
80 ### Implicit rules:
82 %.o: %.c
83 $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
85 -# Dependencies:
86 +### Dependencies:
88 -MAKEDEP = g++ -MM -MG
89 +MAKEDEP = $(CXX) -MM -MG
90 DEPFILE = .dependencies
91 $(DEPFILE): Makefile
92 @$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
94 -include $(DEPFILE)
96 -### Targets:
97 +### Internationalization (I18N):
99 +PODIR = po
100 +LOCALEDIR = $(VDRDIR)/locale
101 +I18Npo = $(notdir $(wildcard $(PODIR)/*.po))
102 +I18Npot = $(PODIR)/$(PLUGIN).pot
104 +$(I18Npot): $(wildcard *.c)
105 + xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP \
106 + --msgid-bugs-address='<sascha@akv-soft.de>' -o $@ $^
108 +%.po: $(I18Npot)
109 + msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
110 + @touch $@
112 +$(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.po
113 + @mkdir -p $(dir $@)
114 + msgfmt -c -o $@ $<
116 -all: libvdr-$(PLUGIN).so
117 +.PHONY: i18n
118 +i18n: $(I18Npo:%.po=$(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo)
120 +### Targets:
122 libvdr-$(PLUGIN).so: $(OBJS)
123 $(CXX) $(CXXFLAGS) -shared $(OBJS) $(LIBS) -o $@
124 - @cp $@ $(LIBDIR)/$@.$(VDRVERSION)
125 + @cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
126 ifndef DEBUG
127 - strip $(LIBDIR)/$@.$(VDRVERSION)
128 + strip $(LIBDIR)/$@.$(APIVERSION)
129 endif
131 dist: clean
132 @-rm -rf $(TMPDIR)/$(ARCHIVE)
133 @mkdir $(TMPDIR)/$(ARCHIVE)
134 @cp -a * $(TMPDIR)/$(ARCHIVE)
135 - @ln -s $(ARCHIVE) $(TMPDIR)/$(PLUGIN)
136 - @tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE) $(PLUGIN)
137 - @-rm -rf $(TMPDIR)/$(ARCHIVE) $(TMPDIR)/$(PLUGIN)
138 + @tar czf $(PACKAGE).tgz -C $(TMPDIR) \
139 + --exclude debian --exclude CVS --exclude .svn $(ARCHIVE)
140 + @-rm -rf $(TMPDIR)/$(ARCHIVE)
141 @echo Distribution package created as $(PACKAGE).tgz
143 clean:
144 - @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ SKINS SKINS.de
145 + @-rm -f $(OBJS) $(DEPFILE) *.so $(I18Npot) *.tgz core* *~ SKINS SKINS.de
146 --- text2skin-1.0+cvs20080122.2311/font.c
147 +++ text2skin-1.0+cvs20080122.2311/font.c
148 @@ -31,8 +31,13 @@
149 const cFont *res = NULL;
150 #ifdef HAVE_FREETYPE
151 char *cachename;
152 +#if VDRVERSNUM >= 10507
153 + asprintf(&cachename, "%s_%d_%d_%d", Filename.c_str(), Size, Width, I18nCurrentLanguage());
154 + if (mFontCache.Load(Path + "/" + Filename, cachename, Size, I18nCurrentLanguage(), Width))
155 +#else
156 asprintf(&cachename, "%s_%d_%d_%d", Filename.c_str(), Size, Width, Setup.OSDLanguage);
157 if (mFontCache.Load(Path + "/" + Filename, cachename, Size, Setup.OSDLanguage, Width))
158 +#endif
159 res = mFontCache.GetFont(cachename);
160 else
161 esyslog("ERROR: Text2Skin: Couldn't load font %s:%d", Filename.c_str(), Size);
162 --- text2skin-1.0+cvs20080122.2311/i18n.c
163 +++ text2skin-1.0+cvs20080122.2311/i18n.c
164 @@ -5,6 +5,7 @@
165 #include "i18n.h"
166 #include <vdr/config.h>
168 +#if VDRVERSNUM < 10507
169 const tI18nPhrase Phrases[] = {
171 { "English",
172 @@ -156,14 +157,22 @@
174 { NULL }
176 +#endif
178 +#if VDRVERSNUM >= 10507
179 +cText2SkinI18n::cText2SkinI18n(const char *Skin) {
180 + mIdentity = std::string("vdr-"PLUGIN_NAME_I18N"-") + Skin;
181 + I18nRegister(mIdentity.substr(mIdentity.find('-') + 1).c_str());
182 +#else
183 cText2SkinI18n::cText2SkinI18n(const char *Skin): cText2SkinFile(Skin) {
184 mIdentity = (std::string)"text2skin_" + Skin;
185 mNumPhrases = 0;
186 mPhrases = (tI18nPhrase*)malloc(sizeof(tI18nPhrase));
187 memset(mPhrases[mNumPhrases], 0, sizeof(tI18nPhrase));
188 +#endif
191 +#if VDRVERSNUM < 10507
192 cText2SkinI18n::~cText2SkinI18n() {
193 for (int i = 0; mPhrases[i][0]; ++i) {
194 for (int j = 0; j < I18nNumLanguages; ++j)
195 @@ -219,3 +228,4 @@
197 return false;
199 +#endif
200 --- text2skin-1.0+cvs20080122.2311/i18n.h
201 +++ text2skin-1.0+cvs20080122.2311/i18n.h
202 @@ -9,22 +9,32 @@
203 #include "file.h"
204 #include <vdr/i18n.h>
206 +#if VDRVERSNUM < 10507
207 +#define trNOOP(s) (s)
209 extern const tI18nPhrase Phrases[];
211 class cText2SkinI18n: public cText2SkinFile {
212 +#else
213 +class cText2SkinI18n {
214 +#endif
215 private:
216 std::string mIdentity;
217 +#if VDRVERSNUM < 10507
218 tI18nPhrase *mPhrases;
219 int mNumPhrases;
221 protected:
222 virtual bool Parse(const char *Text);
223 +#endif
225 public:
226 cText2SkinI18n(const char *Skin);
227 +#if VDRVERSNUM < 10507
228 virtual ~cText2SkinI18n();
230 virtual bool Load(const std::string &Filename);
231 +#endif
232 std::string Translate(const std::string &Text) { return I18nTranslate(Text.c_str(), mIdentity.c_str()); }
235 --- text2skin-1.0+cvs20080122.2311/loader.c
236 +++ text2skin-1.0+cvs20080122.2311/loader.c
237 @@ -34,6 +34,9 @@
240 void cText2SkinLoader::Load(const char *Skin) {
241 +#if VDRVERSNUM >= 10507
242 + cText2SkinI18n *translations = new cText2SkinI18n(Skin);
243 +#else
244 cText2SkinI18n *translations = NULL;
245 std::string transfile = SkinPath() + "/" + Skin + "/" + Skin + ".trans";
246 if (access(transfile.c_str(), F_OK) == 0) {
247 @@ -41,6 +44,7 @@
248 if (!translations->Load(transfile))
249 DELETENULL(translations);
251 +#endif
253 cText2SkinTheme *theme = new cText2SkinTheme(Skin);
254 std::string themefile = SkinPath() + "/" + Skin + "/" + Skin + ".colors";
255 --- text2skin-1.0+cvs20080122.2311/status.c
256 +++ text2skin-1.0+cvs20080122.2311/status.c
257 @@ -109,8 +109,13 @@
259 void cText2SkinStatus::OsdClear(void)
261 +#if VDRVERSNUM >= 10507
262 + if (I18nCurrentLanguage() != mLastLanguage) {
263 + mLastLanguage = I18nCurrentLanguage();
264 +#else
265 if (Setup.OSDLanguage != mLastLanguage) {
266 mLastLanguage = Setup.OSDLanguage;
267 +#endif
268 cxString::Reparse();
271 --- text2skin-1.0+cvs20080122.2311/text2skin.c
272 +++ text2skin-1.0+cvs20080122.2311/text2skin.c
273 @@ -15,7 +15,7 @@
275 const char *cText2SkinPlugin::VERSION = "1.1-cvs";
276 const char *cText2SkinPlugin::SKINVERSION = "1.0";
277 -const char *cText2SkinPlugin::DESCRIPTION = "Loader for text-based skins";
278 +const char *cText2SkinPlugin::DESCRIPTION = trNOOP("Loader for text-based skins");
280 cText2SkinPlugin::cText2SkinPlugin(void) {
282 @@ -24,8 +24,12 @@
285 bool cText2SkinPlugin::Start(void) {
286 +#if VDRVERSNUM < 10507
287 RegisterI18n(Phrases);
288 Text2SkinStatus.SetLanguage(Setup.OSDLanguage);
289 +#else
290 + Text2SkinStatus.SetLanguage(I18nCurrentLanguage());
291 +#endif
292 cText2SkinLoader::Start();
293 return true;
295 --- text2skin-1.0+cvs20080122.2311/po/de_DE.po 1970-01-01 00:00:00.000000000 +0000
296 +++ text2skin-1.0+cvs20080122.2311/po/de_DE.po
297 @@ -0,0 +1,36 @@
298 +# German translations for vdr-text2skin package.
299 +# Copyright (C) Sascha Volkenandt <sascha@akv-soft.de>
300 +# This file is distributed under the same license as the vdr-text2skin package.
301 +# Sascha Volkenandt <sascha@akv-soft.de>, 2004, 2005.
303 +# $Id$
305 +msgid ""
306 +msgstr ""
307 +"Project-Id-Version: vdr-text2skin 1.0\n"
308 +"Report-Msgid-Bugs-To: <sascha@akv-soft.de>\n"
309 +"POT-Creation-Date: 2008-01-26 14:59+0100\n"
310 +"PO-Revision-Date: 2008-01-26 12:38+0100\n"
311 +"Last-Translator: Sascha Volkenandt <sascha@akv-soft.de>\n"
312 +"Language-Team: <vdr@linuxtv.org>\n"
313 +"MIME-Version: 1.0\n"
314 +"Content-Type: text/plain; charset=iso-8859-15\n"
315 +"Content-Transfer-Encoding: 8bit\n"
317 +msgid "*** Invalid Channel ***"
318 +msgstr ""
320 +msgid "Skin too large or incorrectly aligned"
321 +msgstr "Skin zu groß oder nicht korrekt ausgerichtet"
323 +msgid "Flush image cache"
324 +msgstr "Bildspeicher leeren"
326 +msgid "Max. image cache size"
327 +msgstr "Max. Größe des Bildspeichers"
329 +msgid "Flushing image cache..."
330 +msgstr "Bildspeicher wird geleert..."
332 +msgid "Loader for text-based skins"
333 +msgstr "Lader für textbasierte Skins"
334 --- text2skin-1.0+cvs20080122.2311/po/fi_FI.po 1970-01-01 00:00:00.000000000 +0000
335 +++ text2skin-1.0+cvs20080122.2311/po/fi_FI.po
336 @@ -0,0 +1,36 @@
337 +# Finnish translations for vdr-text2skin package.
338 +# Copyright (C) Sascha Volkenandt <sascha@akv-soft.de>
339 +# This file is distributed under the same license as the vdr-text2skin package.
340 +# Rolf Ahrenberg <rahrenbe@cc.hut.fi>, 2004, 2005.
342 +# $Id$
344 +msgid ""
345 +msgstr ""
346 +"Project-Id-Version: vdr-text2skin 1.0\n"
347 +"Report-Msgid-Bugs-To: <sascha@akv-soft.de>\n"
348 +"POT-Creation-Date: 2008-01-26 14:59+0100\n"
349 +"PO-Revision-Date: 2008-01-26 12:38+0100\n"
350 +"Last-Translator: Rolf Ahrenberg <rahrenbe@cc.hut.fi>\n"
351 +"Language-Team: <vdr@linuxtv.org>\n"
352 +"MIME-Version: 1.0\n"
353 +"Content-Type: text/plain; charset=iso-8859-15\n"
354 +"Content-Transfer-Encoding: 8bit\n"
356 +msgid "*** Invalid Channel ***"
357 +msgstr ""
359 +msgid "Skin too large or incorrectly aligned"
360 +msgstr "Ulkoasu on liian suuri tai väärin asemoitu"
362 +msgid "Flush image cache"
363 +msgstr "Tyhjennä kuvat välimuistista"
365 +msgid "Max. image cache size"
366 +msgstr "Välimuistin maksimikoko"
368 +msgid "Flushing image cache..."
369 +msgstr "Tyhjennetään välimuistia..."
371 +msgid "Loader for text-based skins"
372 +msgstr "Helposti muokattavat ulkoasut"