Bug 559962

Summary: libguestfs C programs don't set locale, therefore localization doesn't work
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: mbooth, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-01-29 17:15:53 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:

Description Richard W.M. Jones 2010-01-29 13:43:21 UTC
Steps to Reproduce:
1. Install libguestfs 1.0.82 from Fedora.
2. LANG=pa strace -o /tmp/log -s 1500 guestfish --cmd-help
  
Actual results:

Output of guestfish is not localized.
strace log file /tmp/log contains no references to 'locale',
'/usr/share/locale', 'pa.mo' etc.

Expected results:

Output of guestfish should be localized.

Additional info:

We need to modify all C libguestfs programs to call
something like this:

setlocale(LC_ALL, "");
bindtextdomain(GETTEXT_PACKAGE, LOCALEBASEDIR);
textdomain(GETTEXT_PACKAGE);

(virsh q.v.:
http://libvirt.org/git/?p=libvirt.git;a=blob;f=tools/virsh.c;h=1fae5e6169f20480b0ccc9e22b0a33a7eeb67e0a;hb=HEAD#l8976 )

Comment 1 Richard W.M. Jones 2010-01-29 14:54:59 UTC
(In reply to comment #0)
> 2. LANG=pa strace -o /tmp/log -s 1500 guestfish --cmd-help

This isn't quite accurate.  The actual test command is:

LANG=pa_IN.UTF-8 strace -o /tmp/log -s 1500 guestfish --cmd-help

However this still doesn't work.