## AsTranslation

AsTranslation — Description of translation domains for an upstream component.

## Functions

const gchar * | as_translation_kind_to_string ()
AsTranslationKind | as_translation_kind_from_string ()
AsTranslation * | as_translation_new ()
AsTranslationKind | as_translation_get_kind ()
void | as_translation_set_kind ()
const gchar * | as_translation_get_id ()
void | as_translation_set_id ()
const gchar * | as_translation_get_source_locale ()
void | as_translation_set_source_locale ()

## Types and Values

#define | AS_TYPE_TRANSLATION
struct | AsTranslationClass
enum | AsTranslationKind
| AsTranslation

## Includes

    #include <appstream.h>

## Description

Describes the translation domain and translation system used by the upstream component. See the specification for more information on the corresponding XML tag.

See also: AsComponent

## Functions

### as_translation_kind_to_string ()

    const gchar *
    as_translation_kind_to_string (AsTranslationKind kind);

Converts the enumerated value to a text representation.

#### Parameters

kind | the AsTranslationKind. |

#### Returns

string version of `kind`

### as_translation_kind_from_string ()

    AsTranslationKind
    as_translation_kind_from_string (const gchar *kind_str);

Converts the text representation to an enumerated value.

#### Parameters

kind_str | the string. |

#### Returns

a AsTranslationKind or `AS_TRANSLATION_KIND_UNKNOWN` for unknown

### as_translation_new ()

    AsTranslation *
    as_translation_new (void);

Creates a new AsTranslation.

#### Returns

a AsTranslation.

[transfer full]

### as_translation_get_kind ()

    AsTranslationKind
    as_translation_get_kind (AsTranslation *tr);

The translation system type.

#### Parameters

tr | a AsTranslation instance. |

#### Returns

an enum of type AsTranslationKind

### as_translation_set_kind ()

    void
    as_translation_set_kind (AsTranslation *tr,
                             AsTranslationKind kind);

Set the translation system type.

#### Parameters

tr | a AsTranslation instance. |
kind | the new AsTranslationKind |

### as_translation_get_id ()

    const gchar *
    as_translation_get_id (AsTranslation *tr);

The ID (e.g. Gettext translation domain) of this translation.

#### Parameters

tr | a AsTranslation instance. |

### as_translation_set_id ()

    void
    as_translation_set_id (AsTranslation *tr,
                           const gchar *id);

Set the ID (e.g. Gettext domain) of this translation.

#### Parameters

tr | a AsTranslation instance. |
id | The ID of this translation. |

### as_translation_get_source_locale ()

    const gchar *
    as_translation_get_source_locale (AsTranslation *tr);

The locale of the source strings for this component. If this has not been explicitly specified, `en_US` will be returned.

#### Parameters

tr | a AsTranslation instance. |

#### Returns

The locale of the source strings for this component.

[not nullable]

Since: 0.14.6

### as_translation_set_source_locale ()

    void
    as_translation_set_source_locale (AsTranslation *tr,
                                      const gchar *locale);

Set the locale of the source strings for this component. In gettext, this is referred to as the `C` locale. It’s almost always `en_US`, but for some components it may not be.

#### Parameters

tr | a AsTranslation instance. |
locale | The POSIX locale that the source strings are in, or `NULL` if unknown or default. | [nullable]

Since: 0.14.6

## Types and Values

### AS_TYPE_TRANSLATION

    #define AS_TYPE_TRANSLATION (as_translation_get_type ())

### struct AsTranslationClass

    struct AsTranslationClass {
    	GObjectClass		parent_class;
    };

### enum AsTranslationKind

The translation type.

#### Members

AS_TRANSLATION_KIND_UNKNOWN | Type invalid or not known |
AS_TRANSLATION_KIND_GETTEXT | Gettext translation domain |
AS_TRANSLATION_KIND_QT | Qt translation domain |

### AsTranslation

    typedef struct _AsTranslation AsTranslation;