Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 22 Dec 2014, 23:51
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
use UTF-8 in Barrys Scripts (for XDialog AND xmessage)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [4 Posts]  
Author Message
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Thu 10 Jan 2008, 23:55    Post subject:  use UTF-8 in Barrys Scripts (for XDialog AND xmessage)  

Look at /usr/sbin/cups_shell

This a a very short script showing the problem.

I have replaced the english strings with variables, that are filled with text in an external .mo file.
This file is saved in leafpad as UTF-8.

The script uses Xdialog and xmessage to display information.
Xdialog displays äöü correct, xmessage does not.
If you save the .mo in Iso format, it is vice versa.

The solution is to install gxmessage, e.g. from
http://dotpups.de/dotpups/System_Utilities/gxmessage.pup

In Muppy008 it is already included, and "xmessage" was deleted and symlinked to gxmessage.

This is not sufficient though, because gxmessage runs in compatibility-mode with xmessage.

In cups_shell I now added this code in the beginning:
Code:
#--patch for gxmessage with UTF-8 by Mark Ulrich
gx=`which gxmessage`

XMESSAGE="xmessage"
if [ "$gx" != "" ];then
   XMESSAGE="gxmessage -encoding UTF-8"
fi
#-- // end of patch


And you must replace the line that starts with:
Code:
xmessage -bg "medium purple" -title

with:
Code:
$XMESSAGE -bg "medium purple" -title


The result:
On a system with gxmessage, now all text is shown correctly.
On a system without gxmessage, the text is shown with wrong UTF-characters in xmessage, but at least it is shown.

Mark
Back to top
View user's profile Send private message Visit poster's website 
magerlab

Joined: 08 Jul 2007
Posts: 731

PostPosted: Fri 11 Jan 2008, 08:25    Post subject:  

is it possible to use such a system to translate other scripts in puppy?
i mean to write strings instead of rewriting the scripts themselves( wich of course, can cause many mistakes)

_________________
skype: desafimager
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Fri 11 Jan 2008, 08:35    Post subject:  

Shure, we just did that with the network-wizard:
http://www.murga-linux.com/puppy/viewtopic.php?t=25098

I have explained the basic concept more detailed here:
http://murga-linux.com/puppy/viewtopic.php?t=23345


But both examples are complex.

The Cups-wizard is much simpler, and so easier to understand.
I attach it.
Extract it to a temporary folder.
Then compare it with the original /usr/sbin/cups_shell

Mark
Cups-wizard-localized-Puppy301.tar.gz
Description 
gz

 Download 
Filename  Cups-wizard-localized-Puppy301.tar.gz 
Filesize  2.58 KB 
Downloaded  764 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
Kazm

Joined: 14 Jan 2008
Posts: 29
Location: Russia, Ufa

PostPosted: Sun 02 Mar 2008, 16:37    Post subject:  

Russian cups-shell.mo file...
cups-shell-ru-mo.tar.gz
Description 
gz

 Download 
Filename  cups-shell-ru-mo.tar.gz 
Filesize  1.31 KB 
Downloaded  717 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0512s ][ Queries: 12 (0.0049s) ][ GZIP on ]