From 958c84f00a4be02c31eb2a1eec08e7fa68210f69 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 25 Jan 2004 15:32:08 +0100 Subject: Implemented 32 audio and Dolby PIDs; storing audio language in channels.conf --- i18n.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'i18n.c') diff --git a/i18n.c b/i18n.c index 6a5060ff..f87827b6 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.145 2004/01/24 14:58:08 kls Exp $ + * $Id: i18n.c 1.146 2004/01/25 14:41:02 kls Exp $ * * Translations provided by: * @@ -4233,9 +4233,9 @@ const char * const * I18nCharSets(void) return &Phrases[1][0]; } -const char * I18nLanguageAbbreviation(int Index) +const char * I18nLanguageCode(int Index) { - return Index < I18nNumLanguages ? Phrases[2][Index] : NULL; + return 0 <= Index && Index < I18nNumLanguages ? Phrases[2][Index] : NULL; } int I18nLanguageIndex(const char *Code) @@ -4248,6 +4248,12 @@ int I18nLanguageIndex(const char *Code) return -1; } +const char *I18nNormalizeLanguageCode(const char *Code) +{ + int n = I18nLanguageIndex(Code); + return n >= 0 ? I18nLanguageCode(n) : Code; +} + bool I18nIsPreferredLanguage(int *PreferredLanguages, int LanguageIndex, int &OldPreference) { for (int i = 0; i < I18nNumLanguages; i++) { -- cgit v1.2.3