Re: Patch for Automated RTL widgets
- From: otaylor fresnel labs redhat com
- To: gtk-devel-list gnome org
- Subject: Re: Patch for Automated RTL widgets
- Date: 02 Oct 2000 12:40:35 -0400
George <jirka 5z com> writes:
> On Sat, Sep 30, 2000 at 04:10:22PM -0200, Ali Abdin wrote:
> > I am resending this because apparently my first mail didn't get through
> > (possible due to the gnome.org DNS issues)
> >
> > Anyway, attached is a patch for gtk_init that checks wether your locale
> > (LC_ALL or LANG) is Arabic or Hebrew, if it is then it will automatically set
> > the widget direction to RTL.
> >
> > I think this is needed because LTR widgets with Arabic characters is not a
> > very nice thing to look at. You can still run apps the traditional way by
> > unsetting the locale for just that specific app.
> >
> > This beats the alternative of having to manually set the text direction (by
> > calling gtk_widget_set_default_direction in each and every app that wants to
> > have an RTL direction.
>
> Note one caveat:
>
> It doesn't deal with aliases. For example it would set RTL for
> "LANG=hungarian", and it wouldn't set it for "LANG=hebrew.iso88598", both of
> which are valid locales on my system.
>
> It could be done if g_i18n_* stuff with unaliasing gets stuffed into glib.
> Then you could just check the first two letters of the first string in the
> language list.
Well, the other way of properly doing this, which I tend to think
is more right, is:
loc_to_match = setlocale (LC_CTYPE, NULL);
That is, let the C library tell you what locale it is using.
It will have already dealiased the locale.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]