From 5b6f118ba4b87c2d9ba834620b11c3f44119dce1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 6 Dec 2006 23:18:04 +0000 Subject: [PATCH] Set context language to pango_language_get_default() instead of hardcoding 2006-12-06 Behdad Esfahbod * examples/renderdemo.c (do_output): Set context language to pango_language_get_default() instead of hardcoding "en-US". * pango/pango-utils.c (pango_language_get_default): Improve docs. --- ChangeLog | 7 +++++++ examples/renderdemo.c | 2 +- pango/pango-utils.c | 9 ++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index cfabbb7..8fc8df1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2006-12-06 Behdad Esfahbod + * examples/renderdemo.c (do_output): Set context language to + pango_language_get_default() instead of hardcoding "en-US". + + * pango/pango-utils.c (pango_language_get_default): Improve docs. + +2006-12-06 Behdad Esfahbod + Bug 333982 – Fallback to $LANG whenever NULL PangoLanguage is used Patch from LingNing Zhang diff --git a/examples/renderdemo.c b/examples/renderdemo.c index 17b5061..d94053f 100644 --- a/examples/renderdemo.c +++ b/examples/renderdemo.c @@ -274,7 +274,7 @@ do_output (PangoContext *context, set_transform (context, transform_cb, cb_context, cb_data, NULL); - pango_context_set_language (context, pango_language_from_string ("en_US")); + pango_context_set_language (context, pango_language_get_default ()); pango_context_set_base_dir (context, opt_rtl ? PANGO_DIRECTION_RTL : PANGO_DIRECTION_LTR); diff --git a/pango/pango-utils.c b/pango/pango-utils.c index ea48084..d0acc83 100644 --- a/pango/pango-utils.c +++ b/pango/pango-utils.c @@ -1051,9 +1051,12 @@ _pango_get_lc_ctype (void) /** * pango_language_get_default: * - * Returns the #PangoLanguage for the current locale of the running - * process. Note that this can change over the life of an - * application. + * Returns the #PangoLanguage for the current locale of the process. + * Note that this can change over the life of an application. + * + * Your application should call setlocale (LC_ALL, ""); + * for the user settings to take effect. Gtk+ does this in its initialization + * functions. See man setlocale for details. * * Return value: the default language as a #PangoLanguage, must not be * freed. -- 2.7.4