]> git.sesse.net Git - vlc/blobdiff - src/misc/iso_lang.c
Fix one instance mode for Win32 in trunk
[vlc] / src / misc / iso_lang.c
index 219e09187e344bc21acaf72b139c6a9938443524..30c011b464050254722c3e5c3e8bec25a894fd2f 100644 (file)
@@ -1,10 +1,10 @@
 /*****************************************************************************
  * iso_lang.c: function to decode language code (in dvd or a52 for instance).
  *****************************************************************************
- * Copyright (C) 1998-2001 VideoLAN
- * $Id: iso_lang.c,v 1.9 2003/08/17 20:39:08 fenrir Exp $
+ * Copyright (C) 1998-2004 the VideoLAN team
+ * $Id$
  *
- * Author: Stéphane Borel <stef@via.ecp.fr>
+ * Author: Stéphane Borel <stef@via.ecp.fr>
  *         Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -19,7 +19,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
 /*****************************************************************************
  * Local tables
  *****************************************************************************/
-
-#define DEFINE_LANGUAGE_CODE(engName, nativeName, iso1, iso2T, iso2B) \
-          { engName, nativeName, #iso1, #iso2T, #iso2B },
-
-static const iso639_lang_t p_languages[] =
-{
 #include "iso-639_def.h"
-    { NULL, NULL, NULL, NULL, NULL }
-};
 
 static const iso639_lang_t unknown_language =
     { "Unknown", "Unknown", "??", "???", "???" };
@@ -62,18 +54,20 @@ const char * DecodeLanguage( uint16_t i_code )
 
     for( p_lang = p_languages; p_lang->psz_eng_name; p_lang++ )
     {
-        if( !strncmp( p_lang->psz_iso639_1, psz_code, 2 ) )
+        if( !memcmp( p_lang->psz_iso639_1, psz_code, 2 ) )
         {
+# if 0
             if( *p_lang->psz_native_name )
             {
                 return p_lang->psz_native_name;
             }
+#endif
 
-            return p_lang->psz_eng_name;
+            return _( p_lang->psz_eng_name );
         }
     }
 
-    return "Unknown";
+    return _( "Unknown" );
 }
 
 const iso639_lang_t * GetLang_1( const char * psz_code )