X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmisc%2Fiso_lang.c;h=30c011b464050254722c3e5c3e8bec25a894fd2f;hb=28a1f4c6267a8d4d8f130f367712710a694e6db1;hp=219e09187e344bc21acaf72b139c6a9938443524;hpb=b0018cc387f323c225c113f11688e516a67429ab;p=vlc diff --git a/src/misc/iso_lang.c b/src/misc/iso_lang.c index 219e09187e..30c011b464 100644 --- a/src/misc/iso_lang.c +++ b/src/misc/iso_lang.c @@ -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 + * Author: Stéphane Borel * Arnaud de Bossoreille de Ribou * * 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. *****************************************************************************/ /***************************************************************************** @@ -34,15 +34,7 @@ /***************************************************************************** * 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 )