Commit 62eff4b0 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Get iso936 code from language name.

parent 30a615da
......@@ -42,6 +42,7 @@ extern "C" {
VLC_EXPORT( const iso639_lang_t *, GetLang_1, ( const char * ) );
VLC_EXPORT( const iso639_lang_t *, GetLang_2T, ( const char * ) );
VLC_EXPORT( const iso639_lang_t *, GetLang_2B, ( const char * ) );
VLC_EXPORT( const iso639_lang_t *, GetLang_iso936, ( const char * ) );
#if defined( __cplusplus )
}
#endif
......
......@@ -136,6 +136,7 @@ GetFallbackEncoding
GetLang_1
GetLang_2B
GetLang_2T
GetLang_iso936
httpd_ClientIP
httpd_ClientModeBidir
httpd_ClientModeStream
......
......@@ -77,3 +77,22 @@ const iso639_lang_t * GetLang_2B( const char * psz_code )
return &unknown_language;
}
const iso639_lang_t * GetLang_iso936( const char *psz_lang )
{
const iso639_lang_t *p_lang;
if( psz_lang == NULL || *psz_lang == '\0' )
return &unknown_language;
for( p_lang = p_languages; p_lang->psz_iso639_1 != NULL; p_lang++ )
{
if( !strcasecmp( p_lang->psz_eng_name, psz_lang ) ||
!strcasecmp( p_lang->psz_native_name, psz_lang ) ||
!strcasecmp( p_lang->psz_iso639_1, psz_lang ) ||
!strcasecmp( p_lang->psz_iso639_2T, psz_lang ) ||
!strcasecmp( p_lang->psz_iso639_2B, psz_lang ) )
return p_lang;
}
return &unknown_language;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment