[vdr] improving i18n-to-gettext.pl
zzam at gentoo.org
Sat Aug 18 12:55:40 CEST 2007
On Freitag, 17. August 2007, Klaus Schmidinger wrote:
> On 08/15/07 15:07, Matthias Schwarzott wrote:
> > On Mittwoch, 15. August 2007, Klaus Schmidinger wrote:
> > This will work, but only if the locale de_AT you set does exist (being in
> > output of locale -a).
> >> but it came up with the default English texts. Then I renamed
> >> "de" to "de_AT" and did the same again, and I got the German texts.
> >> I was hoping that gettext would be a little more intelligent and
> >> look for
> >> - an exact match ("de_AT")
> >> - a default ("de")
> >> - any suitable language ("de_DE")
> > I think it does this but not doing "any suitable language".
> > ...
> Could you please try the attached patch and see whether this
> works for you?
> This should, e.g., select any "de*" locale in case there is no fully
> matching one.
Not yet tested, but code looks promising.
Another way to get list of usable locales is this:
Checking the subdirs of /usr/lib/locale/
And then using all, that have associated mo file under vdr's LOCALEDIR.
Sadly I don't know if there is a better way than hardcoding that directory.
But "locale -a" command will give the same result - maybe analyzing its code
will help (or just calling this external command).
Matthias Schwarzott (zzam)
More information about the vdr