[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#456281: gimp-print: CUPS printer queues are not listet in GUI when $LANG is set to "de_DE"



tags 456281 + confirmed patch
severity 456281 important
thanks

Martin Grandrath <debian-reportbug@grandrath-net.de> writes:

> Package: gimp-print
> Version: 5.0.0-3
> Severity: normal
>
> After selecting "Setup Printer" in the GUI a dialog shows up which
> should list the available "Printer Queue"s that are available in CUPS.
> When $LANG is set to "en" this works fine, but when $LANG is set to
> "de_DE" or "de_DE.UTF-8" only the entry "(Default Printer)" is listed.

I've tried with both en_GB.UTF-8 and de_DE.UTF-8, and both work
correctly for me.  What is the output of "lpstat -a"? and "lpr -a"?

This appears to be breaking due to the way lpr is localised:

% LANG=de_DE.UTF-8 LANGUAGE=de /usr/bin/lpstat -v
Gerät für claser: usb://Kyocera/FS-C5025N
Gerät für ctest: usb://EPSON/Stylus%20C60
Gerät für epl-6200: usb://EPSON/EPL-6200
Gerät für kclaser: ipp://192.168.156.20:631/ipp/lp1
Gerät für testepson: http://192.168.1.153:631/EPSON1520

% LANG=C LANGUAGE=C /usr/bin/lpstat -v
device for claser: usb://Kyocera/FS-C5025N
device for ctest: usb://EPSON/Stylus%20C60
device for epl-6200: usb://EPSON/EPL-6200
device for kclaser: ipp://192.168.156.20:631/ipp/lp1
device for testepson: http://192.168.1.153:631/EPSON1520

Gimp-Print is running:

% /usr/bin/lpstat -v | grep -i '^device for ' | awk '{print $3}' | sed 's/://'
claser
ctest
epl-6200
kclaser
testepson

So in a de_DE.UTF-8 locale:

% LANG=de_DE LANGUAGE=de /usr/bin/lpstat -v | grep -i '^device for ' | awk '{print $3}' | sed 's/://'

Zilch.  When plist.c runs a command in stpui_print, we need to make
sure it runs in a C locale.  I've attached a patch to do this--please
could you test it to see if it works.  You just need to "apt-get
source gutenprint", "patch -p1 < patch" and "dpkg-buildpackage
-rfakeroot -us -uc" to build, then "dpkg -i" to install the packages.

Because it (for some odd reason) works for me, I can't confirm this
works myself.

> I would like to provide a screenshot, but I don't know how I can
> create one while the dropdown field is open.

Go to the main menu and do File->Acquire->Screen shot.  Choose to grab
the whole screen with a 10 second delay and start the grab.  Next, go
back to the window and click on the drop down box.  Then, wait until
the 10 seconds are up, and it will take an image of everything for
you.

I've attached an example.

It also looks like some of the de_DE localisation isn't complete
here--there are English words in the interface.



Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.

Attachment: gp-de-setup.png
Description: de_DE.UTF-8 screenshot

diff -urN gutenprint-5.0.1.original/src/gutenprintui2/plist.c gutenprint-5.0.1/src/gutenprintui2/plist.c
--- gutenprint-5.0.1.original/src/gutenprintui2/plist.c	2007-06-04 01:20:09.000000000 +0100
+++ gutenprint-5.0.1/src/gutenprintui2/plist.c	2007-12-22 18:39:16.216854645 +0000
@@ -1598,6 +1598,7 @@
 		      else	/* Child 2 (printer command) */
 			{
 			  const char *command;
+			  char *locale;
 			  if (stpui_plist_get_command_type(printer) ==
 			      COMMAND_TYPE_DEFAULT)
 			    command =
@@ -1613,8 +1614,16 @@
 			  close (pipefd[0]);
 			  close (pipefd[1]);
 			  close(syncfd[1]);
+#ifdef HAVE_LOCALE_H
+			  locale = g_strdup(setlocale(LC_NUMERIC, NULL));
+			  setlocale(LC_NUMERIC, "C");
+#endif
 			  execl("/bin/sh", "/bin/sh", "-c", command, NULL);
 			  /* NOTREACHED */
+#ifdef HAVE_LOCALE_H
+			  setlocale(LC_NUMERIC, locale);
+			  SAFE_FREE(locale);
+#endif
 			  _exit (1);
 			}
 		      /* NOTREACHED */

Attachment: pgpq9dtxu19n1.pgp
Description: PGP signature


Reply to: