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 Fri 25 Jul 2014, 02:43
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 Posts_count  
Author Message
MU


Joined: 24 Aug 2005
Posts: 13642
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_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: 13642
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  748 Time(s) 
Back to top
View user's profile Send_private_message Visit_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  695 Time(s) 
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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