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.000000000 +0200
+++ vdr-1.5.9/i18n.c    2007-08-27 09:58:14.000000000 +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.000000000 +0200
+++ vdr-1.5.9/i18n.h    2007-08-27 09:58:06.000000000 +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.c        2007-08-25 10:51:13.000000000 +0200
+++ vdr-1.5.9/vdr.c     2007-08-27 10:01:56.000000000 +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=PORT    use 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

Reply via email to