AppStreamCompose.TranslateDesktopTextFn
Description: Reference for AppStreamCompose.TranslateDesktopTextFn

### Function

# AppStreamComposeTranslateDesktopTextFn

since: 0.14.2

#### Declaration

    GPtrArray*
    (* AscTranslateDesktopTextFn) (
      GKeyFile* de,
      const gchar* text,
      gpointer user_data
    )

#### Description [src]

Function which is called while parsing a desktop-entry file to allow external translations of string values. This is used in e.g. the Ubuntu distribution.

The return value must contain a list of strings with the locale name in even indices, and the text translated to the preceding locale in the following odd indices.

Available since: 0.14.2

#### Parameters

`de`

  Type: `GKeyFile`

  A pointer to the desktop-entry data we are reading.

  The data is owned by the caller of the function.

`text`

  Type: `const gchar*`

  The string to translate.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`user_data`

  Type: `gpointer`

  Additional data.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

#### Return value

Type: An array of `utf8`

A new `GPtrArray` containing the translation mapping.

The caller of the function takes ownership of the data, and is responsible for freeing it.
Each element is a NUL terminated UTF-8 string.