get_language_from_locale does not always return full locale
Disclaimer: My lingua might not be 100% accurate on the technical terms.
I am trying to get the fully specified locale (e.g. German (Austria)
for de_AT
) from a locale string with get_language_from_locale
from gnome-desktop
in Python:
import gi
gi.require_version('GnomeDesktop','3.0')
from gi.repository import GnomeDesktop
GnomeDesktop.get_language_from_locale('de_AT')
This works all nice and swell for most locales, but I found that for locales configured on the system, this only yields a generic version of the locale (in the Austria example it would be just 'German').
This screenshot shows the difference:
gnome-desktop 3.38.3, glib 2.66.4
Edited by Peter Eisenmann