Page size (was Re: New printer administration tool design for comments)
Tim Waugh
twaugh at redhat.com
Fri Feb 10 12:46:08 UTC 2006
On Fri, Feb 10, 2006 at 01:14:48PM +0100, Nicolas Mailhot wrote:
> Ok, but here you are triggering queue creation manually from the shell
> with (I suppose) every locale-related environment variables set correctly.
> Will it be the case for hotplug-triggered creations ? (it seems not to be
> the case today)
Today we are using system-config-printer to do this stuff, and while
it ought to get it right, in some cases apparently it doesn't.
Just using CUPS on its own:
[root at gene ~]# export LC_ALL=en_US.UTF-8
[root at gene ~]# unset LANG
[root at gene ~]# grep LANG /etc/sysconfig/i18n
LANG="en_GB.UTF-8"
[root at gene ~]# locale LC_PAPER
279
216
UTF-8
(i.e. Letter)
[root at gene ~]# lpadmin -x test
lpadmin: delete-printer failed: client-error-not-found
[root at gene ~]# zgrep DefaultPageSize
/usr/share/cups/model/deskjet.ppd.gz
*DefaultPageSize: Letter
[root at gene ~]# lpadmin -p test -m deskjet.ppd.gz
[root at gene ~]# grep DefaultPageSize /etc/cups/ppd/test.ppd
*DefaultPageSize: A4
The CUPS daemon uses the system locale (i.e. the locale it was started
in).
FWIW, CUPS uses some fairly simplistic rules:
if (!DefaultLanguage ||
!strcasecmp(DefaultLanguage, "C") ||
!strcasecmp(DefaultLanguage, "POSIX") ||
!strcasecmp(DefaultLanguage, "en") ||
!strncasecmp(DefaultLanguage, "en_US", 5) ||
!strncasecmp(DefaultLanguage, "en_CA", 5) ||
!strncasecmp(DefaultLanguage, "fr_CA", 5))
I'm sure it could be persuaded to use the equivalent of 'locale
LC_PAPER' first, and if that doesn't work fall back to the above
method.
Tim.
*/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-maintainers/attachments/20060210/b0ce067b/attachment.sig>
More information about the Fedora-maintainers
mailing list