cups pdf-writer use other locale ??

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
HoerMirAuf
Posts: 255
Joined: Tue 22 Jan 2008, 12:11
Location: Würzburg

cups pdf-writer use other locale ??

#1 Post by HoerMirAuf »

Hi Volks,

i am using slacko 5.7

My locale is "de_DE.UTF-8"

but cups pdf-writer using "de.UTF-8" ??

How can this be?

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

cups pdf-writer use other locale ??

#2 Post by L18L »

Hi neighbour,

CUPS uses the language of the browser, see image.

Chrome does automatically use user's LANG

For seamonkey and firefox there is a HOWTO-localize-mozilla.html somewhere....

Hope that help
You might also visit me in Eußenheim
Attachments
Fellschreiben_2015-04-08_201539.png
(24.31 KiB) Downloaded 357 times

User avatar
HoerMirAuf
Posts: 255
Joined: Tue 22 Jan 2008, 12:11
Location: Würzburg

#3 Post by HoerMirAuf »

:D
hey neighbour ;)

Thank you very much. Ahhh the locale of the Browser.

Ok, thanks. Found a solution independently from the Browser locale:

delete the example line from /etc/profile
#this line gets edited by chooselocale script...
# w004 going back to non-utf8... 101120 back to utf8... 101121 off again...
#110409 change .utf8 to .UTF-8 ...
#LANG=en_US.UTF-8
LANG=de_DE.UTF-8
export LANG
and edit the /usr/lib/cups/backend/pdf-writer
USERHOME=$(grep "^$2" /etc/passwd | cut -d: -f6)
LANGUAGE=$(cat /etc/profile | grep LANG= | cut -c 6-)

# Preselect save folder
PRESELECT="/root/my-documents"

# maybe needed by Xdialog
export PATH=$PATH:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R7/bin
export DISPLAY=":0.0"
export LANG="$LANGUAGE"
export LC_ALL="$LANGUAGE"
export XAUTHORITY=$USERHOME/.Xauthority

PDFNAME=$3".pdf"
[ ${PDFNAME:0:1} != "/" ] && PDFNAME=$PRESELECT/$PDFNAME
and all went well :D
(the blue signs is to set a save folder preselection)

Jepp, wenn ich demnächst man in die Richtung komme, sag ich Dir bescheid ;)

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

pdf-writer

#4 Post by L18L »

found total different pdf-writer

in Quirky7.0.2:

Code: Select all

#./pdf-writer "hello world"
Usage: ./pdf-writer job-id user title copies options [file]
#
in slacko5.7:#./pdf-writer "hello world"
^C
#

I am confused.
Attachments
Fellschreiben_2015-04-09_110842.png
(22.52 KiB) Downloaded 524 times

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

Re: pdf-writer

#5 Post by rcrsn51 »

L18L wrote:I am confused.
First of all, pdf-writer is a CUPS backend. It is not designed to work as a command-line program. It is used in the Print dialog of an application program like your word processor where it is identified as CUPS-PDF.

There are two versions of pdf-writer. The original version (which is probably in Quirky) had some bugs involving the hostname. So I wrote a much simpler Puppy-specific version. That one is now included in recent Puppies. It also works with non-root users like spot, which IIRC the old one would not.

Unfortunately, I removed the code that handles language because I wasn't sure how it worked. HoerMirAuf has now shown how to fix this.

In any case, pdf-writer is a legacy program. In modern Puppies, your better choice to make a PDF is by using Print > Print to File.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: pdf-writer

#6 Post by L18L »

rcrsn51,
many thanks, you have made it very clear now.
I had missed pdf-writer before in Fatdog (a modern distro), see also http://murga-linux.com/puppy/viewtopic.php?t=97840.

HoerMirAuf,
if you change
LANGUAGE=$(cat /etc/profile | grep LANG= | cut -c 6-)
to
LANGUAGE=$(cat /etc/profile | grep ^LANG= | cut -c 6-)
then there is no need to delete that line in /etc/profile.

--
edit
or
LANGUAGE=$(grep ^LANG= /etc/profile | cut -c 6-)

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#7 Post by rcrsn51 »

Or

Code: Select all

LANGUAGE=$(grep ^LANG= /etc/profile | cut -c 6-)
[ -z "$LANGUAGE" ] && LANGUAGE="C"

User avatar
HoerMirAuf
Posts: 255
Joined: Tue 22 Jan 2008, 12:11
Location: Würzburg

#8 Post by HoerMirAuf »

Hey guys,

thanks for this little bash/grep lession :)
My bash knowledge is quite small...

but the locale-hack is a improvement for newer pdf-writer ;)

Post Reply