Top |
gchar ** | gst_tag_get_language_codes () |
const gchar * | gst_tag_get_language_name () |
#define | gst_tag_get_language_code() |
const gchar * | gst_tag_get_language_code_iso_639_1 () |
const gchar * | gst_tag_get_language_code_iso_639_2B () |
const gchar * | gst_tag_get_language_code_iso_639_2T () |
gboolean | gst_tag_check_language_code () |
Provides helper functions to convert between the various ISO-639 language codes, and to map language codes to language names.
gchar **
gst_tag_get_language_codes (void
);
Returns a list of known language codes (in form of two-letter ISO-639-1 codes). This is useful for UIs to build a list of available languages for tagging purposes (e.g. to tag an audio track appropriately in a video or audio editor).
NULL-terminated string array with two-letter
language codes. Free with g_strfreev()
when no longer needed.
[transfer full]
const gchar *
gst_tag_get_language_name (const gchar *language_code
);
Returns the name of the language given an ISO-639 language code as found in a GST_TAG_LANGUAGE_CODE tag. The name will be translated according to the current locale (if the library was built against the iso-codes package, otherwise the English name will be returned).
Language codes are case-sensitive and expected to be lower case.
#define gst_tag_get_language_code(lang_code)
Convenience macro wrapping gst_tag_get_language_code_iso_639_1()
.
const gchar *
gst_tag_get_language_code_iso_639_1 (const gchar *lang_code
);
Returns two-letter ISO-639-1 language code given a three-letter ISO-639-2 language code or two-letter ISO-639-1 language code (both are accepted for convenience).
Language codes are case-sensitive and expected to be lower case.
const gchar *
gst_tag_get_language_code_iso_639_2B (const gchar *lang_code
);
Returns three-letter ISO-639-2 "bibliographic" language code given a two-letter ISO-639-1 language code or a three-letter ISO-639-2 language code (both are accepted for convenience).
The "bibliographic" code is derived from the English name of the language (e.g. "ger" for German instead of "de" or "deu"). In most scenarios, the "terminological" codes are prefered.
Language codes are case-sensitive and expected to be lower case.
const gchar *
gst_tag_get_language_code_iso_639_2T (const gchar *lang_code
);
Returns three-letter ISO-639-2 "terminological" language code given a two-letter ISO-639-1 language code or a three-letter ISO-639-2 language code (both are accepted for convenience).
The "terminological" code is derived from the local name of the language (e.g. "deu" for German instead of "ger"). In most scenarios, the "terminological" codes are prefered over the "bibliographic" ones.
Language codes are case-sensitive and expected to be lower case.
gboolean
gst_tag_check_language_code (const gchar *lang_code
);
Check if a given string contains a known ISO 639 language code.
This is useful in situations where it's not clear whether a given string is a language code (which should be put into a GST_TAG_LANGUAGE_CODE tag) or a free-form language name descriptor (which should be put into a GST_TAG_LANGUAGE_NAME tag instead).