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
This commit is contained in:
Philip Withnall 2018-01-08 10:33:54 +00:00
parent 7c8906dcda
commit 8f7cc8cb75

View File

@ -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