[PATCH] builder: translate more user-visible strings
Translate also the "OS version" and "Notes" strings that appear in the --long output. --- builder/list_entries.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/list_entries.ml b/builder/list_entries.ml index 8c24fe2..a1d0696 100644 --- a/builder/list_entries.ml +++ b/builder/list_entries.ml @@ -47,7 +47,7 @@ let list_entries ?(list_long = false) ~sources index = printf "\n" ) else ( (* Long *) - printf "%-24s %s\n" "os-version:" name; + printf "%-24s %s\n" (s_"OS version:") name; (match printable_name with | None -> () | Some name -> printf "%-24s %s\n" (s_"Full name:") name; @@ -62,7 +62,7 @@ let list_entries ?(list_long = false) ~sources index = | None -> () | Some notes -> printf "\n"; - printf "Notes:\n\n%s\n" notes + printf (f_"Notes:\n\n%s\n") notes ); printf "\n" ) -- 1.8.3.1
On Wed, Dec 04, 2013 at 03:34:46PM +0100, Pino Toscano wrote:
Translate also the "OS version" and "Notes" strings that appear in the --long output. --- builder/list_entries.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builder/list_entries.ml b/builder/list_entries.ml index 8c24fe2..a1d0696 100644 --- a/builder/list_entries.ml +++ b/builder/list_entries.ml @@ -47,7 +47,7 @@ let list_entries ?(list_long = false) ~sources index = printf "\n" ) else ( (* Long *) - printf "%-24s %s\n" "os-version:" name; + printf "%-24s %s\n" (s_"OS version:") name; (match printable_name with | None -> () | Some name -> printf "%-24s %s\n" (s_"Full name:") name; @@ -62,7 +62,7 @@ let list_entries ?(list_long = false) ~sources index = | None -> () | Some notes -> printf "\n"; - printf "Notes:\n\n%s\n" notes + printf (f_"Notes:\n\n%s\n") notes ); printf "\n" ) -- 1.8.3.1
ACK. 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://people.redhat.com/~rjones/virt-top
On Wednesday 04 December 2013 15:34:46 Pino Toscano wrote:
Translate also the "OS version" and "Notes" strings that appear in the --long output. --- builder/list_entries.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builder/list_entries.ml b/builder/list_entries.ml index 8c24fe2..a1d0696 100644 --- a/builder/list_entries.ml +++ b/builder/list_entries.ml @@ -47,7 +47,7 @@ let list_entries ?(list_long = false) ~sources index = printf "\n" ) else ( (* Long *) - printf "%-24s %s\n" "os-version:" name; + printf "%-24s %s\n" (s_"OS version:") name;
Oops, I suck, I just realized now that this string change broke test-virt-builder-list.sh, patch fixing it coming in a moment. Sorry for this. OTOH, that makes me think whether virt-builder shouldn't have some kind of porcelain/XML/JSON/CSV/etc output for --list to ease its parsing, as it could be translated and changed anytime (like done above). Good idea? If so, which format? -- Pino Toscano
ee0e56f43e55307fefa1d04505ed6477d604d220 slightly changes the output of --list but test-virt-builder-list.sh has not been updated accordingly. Adapting the expected output makes test-virt-builder-list.sh pass again. --- builder/test-virt-builder-list.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builder/test-virt-builder-list.sh b/builder/test-virt-builder-list.sh index 11305a9..ea4f561 100755 --- a/builder/test-virt-builder-list.sh +++ b/builder/test-virt-builder-list.sh @@ -41,7 +41,7 @@ long_list=$(./virt-builder --no-check-signature --no-cache --list --long) if [ "$long_list" != "Source URI: $VIRT_BUILDER_SOURCE Fingerprint: F777 4FB1 AD07 4A7E 8C87 67EA 9173 8F73 E1B7 68A0 -os-version: phony-debian +OS version: phony-debian Full name: Phony Debian Minimum/default size: 512.0M @@ -49,7 +49,7 @@ Notes: Phony Debian look-alike used for testing. -os-version: phony-fedora +OS version: phony-fedora Full name: Phony Fedora Minimum/default size: 1.0G @@ -57,7 +57,7 @@ Notes: Phony Fedora look-alike used for testing. -os-version: phony-ubuntu +OS version: phony-ubuntu Full name: Phony Ubuntu Minimum/default size: 512.0M @@ -65,7 +65,7 @@ Notes: Phony Ubuntu look-alike used for testing. -os-version: phony-windows +OS version: phony-windows Full name: Phony Windows Minimum/default size: 512.0M -- 1.8.3.1
On Fri, Dec 06, 2013 at 03:00:41PM +0100, Pino Toscano wrote:
ee0e56f43e55307fefa1d04505ed6477d604d220 slightly changes the output of --list but test-virt-builder-list.sh has not been updated accordingly.
Adapting the expected output makes test-virt-builder-list.sh pass again.
-os-version: phony-debian +OS version: phony-debian
Now I look at this, it's not "OS version" (operating system version). It's literally the string "os-version". See the man page: http://libguestfs.org/virt-builder.1.html#synopsis So I think the original change is wrong :-( 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://people.redhat.com/~rjones/virt-top
On Friday 06 December 2013 14:51:41 Richard W.M. Jones wrote:
On Fri, Dec 06, 2013 at 03:00:41PM +0100, Pino Toscano wrote:
ee0e56f43e55307fefa1d04505ed6477d604d220 slightly changes the output of --list but test-virt-builder-list.sh has not been updated accordingly.
Adapting the expected output makes test-virt-builder-list.sh pass again.
-os-version: phony-debian +OS version: phony-debian
Now I look at this, it's not "OS version" (operating system version). It's literally the string "os-version". See the man page:
http://libguestfs.org/virt-builder.1.html#synopsis
So I think the original change is wrong :-(
Oops, sorry again for the small issue, and thanks for having reverted that string change. -- Pino Toscano
On Fri, Dec 06, 2013 at 02:58:27PM +0100, Pino Toscano wrote:
On Wednesday 04 December 2013 15:34:46 Pino Toscano wrote:
Translate also the "OS version" and "Notes" strings that appear in the --long output. --- builder/list_entries.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builder/list_entries.ml b/builder/list_entries.ml index 8c24fe2..a1d0696 100644 --- a/builder/list_entries.ml +++ b/builder/list_entries.ml @@ -47,7 +47,7 @@ let list_entries ?(list_long = false) ~sources index = printf "\n" ) else ( (* Long *) - printf "%-24s %s\n" "os-version:" name; + printf "%-24s %s\n" (s_"OS version:") name;
Oops, I suck, I just realized now that this string change broke test-virt-builder-list.sh, patch fixing it coming in a moment. Sorry for this.
OTOH, that makes me think whether virt-builder shouldn't have some kind of porcelain/XML/JSON/CSV/etc output for --list to ease its parsing, as it could be translated and changed anytime (like done above). Good idea? If so, which format?
First of all cannot change the existing format, but we can certainly add a flag to choose an alternate format. cf. 'qemu-img info' has a flag that lets you select between "human" and "json". I have no strong opinions about the format to use. One which doesn't require any external library, but since this is output rather than input we probably don't need an external library. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
On Friday 06 December 2013 14:50:08 Richard W.M. Jones wrote:
On Fri, Dec 06, 2013 at 02:58:27PM +0100, Pino Toscano wrote:
OTOH, that makes me think whether virt-builder shouldn't have some kind of porcelain/XML/JSON/CSV/etc output for --list to ease its parsing, as it could be translated and changed anytime (like done above). Good idea? If so, which format?
First of all cannot change the existing format, but we can certainly add a flag to choose an alternate format. cf. 'qemu-img info' has a flag that lets you select between "human" and "json".
Yes, that's one of the things I had in mind, adding a new output mode for --list aside the current one. We could just mimic qemu-img then, with --format=json|human (with human being the default one providing the current output).
I have no strong opinions about the format to use. One which doesn't require any external library, but since this is output rather than input we probably don't need an external library.
libguestfs has libyajl as JSON parsing library so theoretically it could be optionally used as well. But yeah, virt-builder could it do without. /me adds to low-priority TODO -- Pino Toscano
participants (2)
-
Pino Toscano -
Richard W.M. Jones