GKeyFile: add API for getting locale of a string

Desktop / GNOME / GLib - Allison Lortie [desrt.ca] - 6 February 2018 15:51 EST

g_key_file_get_locale_string() returns a translated string from the keyfile. In some cases, it may be useful to know the locale that that string came from.

Add a new API, g_key_file_get_locale_for_key(), that returns the locale of the string.

Include tests.

(Modified by Philip Withnall to rename the API and fix some minor review issues. Squash in a separate test case commit.)

https://bugzilla.gnome.org/show_bug.cgi?id=605700

1574321e5 GKeyFile: add API for getting locale of a string
docs/reference/glib/glib-sections.txt | 1 +
glib/gkeyfile.c | 62 +++++++++++++++++++++++++++++++++++
glib/gkeyfile.h | 5 +++
glib/tests/keyfile.c | 41 +++++++++++++++++++++++
4 files changed, 109 insertions(+)

Upstream: git.gnome.org


  • Share