bt_language_names.h File Reference

Utilities for handling and manipulating language names. More...

#include "bt_utilities_internal.h"
#include "bt_language_names_enum.h"

Include dependency graph for bt_language_names.h:

This graph shows which files directly or indirectly include this file:


Typedefs

typedef int BT_LanguageID
 Language Identifier.

Functions

const char * BT_ISO639FromLanguageID (BT_LanguageID id)
 Gets the ISO 639-1 language code given the language id.
const char * BT_ISO639FromLanguageName (const char *name)
 Gets the ISO 639-1 language code given the language name.
BT_LanguageID BT_LanguageIDFromISO639 (const char *iso639)
 Gets the language ID given the ISO 639-1 code.
BT_LanguageID BT_LanguageIDFromLanguageName (const char *name)
 Gets the language ID given the language name. Returns the language ID given the (English) name of the language. If the name is invalid (a null or empty string) or non-existent then BT_LANGUAGE_UNKNOWN is returned.
const char * BT_LanguageNameFromISO639 (const char *iso639)
 Gets the language name given the ISO 639-1 two letter code.
const char * BT_LanguageNameFromLanguageID (BT_LanguageID id)
 Gets the language name given the language id.

Detailed Description

This module provides various routines for dealing with the names of languages. It provides the ability to refer to names by numeric ID, ISO 639-1 language code, or English name, and to convert between these representations.

Additional codes were added beyond those in ISO 639-1 for:


Typedef Documentation

typedef int BT_LanguageID

Languages can be referred to by a numeric identifier of this type.


Function Documentation

const char* BT_ISO639FromLanguageID ( BT_LanguageID  id  ) 

Returns the ISO 639-1 language code given the language ID. If the language ID is invalid (the range BT_LANGUAGE_UNKNOWN and BT_LANGUAGE_MAX_ID) then the string "xx" is returned.

Comparisons are case sensitive.

Parameters:
id The language id.
Returns:
The ISO 639-1 code, or "xx", as a null-terminated ASCII string.

const char* BT_ISO639FromLanguageName ( const char *  name  ) 

Returns the ISO 639-1 language code given the (English) language name. If the name is invalid (a null or empty string) or non-existent then the string "xx" is returned.

Parameters:
name The English language name as a null-terminated ASCII string.
Returns:
The ISO 639-1 code, or "xx", as a null-terminated ASCII string.

BT_LanguageID BT_LanguageIDFromISO639 ( const char *  iso639  ) 

Returns the language ID given the ISO 639-1 language code. If the code is invalid (a null or empty string) or non-existent then BT_LANGUAGE_UNKNOWN is returned.

Comparisons are case sensitive.

Parameters:
iso639 The ISO 639-1 code as a null-terminated ASCII string.
Returns:
The language ID, or BT_LANGUAGE_UNKNOWN.

BT_LanguageID BT_LanguageIDFromLanguageName ( const char *  name  ) 

Comparisons are case sensitive.

Parameters:
name The English language name as a null-terminated ASCII string.
Returns:
The language ID, or BT_LANGUAGE_UNKNOWN.

const char* BT_LanguageNameFromISO639 ( const char *  iso639  ) 

Returns the (English) language name given the ISO 639-1 code. If the the code is invalid (a null or empty string) or non-existent then the string "Unknown" is returned.

Parameters:
iso639 The ISO 639-1 code as a null-terminated ASCII string.
Returns:
The (English) name of the language, or "Unknown", in ASCII.

const char* BT_LanguageNameFromLanguageID ( BT_LanguageID  id  ) 

Returns the (English) language name given the language ID. If the language ID is invalid (the range BT_LANGUAGE_UNKNOWN and BT_LANGUAGE_MAX_ID) then the string "Unknown" is returned.

Parameters:
id The language id.
Returns:
The (English) name of the language, or "Unknown", in ASCII.


Copyright © 2004-2008 Basis Technology Corporation. All Rights Reserved.