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 31 Oct 2014, 02:26
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects » Localization Project
Programs and scripts that are not yet internationalized
Moderators: Lobster, MU, raffy
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 3 of 4 Posts_count   Goto page: Previous 1, 2, 3, 4 Next
Author Message
robwoj44

Joined: 08 Aug 2008
Posts: 372
Location: Warsaw

PostPosted: Thu 16 May 2013, 08:42    Post_subject:  

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
sources.tar.gz
Description  Sources of gpptp and ssh-gui with Makefile
gz

 Download 
Filename  sources.tar.gz 
Filesize  8.59 KB 
Downloaded  276 Time(s) 

Edited_times_total
Back to top
View user's profile Send_private_message 
robwoj44

Joined: 08 Aug 2008
Posts: 372
Location: Warsaw

PostPosted: Thu 16 May 2013, 10:43    Post_subject:  

Pdict internationalized

/usr/sbin/pdict
Code:
#!/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###
Back to top
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2535
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Thu 16 May 2013, 13:35    Post_subject: Programs and scripts that are not yet internationalized
Sub_title: ssh-gui
 

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

I am also no C guru, just tried to internationalize some progs.

gpptp
can be edited now (don't know what was wrong Rolling Eyes )
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:
Quote:
# 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 Crying or Very sad

[edit] I suspect it has something to do with different CHARSET

Edited_time_total
Back to top
View user's profile Send_private_message 
robwoj44

Joined: 08 Aug 2008
Posts: 372
Location: Warsaw

PostPosted: Thu 16 May 2013, 13:48    Post_subject:  

I think it is my fault. I do not add the file netbook.c which I did not change.
I reloaded sources.tar.gz with this file and Makefile.
Back to top
View user's profile Send_private_message 
don570


Joined: 10 Mar 2010
Posts: 3359
Location: Ontario

PostPosted: Thu 16 May 2013, 20:05    Post_subject: 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.

___________________________________________
Back to top
View user's profile Send_private_message 
don570


Joined: 10 Mar 2010
Posts: 3359
Location: Ontario

PostPosted: Sat 18 May 2013, 14:03    Post_subject: 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.

Code:
xgettext --from-code=UTF-8 -L shell script.sh
Back to top
View user's profile Send_private_message 
Bert


Joined: 30 Jun 2006
Posts: 954

PostPosted: Sat 18 May 2013, 18:55    Post_subject:  

Thanks for your work Don Cool

Your gettexted version of alien2puppy is working fine. See attachment for a dutch alien2puppy Smile

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.
capture30560.png
Description 
png

 Download 
Filename  capture30560.png 
Filesize  46.2 KB 
Downloaded  263 Time(s) 

_________________


Back to top
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2535
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Sun 19 May 2013, 08:29    Post_subject: Re: alien2puppy - gettext  

don570 wrote:
...I discovered that Momanager is useless if the script has expressions
that use UTF-8 characters....


I would define it in a positive way:

The script maker ensures that it can be translated using momanager Cool


Bert wrote:
it is important to specify utf-8 in both Geany and Poedit

+1 Very Happy
Back to top
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2535
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Sun 19 May 2013, 08:33    Post_subject: Re: Programs and scripts that are not yet internationalized
Sub_title: ssh-gui
 

L18L wrote:
...
Sorry I have no idea how to continue for now Crying or Very sad

[edit] I suspect it has something to do with different CHARSET

And there is a mismatch of ssh-gui and ssh_gui somewhere Rolling Eyes

[edit] mystery solved Laughing

Edited_time_total
Back to top
View user's profile Send_private_message 
robwoj44

Joined: 08 Aug 2008
Posts: 372
Location: Warsaw

PostPosted: Mon 20 May 2013, 06:22    Post_subject:  

I made the folder /usr/share/doc/nls/ssh-gui and placed ssh-gui.pot. It was possible for me to change actual translation of ssh-gui.mo. I made the test in racy 5.5.
Back to top
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2535
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Mon 20 May 2013, 13:16    Post_subject:  

robwoj44
thank you for your post
It has encouraged me to debug fast momanager another time. Cool
Back to top
View user's profile Send_private_message 
rodin.s

Joined: 22 Sep 2010
Posts: 338
Location: Ukraine

PostPosted: Tue 21 May 2013, 16:46    Post_subject:  

Script /usr/sbin/root2user is not gettexted. It's not very important though.
Back to top
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2535
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Wed 22 May 2013, 05:29    Post_subject: Programs and scripts that are not yet internationalized
Sub_title: /usr/sbin/root2user
 

rodin.s wrote:
Script /usr/sbin/root2user is not gettexted. It's not very important though.

... and that is good
because the English text is ...misleading.
(was it for me, see also http://puppylinux.info/topic/fido-andor-multi-user-system )
Anyhow I am glad to see that fido is going to be used. Smile

Quote:
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


This text made me (what about you?) think that this password is root's password.

Prove:
ALT-F2
login: fido
password: <your chosen password>

ALT-F3
login: root
password: <your chosen password>

change fido's passwd:
Code:
passwd fido


go back to X as user fido:
ALT-F4
Code:
pmount


Which of the two (now different) passwords let you start pmount?

running as fido in Puppy Precise 5.6
Back to top
View user's profile Send_private_message 
robwoj44

Joined: 08 Aug 2008
Posts: 372
Location: Warsaw

PostPosted: Wed 22 May 2013, 10:48    Post_subject:  

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
Code:
#! /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

Edited_time_total
Back to top
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2535
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Wed 22 May 2013, 11:41    Post_subject: fido
Sub_title: ?
 

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.

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" ?

Did you change root's password or fido's password or none or both?
What is the output of
Code:
whoami

and
Code:
cat /etc/inittab

?
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 3 of 4 Posts_count   Goto page: Previous 1, 2, 3, 4 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Puppy Projects » Localization Project
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.1398s ][ Queries: 12 (0.0327s) ][ GZIP on ]