summaryrefslogtreecommitdiff
path: root/i18n.c
diff options
context:
space:
mode:
Diffstat (limited to 'i18n.c')
-rw-r--r--i18n.c12
1 files changed, 9 insertions, 3 deletions
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++) {