Function

AppStreamutils_locale_is_compatible

since: 0.9.5

Declaration [src]

gboolean
as_utils_locale_is_compatible (
  const gchar* locale1,
  const gchar* locale2
)

Description [src]

Calculates if one locale is compatible with another, meaning that translations for one of them can be shown for the other. Locales may be in POSIX or BCP47 format, in any spelling, and scripts implied by a region are taken into account, so “zh_CN” is compatible with “zh-Hans” and “sr_RS@latin” with “sr-Latn”. Any locale is compatible with its plain language.

Available since: 0.9.5

Parameters

locale1

Type: const gchar*

A BCP47 or POSIX locale string, or NULL.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
locale2

Type: const gchar*

A BCP47 or POSIX locale string, or NULL.

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

Return value

Type: gboolean

TRUE if the locale is compatible.