Re: Patch for Automated RTL widgets
- From: Ali Abdin <aliabdin aucegypt edu>
- To: otaylor fresnel labs redhat com
- Cc: gtk-devel-list gnome org
- Subject: Re: Patch for Automated RTL widgets
- Date: Tue, 03 Oct 2000 02:50:18 -0200
* otaylor fresnel labs redhat com (otaylor fresnel labs redhat com) wrote at 02:43 on 02/10/00:
>
> 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.
Yeah - I was gonna use this (as a second alternative to g_i18n_*) but I wasn't
sure which env variable I should actually look for? Should it be LC_ALL?
LC_MESSAGES? LC_CTYPE? What about the LANG environment variable (set by gdm?)
Also - from my understand this is the format or the LC_ALL environemtn
variable: language[_territory][ codeset][ modifier]
Do we actually need to worry/handle the codeset/modifier (I think they can be
ignored?)
Again, it would be nice to know the status of g_i18n_* (i.e. should I wait for
it? should I start writing 'hacks' to improve my previous simple patch?)
Regards,
Ali
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]