Bug 682121
| Summary: | virsh help iface-name bug on Japanese Environment | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Tatsuo Kawasaki <kawasaki> |
| Component: | libvirt | Assignee: | Eric Blake <eblake> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 6.0 | CC: | aalam, dallan, dyuan, eblake, eng-i18n-bugs, gren, mzhan, qe-i18n-bugs, xen-maint, yupzhang |
| Target Milestone: | rc | Keywords: | i18n |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-0.9.3-1.el6 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-12-06 10:55:09 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Since RHEL 6.1 External Beta has begun, and this bug remains unresolved, it has been rejected as it is not proposed as exception or blocker. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux. Hi,
I have noticed that reported problem occurs for any non-English language. Also verified translation files (Po files), they all look clean.
Digging through the problem, I have tried to compare results between English(US) and Other languages like Japanese(ja_JP), found that there's issue with following lines of code in libvirt/tools/virsh.c file
11393 if (desc[0]) {
11394 /* Print the description only if it's not empty. */
11395 fputs(_("\n DESCRIPTION\n"), stdout);
11396 fprintf(stdout, " %s\n", desc);
11397 }
Please check these lines.
Thanks!
Ankit
(In reply to comment #3) > Digging through the problem, I have tried to compare results between > English(US) and Other languages like Japanese(ja_JP), found that there's issue > with following lines of code in libvirt/tools/virsh.c file > > 11393 if (desc[0]) { > 11394 /* Print the description only if it's not empty. */ > 11395 fputs(_("\n DESCRIPTION\n"), stdout); > 11396 fprintf(stdout, " %s\n", desc); No direct problem in those lines. The first line should be translated in-place; the second (the fprintf of desc) should have been translated back where desc is declared several lines earlier: const char *desc = _(vshCmddefGetInfo(def, "desc")); and that should happen correctly in the po file if all of the description strings are marked with N_() (I didn't spot any that were missing). However, it DOES point out a flaw - the use of N_("") is a bug. Gettext reserves the translation of the empty string for its own use, and therefore, it is a bug if we ever mark or translate an empty string. And since we do have several instances of code such as: static const vshCmdInfo info_pool_name[] = { {"help", N_("convert a pool UUID to pool name")}, {"desc", ""}, that means that our initialization of desc must account for an unmarked empty string rather than blindly using _() on the description text. I'll propose a patch upstream. Will be picked up by the next rebase.
commit 491858bf3cd7b91029744287f6173f795b3108f9
Author: Eric Blake <eblake>
Date: Mon Jun 20 14:25:08 2011 -0600
virsh: avoid bogus description
https://bugzilla.redhat.com/show_bug.cgi?id=682121
Gettext reserves the empty string for internal use, and it must
not be passed through _(). We were violating this for commands
that (for whatever reason) used "" for their description.
* tools/virsh.c (vshCmddefHelp): Don't translate empty string.
Reported by Tatsuo Kawasaki.
Reproduced this issue on libvirt-0.9.2-1.el6.x86_64
#LANG=ja_JP virsh help iface-name
名前
iface-name - convert an interface MAC address to interface name
形式
iface-name <interface>
詳細
Project-Id-Version: ja
Report-Msgid-Bugs-To: libvir-list
POT-Creation-Date: 2010-04-30 18:31+0200
PO-Revision-Date: 2009-09-24 10:12+0900
Last-Translator: Kiyoto Hashida <khashida>
Language-Team: Japanese <jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Generator: KBabel 1.11.4
Plural-Forms: Plural-Forms: nplurals=1; plural=0;
オプション
[--interface] <string> interface mac
Tested this issue with:
libvirt-0.9.3-1.el6
qemu-kvm-0.12.1.2-2.167.el6
kernel-2.6.32-164.el6
名前
iface-name - convert an interface MAC address to interface name
形式
iface-name <interface>
オプション
[--interface] <string> interface mac
So change the status to VERIFIED.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1513.html |
Description of problem: Translation Bug (Typo) Steps to Reproduce: 1.LANG=ja_JP virsh help iface-name or 1.virsh 2.virsh # help iface-name 3. Actual results: 名前 iface-name - convert an interface MAC address to interface name 形式 iface-name <interface> 詳細 Project-Id-Version: ja Report-Msgid-Bugs-To: libvir-list POT-Creation-Date: 2010-04-30 18:31+0200 PO-Revision-Date: 2009-09-24 10:12+0900 Last-Translator: Kiyoto Hashida <khashida> Language-Team: Japanese <jp> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Generator: KBabel 1.11.4 Plural-Forms: Plural-Forms: nplurals=1; plural=0; オプション [--interface] <string> interface mac Expected results: 名前 iface-name - convert an interface MAC address to interface name 形式 iface-name <interface> オプション [--interface] <string> interface mac Additional info: