[vdr] [vdr 1.5.9] locale dir setable at runtime

2007-08-27 Thread Stefan Huelswitt

Hi,

I would like to suggest that the locale directory is setable at
runtime too (via commandline).
Patch attached.

Regards.

-- 
Stefan Huelswitt
[EMAIL PROTECTED]  | http://www.muempf.de/diff -u vdr-1.5.9-orig/i18n.c vdr-1.5.9/i18n.c
--- vdr-1.5.9-orig/i18n.c   2007-08-24 16:03:47.0 +0200
+++ vdr-1.5.9/i18n.c2007-08-27 09:58:14.0 +0200
@@ -62,7 +62,7 @@
   NULL
   };
 
-static const char *I18nLocaleDir = LOCDIR;
+const char *I18nLocaleDir = LOCDIR;
 
 static cStringList LanguageLocales;
 static cStringList LanguageNames;
diff -u vdr-1.5.9-orig/i18n.h vdr-1.5.9/i18n.h
--- vdr-1.5.9-orig/i18n.h   2007-08-24 15:35:18.0 +0200
+++ vdr-1.5.9/i18n.h2007-08-27 09:58:06.0 +0200
@@ -19,6 +19,8 @@
 #define I18N_MAX_LOCALE_LEN 16   // for buffers that hold en_US etc.
 #define I18N_MAX_LANGUAGES  256  // for buffers that hold all available 
languages
 
+extern const char *I18nLocaleDir;
+
 void I18nInitialize(void);
///< Detects all available locales and loads the language names and codes.
 void I18nRegister(const char *Plugin);
diff -u vdr-1.5.9-orig/vdr.c vdr-1.5.9/vdr.c
--- vdr-1.5.9-orig/vdr.c2007-08-25 10:51:13.0 +0200
+++ vdr-1.5.9/vdr.c 2007-08-27 10:01:56.0 +0200
@@ -231,6 +231,7 @@
   { "log",  required_argument, NULL, 'l' },
   { "mute", no_argument,   NULL, 'm' },
   { "no-kbd",   no_argument,   NULL, 'n' | 0x100 },
+  { "locale",   required_argument, NULL, 'O' },
   { "plugin",   required_argument, NULL, 'P' },
   { "port", required_argument, NULL, 'p' },
   { "rcu",  optional_argument, NULL, 'r' | 0x100 },
@@ -246,7 +247,7 @@
 };
 
   int c;
-  while ((c = getopt_long(argc, argv, "a:c:dD:E:g:hl:L:mp:P:r:s:t:u:v:Vw:", 
long_options, NULL)) != -1) {
+  while ((c = getopt_long(argc, argv, "a:c:dD:E:g:hl:L:mO:p:P:r:s:t:u:v:Vw:", 
long_options, NULL)) != -1) {
 switch (c) {
   case 'a': AudioCommand = optarg;
 break;
@@ -310,6 +311,13 @@
   case 'n' | 0x100:
 UseKbd = false;
 break;
+  case 'O': if (access(optarg, R_OK | X_OK) == 0)
+   I18nLocaleDir = optarg;
+else {
+   fprintf(stderr, "vdr: can't access locale directory: 
%s\n", optarg);
+   return 2;
+   }
+break;
   case 'p': if (isnumber(optarg))
SVDRPport = atoi(optarg);
 else {
@@ -408,6 +416,7 @@
"   (default: %s)\n"
"  -m,   --mute mute audio of the primary DVB 
device at startup\n"
"--no-kbd   don't use the keyboard as an input 
device\n"
+   "  -O DIR,   --locale=DIR   search for locale files in DIR 
(default is %s)\n"
"  -p PORT,  --port=PORTuse PORT for SVDRP (default: %d)\n"
"   0 turns off SVDRP\n"
"  -P OPT,   --plugin=OPT   load a plugin defined by the given 
options\n"
@@ -428,6 +437,7 @@
DEFAULTEPGDATAFILENAME,
DEFAULTPLUGINDIR,
LIRC_DEVICE,
+   LOCDIR,
DEFAULTSVDRPPORT,
RCU_DEVICE,
VideoDirectory,___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] [vdr 1.5.9] i18n makefile rules

2007-08-27 Thread Stefan Huelswitt

Hi,
I dislike that current vdr remakes/copies the language file
everytime even nothing has changed.
The attached patch implements a (may be) more sophisticated way.

Regards.

-- 
Stefan Huelswitt
[EMAIL PROTECTED]  | http://www.muempf.de/--- vdr-1.5.9-orig/Makefile 2007-08-25 10:52:17.0 +0200
+++ vdr-1.5.9/Makefile  2007-08-27 14:40:07.0 +0200
@@ -76,6 +76,7 @@
 endif
 
 all: vdr i18n
+.PHONY: i18n
 
 # Implicit rules:
 
@@ -106,25 +107,24 @@
 PODIR = po
 LOCALEDIR = locale
 I18Npo= $(wildcard $(PODIR)/*.po)
-I18Nmo= $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file
-I18Ndirs  = $(notdir $(foreach file, $(I18Npo), $(basename $(file
+I18Nmsgs  = $(addprefix $(LOCALEDIR)/,$(addsuffix /LC_MESSAGES/vdr.mo,$(notdir 
$(foreach file, $(wildcard $(PODIR)/*.po), $(basename $(file))
 I18Npot   = $(PODIR)/vdr.pot
 
 %.mo: %.po
msgfmt -c -o $@ $<
 
-$(I18Npot): $(wildcard *.c)
-   xgettext -C -cTRANSLATORS --no-wrap -F -k -ktr -ktrNOOP 
--msgid-bugs-address='<[EMAIL PROTECTED]>' -o $@ $(wildcard *.c)
+$(I18Npot): $(shell grep -l '\(tr\|trNOOP\)(\".*\")' *.c)
+   xgettext -C -cTRANSLATORS --no-wrap -F -k -ktr -ktrNOOP 
--msgid-bugs-address='<[EMAIL PROTECTED]>' -o $@ $^
 
-$(I18Npo): $(I18Npot)
+%.po: $(I18Npot)
msgmerge -U --no-wrap -F --backup=none -q $@ $<
+   @touch $@
 
-i18n: $(I18Nmo)
-   @mkdir -p $(LOCALEDIR)
-   for i in $(I18Ndirs); do\
-   mkdir -p $(LOCALEDIR)/$$i/LC_MESSAGES;\
-   cp $(PODIR)/$$i.mo $(LOCALEDIR)/$$i/LC_MESSAGES/vdr.mo;\
-   done
+$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr.mo: $(PODIR)/%.mo
+   @mkdir -p $(dir $@)
+   cp $< $@
+
+i18n: $(I18Nmsgs)
 
 install-i18n:
@mkdir -p $(DESTDIR)$(LOCDIR)___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] PremiereEPG plugin 0.0.8

2007-08-27 Thread Stefan Huelswitt

Hi,
an updated version of the PremiereEPG plugin is available from my
homepage


NEWS:
27.08.2007: Version 0.0.8
- Added support for VDR 1.5.7+ gettext internationalization.

-- 
Stefan Huelswitt
[EMAIL PROTECTED]  | http://www.muempf.de/

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] MP3/MPlayer plugin 0.10.1

2007-08-27 Thread Stefan Huelswitt

Hi,
a new version of the MP3/MPlayer plugin is available from my
homepage.


NEWS:
27.08.2007: Version 0.10.1 (vdr 1.4.7 / 1.5.9)
- Fixed segfault in MP3 infocache purge on plugin exit.
- Added support for VDR 1.5.7+ gettext internationalization.

-- 
Stefan Huelswitt
[EMAIL PROTECTED]  | http://www.muempf.de/

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] translation context handling in vdr >= 1.5.7

2007-08-27 Thread Christian Wieninger
Klaus Schmidinger wrote:
> gettext() may or may not return the original string, so if no translation
> is found, the context needs to be stripped.
> 
> Please try this:

sorry for the late response. gmx seemed to be blacklisted again ;)
Works like a charm.

BR,

Christian


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr