MythTV  master
Functions | Variables
iso639.h File Reference

ISO 639-1 and ISO 639-2 support functions. More...

#include <vector>
#include <QMap>
#include <QString>
#include "mythbaseexp.h"
Include dependency graph for iso639.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

MBASE_PUBLIC QString iso639_str_toName (const unsigned char *iso639)
 Converts a 2 or 3 character iso639 string to a language name in English. More...
 
MBASE_PUBLIC QString iso639_key_toName (int iso639_2)
 Converts a canonical key to language name in English. More...
 
MBASE_PUBLIC void iso639_clear_language_list (void)
 
MBASE_PUBLIC QStringList iso639_get_language_list (void)
 Returns list of three character ISO-639 language descriptors, starting with the most preferred. More...
 
MBASE_PUBLIC std::vector< int > iso639_get_language_key_list (void)
 
MBASE_PUBLIC int iso639_key_to_canonical_key (int iso639_2)
 
MBASE_PUBLIC QString iso639_str2_to_str3 (const QString &str2)
 
static QString iso639_key_to_str3 (int code)
 
static bool iso639_is_key_undefined (int code)
 Returns true if the key is 0, 0xFFFFFF, or 'und'. More...
 
static int iso639_str3_to_key (const unsigned char *iso639_2)
 
static int iso639_str3_to_key (const char *iso639_2)
 
static int iso639_str3_to_key (const QString &iso639_2)
 
static int iso639_str2_to_key2 (const unsigned char *iso639_1)
 
static int iso639_str2_to_key2 (const char *iso639_1)
 
static QString iso639_str_to_canonoical_str (const QString &str3)
 
MBASE_PUBLIC QString GetISO639LanguageName (const QString &iso639Code)
 
MBASE_PUBLIC QString GetISO639EnglishLanguageName (const QString &iso639Code)
 

Variables

MBASE_PUBLIC QMap< int, QString > iso639_key_to_english_name
 

Detailed Description

ISO 639-1 and ISO 639-2 support functions.

ISO 639-1 is the two letter standard for specifying a language. This is used by MythTV for naming the themes and for initializing the Qt translation system.

ISO 639-2 is the three letter standard for specifying a language. This is used by MythTV for selecting subtitles and audio streams during playback, and for selecting which languages to collect EIT program guide information in.

In many contexts, such as with translations, these language codes can be appended with an underscore and a 2 digit IETF region code. So for Brazilian Portugese you could use: "por_BR", or "pt_BR". Or, you could specify just the language, Portugese: "por", or "pt".

See also
iso639.h

Definition in file iso639.h.

Function Documentation

◆ iso639_str_toName()

MBASE_PUBLIC QString iso639_str_toName ( const unsigned char *  iso639)

Converts a 2 or 3 character iso639 string to a language name in English.

Definition at line 100 of file iso639.cpp.

◆ iso639_key_toName()

MBASE_PUBLIC QString iso639_key_toName ( int  iso639_2)

◆ iso639_clear_language_list()

MBASE_PUBLIC void iso639_clear_language_list ( void  )

Definition at line 22 of file iso639.cpp.

◆ iso639_get_language_list()

MBASE_PUBLIC QStringList iso639_get_language_list ( void  )

Returns list of three character ISO-639 language descriptors, starting with the most preferred.

See also
MythContext::GetLanguage()

Definition at line 33 of file iso639.cpp.

Referenced by EITScanner::EITScanner(), and iso639_get_language_key_list().

◆ iso639_get_language_key_list()

MBASE_PUBLIC std::vector<int> iso639_get_language_key_list ( void  )

Definition at line 56 of file iso639.cpp.

◆ iso639_key_to_canonical_key()

MBASE_PUBLIC int iso639_key_to_canonical_key ( int  iso639_2)

◆ iso639_str2_to_str3()

MBASE_PUBLIC QString iso639_str2_to_str3 ( const QString &  str2)

◆ iso639_key_to_str3()

static QString iso639_key_to_str3 ( int  code)
inlinestatic

Definition at line 44 of file iso639.h.

Referenced by MultipleStringStructure::CanonicalLanguageString(), CaptionServiceDescriptor::CanonicalLanguageString(), SCTEComponentNameDescriptor::CanonicalLanguageString(), NetworkTextTable::CanonicalLanguageString(), ComponentDescriptor::CanonicalLanguageString(), ISO639LanguageDescriptor::CanonicalLanguageString(), DataBroadcastDescriptor::CanonicalLanguageString(), ExtendedEventDescriptor::CanonicalLanguageString(), ShortEventDescriptor::CanonicalLanguageString(), SubtitlingDescriptor::CanonicalLanguageString(), TeletextDescriptor::CanonicalLanguageString(), PrivateUPCCablecomEpisodeTitleDescriptor::CanonicalLanguageString(), MythBDBuffer::GetAudioLanguage(), MythBDBuffer::GetSubtitleLanguage(), ISO639_fill_selections(), iso639_str2_to_str3(), iso639_str_to_canonoical_str(), MultipleStringStructure::LanguageString(), CaptionServiceDescriptor::LanguageString(), SCTEComponentNameDescriptor::LanguageString(), NetworkTextTable::LanguageString(), ComponentDescriptor::LanguageString(), ISO639LanguageDescriptor::LanguageString(), DataBroadcastDescriptor::LanguageString(), SupplementaryAudioDescriptor::LanguageString(), MessageDescriptor::LanguageString(), TargetRegionNameDescriptor::LanguageString(), ExtendedEventDescriptor::LanguageString(), ShortEventDescriptor::LanguageString(), SubtitlingDescriptor::LanguageString(), TeletextDescriptor::LanguageString(), PrivateUPCCablecomEpisodeTitleDescriptor::LanguageString(), MythCCExtractorPlayer::Process608Captions(), MythCCExtractorPlayer::Process708Captions(), MythCCExtractorPlayer::ProcessDVBSubtitles(), and MythCCExtractorPlayer::ProcessTeletext().

◆ iso639_is_key_undefined()

static bool iso639_is_key_undefined ( int  code)
inlinestatic

◆ iso639_str3_to_key() [1/3]

static int iso639_str3_to_key ( const unsigned char *  iso639_2)
inlinestatic

◆ iso639_str3_to_key() [2/3]

static int iso639_str3_to_key ( const char *  iso639_2)
inlinestatic

Definition at line 64 of file iso639.h.

◆ iso639_str3_to_key() [3/3]

static int iso639_str3_to_key ( const QString &  iso639_2)
inlinestatic

Definition at line 69 of file iso639.h.

◆ iso639_str2_to_key2() [1/2]

static int iso639_str2_to_key2 ( const unsigned char *  iso639_1)
inlinestatic

◆ iso639_str2_to_key2() [2/2]

static int iso639_str2_to_key2 ( const char *  iso639_1)
inlinestatic

Definition at line 84 of file iso639.h.

◆ iso639_str_to_canonoical_str()

static QString iso639_str_to_canonoical_str ( const QString &  str3)
inlinestatic

Definition at line 89 of file iso639.h.

◆ GetISO639LanguageName()

MBASE_PUBLIC QString GetISO639LanguageName ( const QString &  iso639Code)

Definition at line 954 of file iso639.cpp.

Referenced by MythLocale::GetNativeLanguage().

◆ GetISO639EnglishLanguageName()

MBASE_PUBLIC QString GetISO639EnglishLanguageName ( const QString &  iso639Code)

Variable Documentation

◆ iso639_key_to_english_name

MBASE_PUBLIC QMap<int, QString> iso639_key_to_english_name