diff options
author | Philip Withnall <withnall@endlessm.com> | 2018-01-08 10:33:54 +0000 |
---|---|---|
committer | Philip Withnall <withnall@endlessm.com> | 2018-01-08 10:55:42 +0000 |
commit | 8f7cc8cb75b62393842603eef1bb93001a581202 (patch) | |
tree | ca02c1fd810508fa3bd97dcbacc596d6b659c2c1 /glib/gkeyfile.c | |
parent | 7c8906dcdabf30ac248e0f6838f71a3af9645aa5 (diff) | |
download | glib-8f7cc8cb75b62393842603eef1bb93001a581202.tar.gz |
gkeyfile: Document need for KEEP_TRANSLATIONS with get_locale_string()
When using g_key_file_get_locale_string() or get_locale_string_list(),
the GKeyFile must have been loaded with G_KEY_FILE_KEEP_TRANSLATIONS if
the lookup locale differs from the one which was current when the key
file was loaded.
Document that.
Signed-off-by: Philip Withnall <withnall@endlessm.com>
https://bugzilla.gnome.org/show_bug.cgi?id=792324
Diffstat (limited to 'glib/gkeyfile.c')
-rw-r--r-- | glib/gkeyfile.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/glib/gkeyfile.c b/glib/gkeyfile.c index e45661a69..732e05b08 100644 --- a/glib/gkeyfile.c +++ b/glib/gkeyfile.c @@ -2183,6 +2183,10 @@ g_key_file_set_locale_string (GKeyFile *key_file, * translated in the given @locale if available. If @locale is * %NULL then the current locale is assumed. * + * If @locale is to be non-%NULL, or if the current locale will change over + * the lifetime of the #GKeyFile, it must be loaded with + * %G_KEY_FILE_KEEP_TRANSLATIONS in order to load strings for all locales. + * * If @key cannot be found then %NULL is returned and @error is set * to #G_KEY_FILE_ERROR_KEY_NOT_FOUND. If the value associated * with @key cannot be interpreted or no suitable translation can @@ -2271,6 +2275,10 @@ g_key_file_get_locale_string (GKeyFile *key_file, * translated in the given @locale if available. If @locale is * %NULL then the current locale is assumed. * + * If @locale is to be non-%NULL, or if the current locale will change over + * the lifetime of the #GKeyFile, it must be loaded with + * %G_KEY_FILE_KEEP_TRANSLATIONS in order to load strings for all locales. + * * If @key cannot be found then %NULL is returned and @error is set * to #G_KEY_FILE_ERROR_KEY_NOT_FOUND. If the values associated * with @key cannot be interpreted or no suitable translations |