Programs and scripts that are not yet internationalized
Thank you for the verification. I add the sources of gpptp and ssh-gui. I made the internalization of c files for the first time. It seems to work (I connected to vpn with polish gpptp), but really I'm not sure if I made it correctly. To make the pot file I used: xgettext -d gpptp -s -o gpptp.pot --keyword=_ gpptp.c
- Attachments
-
- sources.tar.gz
- Sources of gpptp and ssh-gui with Makefile
- (8.59 KiB) Downloaded 635 times
Last edited by robwoj44 on Thu 16 May 2013, 19:07, edited 2 times in total.
Pdict internationalized
/usr/sbin/pdict
/usr/sbin/pdict
Code: Select all
#!/bin/sh
##! /usr/sbin/gtkdialog3 -e
#BK nov 2007 gui frontend for dict.
#110126 improvements.
#130516 robwoj44 internationalized
export TEXTDOMAIN=pdict
export TEXTDOMAINDIR=/usr/share/locale
export OUTPUT_CHARSET=UTF-8
. gettext.sh
echo -n "" > /tmp/pdict-results.txt
yaf-splash -placement center -bg orange -close never -timeout 60 -fontsize large -text "$(gettext 'Please wait, accessing online Dict server...')" &
DICTLIST="`dict --dbs`"
killall yaf-splash
COMBOCONTENT="`echo "$DICTLIST" | tr "'" "_" | grep '^ ' | grep -v '^ \-' | sed -e 's/^ //' | sed -e 's/^/<item>/' | sed -e 's/$/<\/item>/'`" #'geany
COMBOCONTENT="<item>all $(gettext 'Search all databases')</item>
${COMBOCONTENT}"
echo '#/bin/sh' > /tmp/pdict-func1
echo 'dict -d $2 $1 > /tmp/pdict-results.txt 2>&1' >> /tmp/pdict-func1 #110126
chmod 755 /tmp/pdict-func1
export MAIN_DIALOG="
<window title=\"$(gettext 'Pdict dictionary and thesaurus')\" icon-name=\"gtk-info\">
<vbox>
<hbox>
<text><label>$(gettext 'enter a word:')</label></text>
<entry activates-default=\"true\">
<variable>WORD</variable>
</entry>
<button has-default=\"true\">
<input file stock=\"gtk-find\"></input>
<label>$(gettext 'dict')</label>
<action>/tmp/pdict-func1 \$WORD \$MYCHOICE</action>
<action>refresh:INFO</action>
</button>
</hbox>
<text><label>$(gettext 'Choose which online database (default is all):')</label></text>
<combobox>
<variable>MYCHOICE</variable>
$COMBOCONTENT
</combobox>
<frame result:>
<edit>
<variable>INFO</variable>
<input file>/tmp/pdict-results.txt</input>
<width>450</width>
<height>300</height>
</edit>
</frame>
<hbox>
<button>
<label>$(gettext 'exit')</label>
<input file stock=\"gtk-quit\"></input>
<action type=\"exit\">EXIT</action>
</button>
</hbox>
</vbox>
</window>
"
##i don't know enough about themes to do this any better...
##note, normal gtkrc is now ~/.gtkrc
#cp -f /etc/gtk-2.0/gtkrcMONOSPACED /etc/gtk-2.0/gtkrc
#echo '#!/bin/sh
# sleep 2
# rm -f /etc/gtk-2.0/gtkrc
#' > /tmp/delaygtkrc.sh
#chmod 755 /tmp/delaygtkrc.sh
#/tmp/delaygtkrc.sh &
RETSTRING="`gtkdialog3 --program=MAIN_DIALOG`"
###END###
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Programs and scripts that are not yet internationalized
I am also no C guru, just tried to internationalize some progs.robwoj44 wrote:Thank you for the verification. I add the sources of gpptp and ssh-gui. I made the internalization of c files for the first time. It seems to work (I connected to vpn with polish gpptp), but really I'm not sure if I made it correctly. To make the pot file I used: xgettext -d gpptp -s -o gpptp.pot --keyword=_ gpptp.c
gpptp
can be edited now (don't know what was wrong )
ssh-gui
mo file can be created and used
but not edited (by momanager and me)
compiling:
file INSTALL said: make (that's all) but did not succed.
but in console this was working:
# gcc -o ssh-gui ssh-gui.c ssh_widget.c notebook.c `pkg-config --libs --cflags gtk+-2.0`
notebook.c: In function ‘destroy’:
notebook.c:12:2: warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]
# upx ssh-gui
Ultimate Packer for eXecutables
Copyright (C) 1996 - 2013
UPX 3.09 Markus Oberhumer, Laszlo Molnar & John Reiser Feb 18th 2013
File size Ratio Format Name
-------------------- ------ ----------- -----------
22510 -> 8832 39.24% linux/elf386 ssh-gui
Packed 1 file.
# xgettext -d ssh-gui -s -o ssh-gui.pot --keyword=_ ssh-gui.c ssh_widget.c notebook.c
#
Sorry I have no idea how to continue for now
[edit] I suspect it has something to do with different CHARSET
Last edited by L18L on Fri 17 May 2013, 18:23, edited 1 time in total.
alien2puppy
alien2puppy by 01micko should be gettexted.
The instructions are important and all in English.
It could be included in a langpack as well.
I'll look at it and post a gettext version on Saturday.
__________________________________________
The help system of 'strippkg' is in English but it's only a couple of words.
It's not worth translating.
___________________________________________
The instructions are important and all in English.
It could be included in a langpack as well.
I'll look at it and post a gettext version on Saturday.
__________________________________________
The help system of 'strippkg' is in English but it's only a couple of words.
It's not worth translating.
___________________________________________
alien2puppy - gettext
I was successful in making a gettext version of 'alien2puppy'
People can now put it in their langpacks if they wish.
Available HERE
____________________________________________________
I discovered that Momanager is useless if the script has expressions
that use UTF-8 characters. I had to use strictly ascii.
L18L explained how to get around this problem
with a terminal command but shouldn't Momanager be
able to handle UTF-8 characters.
People can now put it in their langpacks if they wish.
Available HERE
____________________________________________________
I discovered that Momanager is useless if the script has expressions
that use UTF-8 characters. I had to use strictly ascii.
L18L explained how to get around this problem
with a terminal command but shouldn't Momanager be
able to handle UTF-8 characters.
Code: Select all
xgettext --from-code=UTF-8 -L shell script.sh
Thanks for your work Don
Your gettexted version of alien2puppy is working fine. See attachment for a dutch alien2puppy
As a beginning momanager user I have noticed it is important to specify utf-8 in both Geany and Poedit, before saving the translation.
Geany: Document>Set encoding>Unicode>UTF-8
Geany will otherwise close without warning when saving and translation is lost
Poedit: Catalog>Setup>charset.
Poedit will give error to show utf-8 is needed
That way typical utf-8 characters are accepted and included like they should be in the translation (é, à, ç, ö, etc..)
Hope I understood what you are saying correctly.
Your gettexted version of alien2puppy is working fine. See attachment for a dutch alien2puppy
As a beginning momanager user I have noticed it is important to specify utf-8 in both Geany and Poedit, before saving the translation.
Geany: Document>Set encoding>Unicode>UTF-8
Geany will otherwise close without warning when saving and translation is lost
Poedit: Catalog>Setup>charset.
Poedit will give error to show utf-8 is needed
That way typical utf-8 characters are accepted and included like they should be in the translation (é, à, ç, ö, etc..)
Hope I understood what you are saying correctly.
- Attachments
-
- capture30560.png
- (46.2 KiB) Downloaded 691 times
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: alien2puppy - gettext
I would define it in a positive way:don570 wrote:...I discovered that Momanager is useless if the script has expressions
that use UTF-8 characters....
The script maker ensures that it can be translated using momanager
+1Bert wrote: it is important to specify utf-8 in both Geany and Poedit
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: Programs and scripts that are not yet internationalized
And there is a mismatch of ssh-gui and ssh_gui somewhereL18L wrote:...
Sorry I have no idea how to continue for now
[edit] I suspect it has something to do with different CHARSET
[edit] mystery solved
Last edited by L18L on Mon 20 May 2013, 17:17, edited 1 time in total.
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Programs and scripts that are not yet internationalized
... and that is goodrodin.s wrote:Script /usr/sbin/root2user is not gettexted. It's not very important though.
because the English text is ...misleading.
(was it for me, see also http://puppylinux.info/topic/fido-andor ... ser-system )
Anyhow I am glad to see that fido is going to be used.
This text made me (what about you?) think that this password is root's password.First shutdown: ask admin password
Please enter a password for the administrator (root), minimum six characters.
Login as fido does not require a password, so at bootup you will go directly to the desktop. This is also the case if you had chosen to run as administrator. However, having chosen the restricted fido user, you will be required to enter a password whenever you want to perform an operation that requires admin priviledges.
PLEASE REMEMBER THIS PASSWORD
Prove:
ALT-F2
login: fido
password: <your chosen password>
ALT-F3
login: root
password: <your chosen password>
change fido's passwd:
Code: Select all
passwd fido
ALT-F4
Code: Select all
pmount
running as fido in Puppy Precise 5.6
I tried to gettext it and run it to check. After this I permanently changed the user to fido user. It was not possible for me to change back to root user with login manager. As fido user I could not use for example puppy package manager. The password did not work.
So...I gettexted didiwiki-gui
/usr/sbin/didiwiki-gui
So...I gettexted didiwiki-gui
/usr/sbin/didiwiki-gui
Code: Select all
#! /bin/sh
# this starts/stops DidiWiki server
# ASSUMES A USER NAMED spot HAS BEEN SETUP
# GuestToo - Feb 7, 2005. Hacked a bit by BK -- 2005,2006.
# Designed for use with Puppy Linux, www.puppylinux.com
#v411 dunno why, but no longer creates new pages, needs /root/spot/.didiwiki world-writable.
#130522 robwoj44 internationalized
. gettext.sh
export TEXTDOMAIN=didiwiki-gui
export TEXTDOMAINDIR=/usr/share/locale
export OUTPUT_CHARSET=UTF-8
#v411 bug workaround, needs to be fixed properly sometime...
mkdir -p /root/spot/.didiwiki
chmod 777 /root/spot/.didiwiki
DIDI="/root/spot/didiwiki"
if ! MSG=`which gxmessage`
then
MSG='xmessage'
fi
if ! grep spot /etc/group
then
$MSG -center -bg "#ffc0c0" -title "DidiWiki" $(gettext 'No user "spot"')
exit 1
fi
if [ ! -r $DIDI ];then
DIDI=`which didiwiki`
fi
if [ ! -r $DIDI ];then
$MSG -center -bg "#ffc0c0" -title "DidiWiki" $(gettext 'DidiWiki program not found')
exit 1
fi
#BK
PSSTATUS="`ps`"
if [ "`echo -n "$PSSTATUS" | grep 'didiwiki' | grep -v 'didiwiki\-gui'`" = "" ];then
BUTTONS1="$(gettext 'Start:21,Cancel:10')"
MSG1="$(gettext 'Click Start button to start DidiWiki
server and launch browser.
Note that DidiWiki runs as user "spot"')"
DIDIGO="no"
else
BUTTONS1="$(gettext 'Start:21,Stop:22,Cancel:10')"
MSG1="$(gettext 'DidiWiki server is already running, as user "spot".
Click Start button to open web browser and use DidiWiki,
or Stop button if you want to kill the server')"
DIDIGO="yes"
fi
$MSG -center -buttons "$BUTTONS1" -title "DidiWiki" "$MSG1"
case $? in
21)
RETVAL1=0
if [ "$DIDIGO" = "no" ];then
su -c $DIDI - spot &
#note, .didiwiki folder is created in /root/spot/.
RETVAL1=$?
fi
if [ $RETVAL1 -eq 0 ];then
##hv3 seems to work fine...
#if [ "`which hv3`" = "" ];then
# defaultbrowser http://localhost:8000/
#else
# hv3 http://localhost:8000/
#fi
defaulthtmlviewer http://localhost:8000/
else
$MSG -center -bg "#ffc0c0" -title "DidiWiki" $(gettext 'ERROR: DidiWiki did NOT start')
fi
;;
22)
killall -3 didiwiki
sleep 1
killall -9 didiwiki
ps | grep didiwiki
if [ $? -eq 0 ];then
$MSG -center -bg "#d0ffd0" -title "DidiWiki" $(gettext 'DidiWiki is stopped')
else
$MSG -center -bg "#ffc0c0" -title "DidiWiki" $(gettext 'DidiWiki is still running')
fi
;;
*) exit ;;
esac
Last edited by robwoj44 on Thu 23 May 2013, 07:51, edited 1 time in total.
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
fido
The only way I know for running as fido is to use the 'fido' button at first shutdown.robwoj44 wrote:I tried to gettext it and run it to check. After this I permanently changed the user to fido user. It was not possible for me to change back to root user with login manager. As fido user I could not use for example puppy package manager. The password did not work.
How did you "permanently change the user to fido user" ?
Did you change root's password or fido's password or none or both?
What is the output of
Code: Select all
whoami
Code: Select all
cat /etc/inittab
By chance. I run root2user. I did not write the password and closed root2user by pprocess. After reboot I was still fido user. It was not possible to change to root by login manager.The only way I know for running as fido is to use the 'fido' button at first shutdown.
How did you "permanently change the user to fido user" ?
I tried to change the password (for fido user?) by root2user. This password did not work in login manager and when I started for example puppy package manager. In login manager only worked the password "woofwoof", but after the reboot I was still fido user.
It was not possible to run rxvt. I have no time to check on and finally I reinstalled racy:)
/usr/local/ppg/ppg-gui.sh
Code: Select all
#!/bin/sh
# Puppy Podcast Grabber v0.9.9
# Brad Coulthard <Coulthard@ieee.org>
#
# Feedback is great! email me.
#
# This script is my own work but I did use some commands and
# ideas from both PodGet and Bash Podder.
#
# http://sourceforge.net/projects/podget/
# http://linc.homeunix.org:8080/scripts/bashpodder/
#
# This program is for Puppy Linux www.puppylinux.com
# If you would like to use it for another disto go for it.
# Please give me credit for my work.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#130523 robwoj44 internationalized
. gettext.sh
export TEXTDOMAIN=ppg-gui.sh
export TEXTDOMAINDIR=/usr/share/locale
export OUTPUT_CHARSET=UTF-8
#-------------------------------------------------------------------
# This is just in case you need to install ppg to somwhere else or
# somthing. You should be able to change anything here and it will
# be the only place you need to change it
#-------------------------------------------------------------------
cd /usr/local/ppg
maindir=/usr/local/ppg/ # where all files should be
serverlistname=serverlist.txt # the list of RSS feeds
serverlistdir=$maindir # the dir where the list file is located
serverlist=$serverlistdir$serverlistname
#-----------------------------------
# Main menu ( not like the c main ).
#-----------------------------------
main ()
{
Xdialog --no-tags --title "$(gettext 'Puppy Podcast Grabber')" --menu "" 20 45 15 \
1 "$(gettext '======= HELP!! =======')" 2 "$(gettext '* Check For New Podcast')" 3 "$(gettext '== VIEW Podcast Feeds')" 4 "$(gettext '== ADD A Podcast Feed')" 5 "$(gettext '== REMOVE A Podcast Feed')" 6 "$(gettext '== EDIT A Podcast Feed')" 7 "$(gettext '== EDIT by Hand ( Caution )')" 8 "$(gettext '=+ Quit')"
}
#-----------------------------------------------
# Lists all podcast feeds from serverlist file. Then alows the user to select one.
# Used in "edit" and "delete" menu options.
#-----------------------------------------------
listpod ()
{
plist=$(count=1
while read test_url test_keep test_name; do
echo -n "$count"
echo -n " \"$test_name\" "
let "count=$count+1"
done <"${serverlistdir}${serverlistname}")
eval "Xdialog --no-tags --title \"$(gettext 'Puppy Podcast Grabber')\" --menu \"$(gettext 'Select A Podcast')\" 20 45 15 $plist"
}
listpodlong ()
{
plist=$(
count=1
while read test_url test_keep test_name; do
let "noff=25-${#test_name}"
noffsp=$(noff=12
count02=1
while [ $count02 -lt $noff ];do
echo -n " "
let "count02=count02+1"
done)
echo -n "$count"
echo -n " \"$test_name$noffsp $test_keep $test_url\" "
let "count=$count+1"
done <"${serverlistdir}${serverlistname}"
)
#echo "Xdialog --no-tags --title \"Puppy Podcast Grabber\" --menu \"Select A File\" 20 45 15 $plist"
#read
eval "Xdialog --no-tags --title \"$(gettext 'Puppy Podcast Grabber')\" --menu \"$(gettext 'Current Podcasts')\" 20 80 15 $plist"
}
##
if [ "$menucommand" == "1" ]; then
t=$(listpodlong 2>&1)
fi
menucommand="2"
while [ "$menucommand" != "" ]; do
menucommand=$(main 2>&1)
echo $menucommand
#-----------------------------------------------
# view RSS feeds See above function "listpod"
#-----------------------------------------------
if [ "$menucommand" == "3" ]; then
t=$(listpodlong 2>&1)
fi
# Add a new RSS feed
if [ "$menucommand" == "4" ]; then
name=""; url="";days="7"
ret=$(Xdialog --separator "|" --3inputsbox "$(gettext 'Edit Podcast')" 20 100 "$(gettext 'NAME')" "$name" "$(gettext 'URL')" "$url" "$(gettext 'Days')" "$days" 2>&1)
if [ "$ret" != "" ]; then
newname=$(echo $ret | cut -d"|" -f1)
newurl=$(echo $ret | cut -d"|" -f2)
newday=$(echo $ret | cut -d"|" -f3)
echo "$newurl $newday $newname" >> $serverlist
fi
fi
#------------------------------------------------------------------------------
# Edit RSS feed info.. How long to keep files, URL and your name for the feed
#------------------------------------------------------------------------------
if [ "$menucommand" == "6" ]; then
mc=$(listpod 2>&1)
count=1
while read test_url test_keep test_name; do
if [ "$count" = "$mc" ]; then
name="$test_name"
url=$test_url
days=$test_keep
fi
let "count=$count+1"
done <"${serverlistdir}${serverlistname}"
if [ "X$name" != "X" ]; then
ret=$(Xdialog --separator "|" --3inputsbox "$(gettext 'Edit Podcast')" 20 100 "$(gettext 'NAME')" "$name" "$(gettext 'URL')" "$url" "$(getetxt 'Days')" "$days" 2>&1)
if [ "$ret" != "" ]; then
newname=$(echo $ret | cut -d"|" -f1)
newurl=$(echo $ret | cut -d"|" -f2)
newday=$(echo $ret | cut -d"|" -f3)
while read test_url test_keep test_name; do
if [ "$test_name" = "$name" ]; then
echo "$newurl $newday $newname" >>"${serverlistdir}.${serverlistname}.tmp"
else
echo "$test_url $test_keep $test_name" >>"${serverlistdir}.${serverlistname}.tmp"
fi
done <"${serverlistdir}${serverlistname}"
rm -f $serverlist
cat "${serverlistdir}.${serverlistname}.tmp" >$serverlist
rm -f "${serverlistdir}.${serverlistname}.tmp"
fi
fi
fi
#-------------------------------------------------
#Removes an RSS feed from the serverlist file
#------------------------------------------------
if [ "$menucommand" == "5" ]; then
mc=$(listpod 2>&1)
count=1
while read test_url test_keep test_name; do
if [ "$count" = "$mc" ]; then
name="$test_name"
url=$test_url
days=$test_keep
fi
let "count=$count+1"
done <"${serverlistdir}${serverlistname}"
if [ "X$name" != "X" ]; then
while read test_url test_keep test_name; do
if [ "$test_name" = "$name" ]; then
echo "$newurl $newday $newname" >>/dev/null
else
echo "$test_url $test_keep $test_name" >>"${serverlistdir}.${serverlistname}.tmp"
fi
done <"${serverlistdir}${serverlistname}"
rm -f $serverlist
cat "${serverlistdir}.${serverlistname}.tmp" >$serverlist
rm -f "${serverlistdir}.${serverlistname}.tmp"
fi
fi
#--------------------------------------
#Edit the serverlist yourself
#--------------------------------------
if [ "$menucommand" == "7" ]; then
defaulttexteditor "$serverlist"
fi
#-------------------------------------
# Get the files (Podcasts)
#-------------------------------------
if [ "$menucommand" == "2" ]; then
rxvt -title "$(gettext 'Puppy Podcast Grabber')" -sl 1000 -e "./ppg.sh"
fi
#------------------------------------
# Help !
#------------------------------------
if [ "$menucommand" == "1" ]; then
defaultbrowser $maindir/readme.html &
fi
#-----------------------------------
# Quit
#-----------------------------------
if [ "$menucommand" == "8" ]; then
exit
fi
done
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
/usr/sbin/loginmanager
Congratsrobwoj44 wrote:By chance. I run root2user. I did not write the password and closed root2user by pprocess. After reboot I was still fido user. It was not possible to change to root by login manager.The only way I know for running as fido is to use the 'fido' button at first shutdown.
How did you "permanently change the user to fido user" ?
I tried to change the password (for fido user?) by root2user. This password did not work in login manager and when I started for example puppy package manager. In login manager only worked the password "woofwoof", but after the reboot I was still fido user.
It was not possible to run rxvt. I have no time to check on and finally I reinstalled racy:)
You found a bug
I fixed it http://murga-linux.com/puppy/viewtopic. ... 7&start=94