X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BE27232B3FF for ; Mon, 11 Oct 2004 11:31:39 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 56345-07 for ; Mon, 11 Oct 2004 10:31:30 +0000 (GMT) Received: from mail.gmx.net (mail.gmx.de [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id 39EBE32B3F7 for ; Mon, 11 Oct 2004 11:31:31 +0100 (BST) Received: (qmail 20518 invoked by uid 65534); 11 Oct 2004 10:31:31 -0000 Received: from dsl-082-082-234-194.arcor-ip.net (EHLO colt.pezone.net) (82.82.234.194) by mail.gmx.net (mp024) with SMTP; 11 Oct 2004 12:31:31 +0200 X-Authenticated: #495269 From: Peter Eisentraut To: Kris Jurka , "Serguei A. Mokhov" Subject: Re: Using gettext Date: Mon, 11 Oct 2004 12:31:27 +0200 User-Agent: KMail/1.5.1 Cc: PostgreSQL JDBC Folks , Euler Taveira de Oliveira , Dennis Bjorklund References: In-Reply-To: MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_/DmaBa+jtq2q7Zs" Message-Id: <200410111231.27881.peter_e@gmx.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/85 X-Sequence-Number: 11190 --Boundary-00=_/DmaBa+jtq2q7Zs Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Kris Jurka wrote: > It's possible to copy the messags from the old .properties files over > to ..po format, but I have not done so. Primarily because it's a lot > of work and secondarily because some of the translations didn't look > like they were in great shape to begin with. The old versions would > be valuable to any potential translators, so I've put them up here: > > http://www.ejurka.com/pgsql/olderrors/ Attached is a script I once used to convert property files to PO files. Call it with the English properties as first argument and the translated properties as second argument. I would then try to merge (msgmerge) the POT file created from the new Java sources (xgettext) with the output from the script. This process is untested, but I thought I'd send the script before someone else tries to write one. -- Peter Eisentraut http://developer.postgresql.org/~petere/ --Boundary-00=_/DmaBa+jtq2q7Zs Content-Type: application/x-perl; name="properties2po" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="properties2po" #! /usr/bin/perl my ($properties_orig, $properties_trans) = @ARGV; sub read_file($) { my ($filename) = @_; my %result; open FILE, "$filename" or die; while (defined($_ = )) { /^\s*$/ and next; /^[#!]/ and next; my ($key, $value) = split(/[=: ]/, $_, 2); $result{$key} = $value; } close FILE; return %result; } sub escape_value($) { my ($value) = @_; $value =~ s/\n/\\n/g; $value =~ s/"/\\"/g; return $value; } my %pot; my %po; %pot = read_file($properties_orig); %po = read_file($properties_trans) if $properties_trans; print "# Do not use this file for translation work.\n"; print "# If you want to translate the JDBC driver messages, look at\n"; print "# src/interfaces/jdbc/org/postgresql/errors_*.properties\n"; print "\n"; foreach my $key (keys %pot) { print "# key: $key\n"; my $value = $pot{$key}; my $trans = $po{$key} || ""; print "msgid \"".escape_value($value)."\"\n"; print "msgstr \"".escape_value($trans)."\"\n"; print "\n"; } --Boundary-00=_/DmaBa+jtq2q7Zs--