[glib] gkeyfile: Document need for KEEP_TRANSLATIONS with get_locale_string()
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gkeyfile: Document need for KEEP_TRANSLATIONS with get_locale_string()
- Date: Mon, 8 Jan 2018 10:55:57 +0000 (UTC)
commit 8f7cc8cb75b62393842603eef1bb93001a581202
Author: Philip Withnall <withnall endlessm com>
Date: Mon Jan 8 10:33:54 2018 +0000
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
glib/gkeyfile.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/glib/gkeyfile.c b/glib/gkeyfile.c
index e45661a..732e05b 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]