[PATCH 0/2] Actually translate our Perl programs (RHBZ#559963).
We observed a while back that the Perl-based libguestfs tools were not being localized. In fact I've tracked this problem down to a regression some time ago and some subsequent changes we made. These two patches fix everything. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
On 12/05/10 14:31, Richard W.M. Jones wrote:
From 9ef11c337d88a698b2730706982f301f93b32fba Mon Sep 17 00:00:00 2001 From: Richard Jones <rjones@redhat.com> Date: Wed, 12 May 2010 14:24:23 +0100 Subject: [PATCH 2/2] po: Include strings from Perl programs in the PO files (RHBZ#559963).
xgettext will only recognize '*.pl' as being a Perl file (otherwise it treats it as a C file and does not correctly find any strings in it).
This commit also fixes two actual bugs that xgettext found in the strings in our Perl programs. --- .gitignore | 2 ++ Makefile.am | 14 +------------- inspector/Makefile.am | 9 +++++++++ po/POTFILES.in | 24 ++++++++++++------------ tools/Makefile.am | 11 ++++++++++- tools/virt-tar | 6 ++++-- tools/virt-win-reg | 2 +- 7 files changed, 39 insertions(+), 29 deletions(-)
diff --git a/inspector/Makefile.am b/inspector/Makefile.am index fc2bee3..e1fe44a 100644 --- a/inspector/Makefile.am +++ b/inspector/Makefile.am @@ -58,3 +58,12 @@ TESTS_ENVIRONMENT = $(XMLLINT) --noout --relaxng virt-inspector.rng endif
endif + +# Make symlink from virt-inspector.pl to virt-inspector. This is just +# to keep xgettext happy since it uses the file extension to determine +# the implementation language of a file. + +all-local: virt-inspector.pl + +virt-inspector.pl: virt-inspector + ln -sf $< $@
In virt-v2v I rename these in an install hook. I don't think we need symlinks lying around.
diff --git a/tools/Makefile.am b/tools/Makefile.am index 9cc6139..ab14fe0 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,5 +1,5 @@ # libguestfs virt-* tools -# Copyright (C) 2009 Red Hat Inc. +# Copyright (C) 2009-2010 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -89,3 +89,12 @@ TESTS = test-virt-cat.sh \ test-virt-tar.sh
endif + +# Make symlinks from virt-foo.pl to virt-foo. This is just to keep +# xgettext happy since it uses the file extension to determine the +# implementation language of a file. + +all-local: $(tools:%=virt-%.pl) + +virt-%.pl: virt-% + ln -sf $< $@
See above.
diff --git a/tools/virt-tar b/tools/virt-tar index 612b500..839ff8e 100755 --- a/tools/virt-tar +++ b/tools/virt-tar @@ -202,9 +202,11 @@ if ($mode eq "x") { } else { # $mode eq "u" $directory = pop @ARGV; $tarball = pop @ARGV; - die __"virt-tar: $tarball: file not found\n" unless -f $tarball; + die __x("virt-tar: {tarball}: file not found\n", + tarball => $tarball) unless -f $tarball; } -die __"virt-tar: $directory: directory name must start with '/' character\n" +die __x("virt-tar: {dir}: directory name must start with '/' character\n", + dir => $directory) unless substr ($directory, 0, 1) eq "/";
my @args = (\@ARGV); diff --git a/tools/virt-win-reg b/tools/virt-win-reg index 91a1673..74881b6 100755 --- a/tools/virt-win-reg +++ b/tools/virt-win-reg @@ -338,7 +338,7 @@ else { # Import mode. %hives = ();
# Look in the tmpdir for all the hive files which have been - # downloaded / modified by the import mapper, and upload + # downloaded / modified by the import mapper, and upload # each one. opendir my $dh, $tmpdir or die "$tmpdir: $!"; foreach (readdir $dh) {
Not strictly related to this change, but ok. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
On Thu, May 13, 2010 at 02:33:26PM +0100, Matthew Booth wrote:
+# Make symlink from virt-inspector.pl to virt-inspector. This is just +# to keep xgettext happy since it uses the file extension to determine +# the implementation language of a file. + +all-local: virt-inspector.pl + +virt-inspector.pl: virt-inspector + ln -sf $< $@
In virt-v2v I rename these in an install hook. I don't think we need symlinks lying around.
No you miss the point. I don't want to install these, I need these in the build directory so xgettext will know that these are Perl files. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
On 13/05/10 14:44, Richard W.M. Jones wrote:
On Thu, May 13, 2010 at 02:33:26PM +0100, Matthew Booth wrote:
+# Make symlink from virt-inspector.pl to virt-inspector. This is just +# to keep xgettext happy since it uses the file extension to determine +# the implementation language of a file. + +all-local: virt-inspector.pl + +virt-inspector.pl: virt-inspector + ln -sf $< $@
In virt-v2v I rename these in an install hook. I don't think we need symlinks lying around.
No you miss the point. I don't want to install these, I need these in the build directory so xgettext will know that these are Perl files.
Ah, got it. I was reading it backwards (.pl files are originals). ACK. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
participants (2)
-
Matthew Booth -
Richard W.M. Jones