diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2012-09-01 14:03:45 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2012-09-01 14:03:45 +0200 |
commit | 13edfc13820efc784c08b7b93e73f34a73c1e80e (patch) | |
tree | 02d030f96fa1f851454f75d84f03cd323f20105d /i18n.c | |
parent | d3b3c43e8f0f584fc679787edc8799399f8e8d3e (diff) | |
download | vdr-13edfc13820efc784c08b7b93e73f34a73c1e80e.tar.gz vdr-13edfc13820efc784c08b7b93e73f34a73c1e80e.tar.bz2 |
Implemented FHS support; fixed handling config directory if only -v is given
Diffstat (limited to 'i18n.c')
-rw-r--r-- | i18n.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: i18n.c 2.4 2011/08/15 10:01:45 kls Exp $ + * $Id: i18n.c 2.5 2012/09/01 10:53:43 kls Exp $ */ /* @@ -63,7 +63,7 @@ const char *LanguageCodeList[] = { NULL }; -static const char *I18nLocaleDir = LOCDIR; +static cString I18nLocaleDir; static cStringList LanguageLocales; static cStringList LanguageNames; @@ -102,8 +102,7 @@ static void SetEnvLanguage(const char *Locale) void I18nInitialize(const char *LocaleDir) { - if (LocaleDir) - I18nLocaleDir = LocaleDir; + I18nLocaleDir = LocaleDir; LanguageLocales.Append(strdup(I18N_DEFAULT_LOCALE)); LanguageNames.Append(strdup(SkipContext(LanguageName))); LanguageCodes.Append(strdup(LanguageCodeList[0])); @@ -113,7 +112,7 @@ void I18nInitialize(const char *LocaleDir) if (Locales.Size() > 0) { char *OldLocale = strdup(setlocale(LC_MESSAGES, NULL)); for (int i = 0; i < Locales.Size(); i++) { - cString FileName = cString::sprintf("%s/%s/LC_MESSAGES/vdr.mo", I18nLocaleDir, Locales[i]); + cString FileName = cString::sprintf("%s/%s/LC_MESSAGES/vdr.mo", *I18nLocaleDir, Locales[i]); if (access(FileName, F_OK) == 0) { // found a locale with VDR texts if (NumLocales < I18N_MAX_LANGUAGES - 1) { SetEnvLanguage(Locales[i]); @@ -142,7 +141,7 @@ void I18nInitialize(const char *LocaleDir) } SetEnvLanguage(LanguageLocales[CurrentLanguage]); free(OldLocale); - dsyslog("found %d locales in %s", NumLocales - 1, I18nLocaleDir); + dsyslog("found %d locales in %s", NumLocales - 1, *I18nLocaleDir); } // Prepare any known language codes for which there was no locale: for (const char **lc = LanguageCodeList; *lc; lc++) { |