[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Quilt-dev] Call for 0.42
From: |
Andreas Gruenbacher |
Subject: |
Re: [Quilt-dev] Call for 0.42 |
Date: |
Fri, 22 Jul 2005 00:34:04 +0200 |
User-agent: |
KMail/1.7.1 |
Hi Jean,
On Thursday 21 July 2005 22:59, Jean Delvare wrote:
> I gave this a try and have something that seems to work, but it's not
> exactly elegant (especially the "no strict" which is needed). Does it
> look like something I can commit, or not?
I'm no expert in this, but maybe you like the following snippet slightly
better.
#! /usr/bin/perl -w
use POSIX qw(setlocale LC_MESSAGES);
use strict;
BEGIN {
if (eval { require Locale::gettext }) {
import Locale::gettext;
} else {
eval '
sub bindtextdomain($$) { }
sub textdomain($) { }
sub gettext($) { shift }
'
}
}
setlocale(LC_MESSAGES, "");
bindtextdomain("quilt", "/usr/share/locale");
textdomain("quilt");
sub _($) {
return gettext(shift);
}
print _("Foo") . "\n";
The second eval needs to be passed a string or else Perl will complain.
-- Andreas.
- [Quilt-dev] Call for 0.42, Jean Delvare, 2005/07/19
- Re: [Quilt-dev] Call for 0.42, Andreas Gruenbacher, 2005/07/19
- Re: [Quilt-dev] Call for 0.42, Jean Delvare, 2005/07/20
- Re: [Quilt-dev] Call for 0.42, Jean Delvare, 2005/07/21
- Re: [Quilt-dev] Call for 0.42,
Andreas Gruenbacher <=
- Re: [Quilt-dev] Call for 0.42, Jean Delvare, 2005/07/22
- Re: [Quilt-dev] Call for 0.42, Andreas Gruenbacher, 2005/07/22
- Re: [Quilt-dev] Call for 0.42, Jean Delvare, 2005/07/22
- Re: [Quilt-dev] Call for 0.42, Andreas Gruenbacher, 2005/07/22
- Re: [Quilt-dev] Call for 0.42, Andreas Gruenbacher, 2005/07/22
- Re: [Quilt-dev] Call for 0.42, Jean Delvare, 2005/07/23
- Re: [Quilt-dev] Call for 0.42, Andreas Gruenbacher, 2005/07/23
- Re: [Quilt-dev] Call for 0.42, Jean Delvare, 2005/07/24
- Re: [Quilt-dev] Call for 0.42, Martin Quinson, 2005/07/24
- Re: [Quilt-dev] Call for 0.42, Jean Delvare, 2005/07/25