# http://www.linuxtv.org/pipermail/vdr/2007-August/013951.html diff -Nru vdr-1.5.11/i18n.c vdr-1.5.11-locale-dir/i18n.c --- vdr-1.5.11/i18n.c 2007-11-01 11:38:27.000000000 +0100 +++ vdr-1.5.11-locale-dir/i18n.c 2007-11-10 00:15:29.000000000 +0100 @@ -63,7 +63,7 @@ NULL }; -static const char *I18nLocaleDir = LOCDIR; +const char *I18nLocaleDir = LOCDIR; static cStringList LanguageLocales; static cStringList LanguageNames; diff -Nru vdr-1.5.11/i18n.h vdr-1.5.11-locale-dir/i18n.h --- vdr-1.5.11/i18n.h 2007-08-24 15:35:18.000000000 +0200 +++ vdr-1.5.11-locale-dir/i18n.h 2007-11-10 00:16:42.000000000 +0100 @@ -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 -Nru vdr-1.5.11/vdr.c vdr-1.5.11-locale-dir/vdr.c --- vdr-1.5.11/vdr.c 2007-11-03 15:46:29.000000000 +0100 +++ vdr-1.5.11-locale-dir/vdr.c 2007-11-10 00:19:36.000000000 +0100 @@ -232,6 +232,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 }, @@ -247,7 +248,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; @@ -311,6 +312,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" @@ -429,6 +438,7 @@ DEFAULTEPGDATAFILENAME, DEFAULTPLUGINDIR, LIRC_DEVICE, + LOCDIR, DEFAULTSVDRPPORT, RCU_DEVICE, VideoDirectory,