MythTV  master
Typedefs | Functions | Variables
iso639.cpp File Reference
#include "iso639.h"
#include "mythcorecontext.h"
#include <QStringList>
Include dependency graph for iso639.cpp:

Go to the source code of this file.

Typedefs

using ISO639ToNameMap = QMap< QString, QString >
 

Functions

static int createCodeToEnglishNamesMap (QMap< int, QString > &names)
 
static int createCode2ToCode3Map (QMap< int, int > &codemap)
 
static int createCodeToCanonicalCodeMap (QMap< int, int > &canonical)
 
void iso639_clear_language_list (void)
 
QStringList iso639_get_language_list (void)
 Returns list of three character ISO-639 language descriptors, starting with the most preferred. More...
 
std::vector< int > iso639_get_language_key_list (void)
 
QString iso639_str2_to_str3 (const QString &str2)
 
static QString iso639_Alpha3_toName (const unsigned char *iso639_2)
 
static QString iso639_Alpha2_toName (const unsigned char *iso639_1)
 
QString iso639_str_toName (const unsigned char *iso639)
 Converts a 2 or 3 character iso639 string to a language name in English. More...
 
QString iso639_key_toName (int iso639_2)
 Converts a canonical key to language name in English. More...
 
int iso639_key_to_canonical_key (int iso639_2)
 
static ISO639ToNameMap createLanguageMap (void)
 
QString GetISO639LanguageName (const QString &iso639_1)
 
QString GetISO639EnglishLanguageName (const QString &iso639_1)
 

Variables

QMap< int, QString > iso639_key_to_english_name
 
static QMap< int, int > s_iso639_key2_to_key3
 
static QMap< int, int > s_iso639_key3_to_canonical_key3
 
static QStringList s_languages
 
static std::vector< int > s_language_keys
 
int dummy_createCodeToEnglishNamesMap
 
int dummy_createCode2ToCode3Map
 
int dummy_createCodeToCanonicalCodeMap
 
static ISO639ToNameMap gLanguageMap
 

Typedef Documentation

◆ ISO639ToNameMap

using ISO639ToNameMap = QMap<QString, QString>

Definition at line 871 of file iso639.cpp.

Function Documentation

◆ createCodeToEnglishNamesMap()

static int createCodeToEnglishNamesMap ( QMap< int, QString > &  names)
static

Generated from http://www.loc.gov/standards/iso639-2/ascii_8bits.html using awk script: cat ISO-639-2_values_8bits.txt | \ awk -F'|' \ '{printf " names[iso639_str3_to_key(\"s")] = QString("s");
", \ $1, $4}'

with hand editing for duplicates ("ger"=="deu").

Definition at line 173 of file iso639.cpp.

◆ createCode2ToCode3Map()

static int createCode2ToCode3Map ( QMap< int, int > &  codemap)
static

Definition at line 657 of file iso639.cpp.

◆ createCodeToCanonicalCodeMap()

static int createCodeToCanonicalCodeMap ( QMap< int, int > &  canonical)
static

Definition at line 135 of file iso639.cpp.

◆ iso639_clear_language_list()

void iso639_clear_language_list ( void  )

Definition at line 22 of file iso639.cpp.

◆ iso639_get_language_list()

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()

std::vector<int> iso639_get_language_key_list ( void  )

Definition at line 56 of file iso639.cpp.

◆ iso639_str2_to_str3()

QString iso639_str2_to_str3 ( const QString &  str2)

◆ iso639_Alpha3_toName()

static QString iso639_Alpha3_toName ( const unsigned char *  iso639_2)
static

Definition at line 79 of file iso639.cpp.

Referenced by iso639_str_toName().

◆ iso639_Alpha2_toName()

static QString iso639_Alpha2_toName ( const unsigned char *  iso639_1)
static

Definition at line 90 of file iso639.cpp.

Referenced by iso639_str_toName().

◆ iso639_str_toName()

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()

QString iso639_key_toName ( int  iso639_2)

◆ iso639_key_to_canonical_key()

int iso639_key_to_canonical_key ( int  iso639_2)

◆ createLanguageMap()

static ISO639ToNameMap createLanguageMap ( void  )
static

Definition at line 872 of file iso639.cpp.

Referenced by GetISO639LanguageName().

◆ GetISO639LanguageName()

QString GetISO639LanguageName ( const QString &  iso639_1)

Definition at line 954 of file iso639.cpp.

Referenced by MythLocale::GetNativeLanguage().

◆ GetISO639EnglishLanguageName()

QString GetISO639EnglishLanguageName ( const QString &  iso639_1)

Variable Documentation

◆ iso639_key_to_english_name

QMap<int, QString> iso639_key_to_english_name

◆ s_iso639_key2_to_key3

QMap<int, int> s_iso639_key2_to_key3
static

Definition at line 11 of file iso639.cpp.

Referenced by iso639_Alpha2_toName(), and iso639_str2_to_str3().

◆ s_iso639_key3_to_canonical_key3

QMap<int, int> s_iso639_key3_to_canonical_key3
static

Definition at line 12 of file iso639.cpp.

Referenced by iso639_key_to_canonical_key().

◆ s_languages

QStringList s_languages
static

Definition at line 13 of file iso639.cpp.

Referenced by iso639_clear_language_list(), and iso639_get_language_list().

◆ s_language_keys

std::vector<int> s_language_keys
static

Definition at line 14 of file iso639.cpp.

Referenced by iso639_clear_language_list(), and iso639_get_language_key_list().

◆ dummy_createCodeToEnglishNamesMap

int dummy_createCodeToEnglishNamesMap
Initial value:

Definition at line 126 of file iso639.cpp.

◆ dummy_createCode2ToCode3Map

int dummy_createCode2ToCode3Map
Initial value:

Definition at line 129 of file iso639.cpp.

◆ dummy_createCodeToCanonicalCodeMap

int dummy_createCodeToCanonicalCodeMap
Initial value:

Definition at line 132 of file iso639.cpp.

◆ gLanguageMap

ISO639ToNameMap gLanguageMap
static

Definition at line 952 of file iso639.cpp.

Referenced by GetISO639LanguageName().

s_iso639_key2_to_key3
static QMap< int, int > s_iso639_key2_to_key3
Definition: iso639.cpp:11
s_iso639_key3_to_canonical_key3
static QMap< int, int > s_iso639_key3_to_canonical_key3
Definition: iso639.cpp:12
createCodeToCanonicalCodeMap
static int createCodeToCanonicalCodeMap(QMap< int, int > &canonical)
Definition: iso639.cpp:135
createCode2ToCode3Map
static int createCode2ToCode3Map(QMap< int, int > &codemap)
Definition: iso639.cpp:657
iso639_key_to_english_name
QMap< int, QString > iso639_key_to_english_name
Definition: iso639.cpp:10
createCodeToEnglishNamesMap
static int createCodeToEnglishNamesMap(QMap< int, QString > &names)
Definition: iso639.cpp:173