Pino Toscano
2013-Dec-04 14:34 UTC
[Libguestfs] [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
Richard W.M. Jones
2013-Dec-04 16:43 UTC
Re: [Libguestfs] [PATCH] builder: translate more user-visible strings
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.1ACK. 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
Pino Toscano
2013-Dec-06 13:58 UTC
Re: [Libguestfs] [PATCH] builder: translate more user-visible strings
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
Pino Toscano
2013-Dec-06 14:00 UTC
[Libguestfs] [PATCH] builder: adapt test-virt-builder-list.sh output expectation
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
Richard W.M. Jones
2013-Dec-06 14:50 UTC
Re: [Libguestfs] [PATCH] builder: translate more user-visible strings
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
Apparently Analagous Threads
- Re: [PATCH] builder: translate more user-visible strings
- [PATCH 0/3] Add JSON output for virt-builder
- Re: [PATCH] builder: translate more user-visible strings
- [PATCH] builder: add a mandatory 'arch' key in index files
- Re: [PATCH] builder: complete architecture handling