The time now is Tue 21 May 2013, 10:12
All times are UTC - 4 |
| Author |
Message |
MU

Joined: 24 Aug 2005 Posts: 13642 Location: Karlsruhe, Germany
|
Posted: 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
|
|
 |
magerlab
Joined: 08 Jul 2007 Posts: 730
|
Posted: 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
www.youtube.com/sagartem -videos of my band
|
|
Back to top
|
|
 |
MU

Joined: 24 Aug 2005 Posts: 13642 Location: Karlsruhe, Germany
|
Posted: 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
| Description |
|

Download |
| Filename |
Cups-wizard-localized-Puppy301.tar.gz |
| Filesize |
2.58 KB |
| Downloaded |
679 Time(s) |
|
|
Back to top
|
|
 |
Kazm
Joined: 14 Jan 2008 Posts: 29 Location: Russia, Ufa
|
Posted: Sun 02 Mar 2008, 16:37 Post subject:
|
|
Russian cups-shell.mo file...
| Description |
|

Download |
| Filename |
cups-shell-ru-mo.tar.gz |
| Filesize |
1.31 KB |
| Downloaded |
628 Time(s) |
|
|
Back to top
|
|
 |
|
|
|
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
|