--- i18n.h	2007/08/10 13:53:57	1.21
+++ i18n.h	2007/08/18 09:10:39
@@ -36,9 +36,16 @@
 void I18nSetLanguage(int Language);
    ///< Sets the current language index to Language. If Language is outside
    ///< the range of available languages, nothing happens.
+int I18nNumLanguagesWithLocale(void);
+   ///< Returns the number of entries in the list returned by I18nLanguages()
+   ///< that actually have a locale.
 const cStringList *I18nLanguages(void);
    ///< Returns the list of available languages. Values returned by
    ///< I18nCurrentLanguage() are indexes into this list.
+   ///< Only the first I18nNumLanguagesWithLocale() entries in this list
+   ///< have an actual locale installed. The rest are just dummy entries
+   ///< to allow having three letter language codes for other languages
+   ///< that have no actual locale on this system.
 const char *I18nTranslate(const char *s, const char *Plugin = NULL) __attribute_format_arg__(1);
    ///< Translates the given string (with optional Plugin context) into
    ///< the current language. If no translation is available, the original
--- i18n.c	2007/08/17 12:31:17	1.310
+++ i18n.c	2007/08/18 09:08:45
@@ -67,6 +67,7 @@
 static cStringList LanguageNames;
 static cStringList LanguageCodes;
 
+static int NumLocales = 1;
 static int CurrentLanguage = 0;
 
 static bool ContainsCode(const char *Codes, const char *Code)
@@ -105,6 +106,7 @@
      for (int i = 0; i < Locales.Size(); i++) {
          if (i < I18N_MAX_LANGUAGES - 1) {
             if (setlocale(LC_MESSAGES, Locales[i])) {
+               NumLocales++;
                if (strstr(OldLocale, Locales[i]) == OldLocale)
                   MatchFull = LanguageLocales.Size();
                else if (strncmp(OldLocale, Locales[i], 2) == 0)
@@ -177,6 +181,11 @@
      }
 }
 
+int I18nNumLanguagesWithLocale(void)
+{
+  return NumLocales;
+}
+
 const cStringList *I18nLanguages(void)
 {
   return &LanguageNames;
--- menu.c	2007/08/12 10:44:35	1.459
+++ menu.c	2007/08/18 09:03:05
@@ -2205,7 +2205,7 @@
   useSmallFontTexts[2] = tr("always");
   Clear();
   SetSection(tr("OSD"));
-  Add(new cMenuEditStraItem(tr("Setup.OSD$Language"),               &osdLanguageIndex, I18nLanguages()->Size(), &I18nLanguages()->At(0)));
+  Add(new cMenuEditStraItem(tr("Setup.OSD$Language"),               &osdLanguageIndex, I18nNumLanguagesWithLocale(), &I18nLanguages()->At(0)));
   Add(new cMenuEditStraItem(tr("Setup.OSD$Skin"),                   &skinIndex, numSkins, skinDescriptions));
   if (themes.NumThemes())
   Add(new cMenuEditStraItem(tr("Setup.OSD$Theme"),                  &themeIndex, themes.NumThemes(), themes.Descriptions()));
