GLib.get_locale_variants

function get_locale_variants(locale: String): Array(String) {
    // Gjs wrapper for g_get_locale_variants()
}
  

Returns a list of derived variants of locale, which can be used to e.g. construct locale-dependent filenames or search paths. The returned list is sorted from most desirable to least desirable. This function handles territory, charset and extra locale modifiers.

For example, if locale is "fr_BE", then the returned list is "fr_BE", "fr".

If you need the list of variants for the current locale, use GLib.get_language_names.

Since 2.28

locale

a locale identifier

Returns

a newly allocated array of newly allocated strings with the locale variants. Free with GLib.strfreev.