diff -Nru vdr-1.5.13/i18n.c vdr-1.5.13-localedir/i18n.c --- vdr-1.5.13/i18n.c 2007-11-01 11:38:27.000000000 +0100 +++ vdr-1.5.13-localedir/i18n.c 2008-01-20 19:46:56.000000000 +0100 @@ -100,8 +100,10 @@ ++_nl_msg_cat_cntr; } -void I18nInitialize(void) +void I18nInitialize(const char *LocaleDir) { + if (LocaleDir) + I18nLocaleDir = LocaleDir; LanguageLocales.Append(strdup(I18N_DEFAULT_LOCALE)); LanguageNames.Append(strdup(SkipContext(LanguageName))); LanguageCodes.Append(strdup(LanguageCodeList[0])); diff -Nru vdr-1.5.13/i18n.h vdr-1.5.13-localedir/i18n.h --- vdr-1.5.13/i18n.h 2007-08-24 15:35:18.000000000 +0200 +++ vdr-1.5.13-localedir/i18n.h 2008-01-20 19:47:33.000000000 +0100 @@ -19,8 +19,10 @@ #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 -void I18nInitialize(void); +void I18nInitialize(const char *LocaleDir = NULL); ///< Detects all available locales and loads the language names and codes. + ///< If LocaleDir is given, it must point to a static string that lives + ///< for the entire lifetime of the program. void I18nRegister(const char *Plugin); ///< Registers the named plugin, so that it can use internationalized texts. void I18nSetLocale(const char *Locale); diff -Nru vdr-1.5.13/vdr.c vdr-1.5.13-localedir/vdr.c --- vdr-1.5.13/vdr.c 2008-01-13 12:51:53.000000000 +0100 +++ vdr-1.5.13-localedir/vdr.c 2008-01-20 19:50:23.000000000 +0100 @@ -198,6 +198,7 @@ bool MuteAudio = false; int WatchdogTimeout = DEFAULTWATCHDOG; const char *Terminal = NULL; + const char *LocaleDir = NULL; bool UseKbd = true; const char *LircDevice = NULL; @@ -229,6 +230,7 @@ { "help", no_argument, NULL, 'h' }, { "lib", required_argument, NULL, 'L' }, { "lirc", optional_argument, NULL, 'l' | 0x100 }, + { "localedir",required_argument, NULL, 'l' | 0x200 }, { "log", required_argument, NULL, 'l' }, { "mute", no_argument, NULL, 'm' }, { "no-kbd", no_argument, NULL, 'n' | 0x100 }, @@ -306,6 +308,14 @@ case 'l' | 0x100: LircDevice = optarg ? optarg : LIRC_DEVICE; break; + case 'l' | 0x200: + if (access(optarg, R_OK | X_OK) == 0) + LocaleDir = optarg; + else { + fprintf(stderr, "vdr: can't access locale directory: %s\n", optarg); + return 2; + } + break; case 'm': MuteAudio = true; break; case 'n' | 0x100: @@ -407,6 +417,8 @@ " -L DIR, --lib=DIR search for plugins in DIR (default is %s)\n" " --lirc[=PATH] use a LIRC remote control device, attached to PATH\n" " (default: %s)\n" + " --localedir=DIR search for locale files in DIR (default is\n" + " %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" " -p PORT, --port=PORT use PORT for SVDRP (default: %d)\n" @@ -430,6 +442,7 @@ DEFAULTEPGDATAFILENAME, DEFAULTPLUGINDIR, LIRC_DEVICE, + LOCDIR, DEFAULTSVDRPPORT, RCU_DEVICE, VideoDirectory, @@ -515,7 +528,7 @@ // Initialize internationalization: - I18nInitialize(); + I18nInitialize(LocaleDir); // Main program loop variables - need to be here to have them initialized before any EXIT():