On Sat, Oct 22, 2005 at 12:02:43AM +0200, Denis Barbier wrote: > There is very good documentation in libc.info, section "Yes-or-No Questions", > but unfortunately it is not relevant here because adduser is a perl script. > So I had a look at perllocale(1), which has some nice tips, in particular > about I18N::Langinfo. But be warned that their example is not very > valuable under GNU/Linux, because glibc introduced YESSTR/NOSTR lately > and many locales do not provide them. On the other hand, they all > provide YESEXPR/NOEXPR, so you can run something like: > use I18N::Langinfo qw(langinfo YESEXPR); > my $yesexpr = langinfo(YESEXPR()); > for (;;) { > &systemcall('/usr/bin/chfn', $new_name); > # Translators: [y/N] has to be replaced by values defined in your > # locale. You can see by running "locale yesexpr" which regular > # expression will be checked to find positive answer. > print (gtx("Is the information correct? [y/N] ")); > chop ($answer=<STDIN>); > last if ($answer =~ m/$yesexpr/o); > }
Applied, thanks. > Of course this comment may be improved ;) > You need to call xgettext with the -c flag so that comments are inserted > into PO files. that would be XGETTEXT = xgettext -c in po/Makefile, right? Done. > Other minor i18n problems with your package: > * the gtx() function is useless and confuses xgettext gtx was named _ previously and is obviously modeled after the _ macro suggested in the gettext texinfo documentation. I'd like to keep it to be able to disable i18n for testing and debugging purposes. Unfortunately, it cannot be named _ as File::Find starts to behave very strangely when a function called _ is in the namespace. Is it possible to overload gettext with a no-op for testing purposes? If so, your changes are acceptable. I'd like to have gettext in a state where it can be disabled. Can't xgettexts confusion be remedied by replacing -k_ with -kgtx in the Makefile? I have tried this in the lastest upload to experimental, please verify. > Here is a patch. I tested it, but of course it may introduce bugs, > please review it carefully ;) I applied the changes, but left gtx intact. Please reconsider this suggestion. > s_print (gtx("Backing up files to be removed to ". $config{"backup_to"}. " > ...\n")); Doesn't this cause translation pain as well? I have changed it to s_printf (gtx("Backing up files to be removed to %s ...\n"),$config{"backup_to"}); -- ----------------------------------------------------------------------------- Marc Haber | "I don't trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]