After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 333982 - Fallback to $LANG whenever NULL PangoLanguage is used
Fallback to $LANG whenever NULL PangoLanguage is used
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
unspecified
Other All
: Normal minor
: ---
Assigned To: Behdad Esfahbod
pango-maint
Depends on:
Blocks: 353341
 
 
Reported: 2006-03-09 06:12 UTC by Behdad Esfahbod
Modified: 2006-12-06 22:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
my patch (1.66 KB, patch)
2006-06-19 07:47 UTC, LingNing Zhang
none Details | Review
modified patch (4.80 KB, patch)
2006-06-19 09:42 UTC, LingNing Zhang
committed Details | Review

Description Behdad Esfahbod 2006-03-09 06:12:16 UTC
Whenever a NULL PangoLanguage is used, we should fall back to $LANG and other env vars.  With Gtk+ code, setting language is not much problem, but code not using Gtk+ has a hard time to figure out what to pass in for PangoLanguage (other than say NULL and "en".)
Comment 1 Behdad Esfahbod 2006-06-15 06:22:38 UTC
The logic for this is already in gtk_get_default_language() (except that there's no need to special handle '.' and '@'.  I've fixed pango_language_from_string to do that already.)

The most non intrusive way is to just go on and add pango_get_default_language(), and leave it to the user to set context language to that of get_default_language.  
Comment 2 LingNing Zhang 2006-06-19 07:47:42 UTC
Created attachment 67605 [details] [review]
my patch

I wrote a patch for this bug. I added pango_get_default_language( ) in this patch.
Comment 3 Behdad Esfahbod 2006-06-19 08:33:10 UTC
Thanks LingNing.  Can you update the patch to include documentation (copy from gtk+ and adapt), and hook it into pango.def and docs/pango-sections.txt too?
Comment 4 LingNing Zhang 2006-06-19 08:45:26 UTC
ok, I will do it.
:)
Comment 5 LingNing Zhang 2006-06-19 09:42:17 UTC
Created attachment 67610 [details] [review]
modified patch

add the documentation , and add it into pango.def and docs/pango-sections.txt.
Comment 6 Behdad Esfahbod 2006-12-06 22:58:57 UTC
Committed after renaming to pango_language_get_default() and docs improvement.

2006-12-06  Behdad Esfahbod  <behdad@gnome.org>

        Bug 333982 – Fallback to $LANG whenever NULL PangoLanguage is used 
        Patch from LingNing Zhang

        * docs/pango-sections.txt:
        * docs/tmpl/utils.sgml:
        * pango/pango-context.c:
        * pango/pango-types.h:
        * pango/pango-utils.c (_pango_get_lc_ctype),
        (pango_language_get_default):
        * pango/pango.def:
        New public function pango_language_get_default().  Note that, this
        does not make Pango fallback to the default language automatically,
        but the user can use this function to set the default language of the
        locale on a context:

          pango_context_set_language (context, pango_language_get_default());