On 2013-03-06T10:57:02Z, DAXIM wrote:
Show quoted text> I don't think so. If you don't like the restriction of locales, then
> why didn't you just dump and reuse the langinfo data?
I would if I could find it.
Show quoted text> I'm curious where
> you got the L::B::T translations from as the quality is awfully poor
> compared with I18N::Langinfo.
Wiktionary mostly.
Show quoted text> I found the following problems within the
> first 10 minutes:
>
> 1. It treats an invalid input (typoes!) always as "no", precluding
any
Show quoted text> validation.
"No" returns 0. Invalid inputs return undef. This is documented.
If you need to distinguish between these cases, just use Perl's
"defined" function. However, interpreting unknown input as "no" is
fairly standard procedure. Compare with "rm -i".
Show quoted text> 2. It does not accept "j", only "ja", but typically that sort of
> interface only needs the first letter/character, and also prompts
> that way.
OK, I shall change that.
Show quoted text> 3. It requires interpunction ("。") for Chinese, but it's unheard of to
> reject answers that do not include interpunction, such as "是".
> 4. It does not register "否", but that's the standard answer which is
> used everywhere.
> 5. It accepts "shi", but not "dui".
I don't speak most of the languages supported by Lingua::Boolean::Tiny,
so there's a bit of guesswork in there. Happy to make these changes.
Show quoted text> 6. There are only 12 languages, but
>
> locale -a|perl -lne'next if /^C|POSIX/; s/_.*//; print'|uniq -c|
wc -
Show quoted text> l
>
> counts 164 languages, and of the 449 total locales 442 work with
> Perl's langinfo interface out of the box.
On my system that lists two languages (English and Chinese).
I did experiment with I18N::Langinfo as suggested, however I had
difficulty selecting a locale at run-time, and found that for a locale
to work properly, extra files needed to be installed, which I couldn't
rely on.