libxfce4util i18n broken
Jasper Huijsmans
jasper at moongroup.com
Thu Aug 7 12:28:50 CEST 2003
Op do 07-08-2003, om 10:56 schreef Benedikt Meurer:
> > I believe the general format for locale is this (not all parts need to
> > be there):
> > ll_LL at modifier.encoding
> >
> > What we want is to try and find a filename for all possible subgroups of
> > this locale:
> >
> > ll_LL at modifier.encoding
> > ll_LL at modifier
> > ll_LL
> > ll
>
> IIRC the correct format is <language>_<country>.<encoding>, so lets
> please use this format. Anyway, the above could easily be supported by
> adding them to the nls.alias file.
>
> I looked for the OpenGroup specs and use in this case and our current
> implementation is compatible with how its done in X/Motif/CDE/etc.
> Please do not change the concept or add hacks to this. %L should be
> replaced with the complete LC_ALL string (e.g. de_DE.ISO8859-1) and %l
> should be replaced with the current language (e.g. de).
>
Ok, the way I see it, your solution (apparently also used by
X/Motif/CDE/etc.) is a special case solution; we have a database that
must contain all possible values, or it won't work. We have already
shown, two intances of LC_ALL values that are currently not supported.
They may be 'broken' according to the standard, but we must assume that
they are widely used.
The solution I proposed, as far as I can see, catches all these
situations and does not need to be adapted when new, unknown
localizations are encountered.
> > Do we really want to support this in xfce_get_path_localized() ? The
> > above scheme is not easy to support. I can split in into prelocale and
> > postlocale parts and then try all subgroups, but it will be a bit messy.
> > At least we have to limit the formats to one locale specifier.
>
> The above scheme does not look right, so I don't think, we need
> support for this. And again: No hacks to get messy stuff going,
> please. First lets figure out, if the current scheme is the correct
> one (I think it is, cause its used with all Unix system I know, and I
> think, Linux does so aswell). This is supported by alll setlocale()
> implementations I know (and again, make sure, you set the correct
> environment variable, most of the time, it is LC_ALL).
>
> > But, frankly I don't think we need a general function like that at all.
> > if we have xfce_get_localized_file and xfce_get_localized_dir, that
> > should be enough for all our purposes. Perhaps a
> > xfce_get_file_in_localized_dir(), but that can easily be done in the
> > application as well.
>
> xfce_get_localized_file() and xfce_get_localized_dir() will be removed
> from libxfce4util in the future, since they are less flexible and
> everything is covered by xfce_get_path_localized().
>
Well everything is covered by using the libc functions directly as well,
that is not the point. My point was that we provide a very general
function that provides flexibility I don't think we need and it doesn't
even work at the moment.
> Anyway, please do not change anything in the i18n stuff before 4.0.
>
Well it doesn't work now, so it has to change.
Jasper
More information about the Xfce4-dev
mailing list