summaryrefslogtreecommitdiff
path: root/i18n.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2007-08-24 13:09:09 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2007-08-24 13:09:09 +0200
commit1998a2fb62f6146507c58b10e55c0b6ff28fce79 (patch)
tree6164c6727c96dee904b1de0bc792f9b1f6b100a2 /i18n.c
parentf075b1cea75d8494b158df6c9238a453f2988948 (diff)
downloadvdr-1998a2fb62f6146507c58b10e55c0b6ff28fce79.tar.gz
vdr-1998a2fb62f6146507c58b10e55c0b6ff28fce79.tar.bz2
Fixed detecting whether a particular locale is actually supported
Diffstat (limited to 'i18n.c')
-rw-r--r--i18n.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/i18n.c b/i18n.c
index 1eb8ebbf..b475a3b3 100644
--- a/i18n.c
+++ b/i18n.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: i18n.c 1.314 2007/08/24 12:53:53 kls Exp $
+ * $Id: i18n.c 1.315 2007/08/24 13:08:04 kls Exp $
*
*
*/
@@ -114,19 +114,22 @@ void I18nInitialize(void)
if (access(FileName, F_OK) == 0) { // found a locale with VDR texts
if (NumLocales < I18N_MAX_LANGUAGES - 1) {
SetEnvLanguage(Locales[i]);
- NumLocales++;
- if (strstr(OldLocale, Locales[i]) == OldLocale)
- CurrentLanguage = LanguageLocales.Size();
- LanguageLocales.Append(strdup(Locales[i]));
- LanguageNames.Append(strdup(gettext(LanguageName)));
- const char *Code = gettext(LanguageCode);
- for (const char **lc = LanguageCodeList; *lc; lc++) {
- if (ContainsCode(*lc, Code)) {
- Code = *lc;
- break;
+ const char *TranslatedLanguageName = gettext(LanguageName);
+ if (TranslatedLanguageName != LanguageName) {
+ NumLocales++;
+ if (strstr(OldLocale, Locales[i]) == OldLocale)
+ CurrentLanguage = LanguageLocales.Size();
+ LanguageLocales.Append(strdup(Locales[i]));
+ LanguageNames.Append(strdup(TranslatedLanguageName));
+ const char *Code = gettext(LanguageCode);
+ for (const char **lc = LanguageCodeList; *lc; lc++) {
+ if (ContainsCode(*lc, Code)) {
+ Code = *lc;
+ break;
+ }
}
- }
- LanguageCodes.Append(strdup(Code));
+ LanguageCodes.Append(strdup(Code));
+ }
}
else {
esyslog("ERROR: too many locales - increase I18N_MAX_LANGUAGES!");