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 Sat 25 Oct 2014, 05:15
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects » Localization Project
Translated: "Welcome, this is the first time you run ....."
Moderators: Lobster, MU, raffy
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 2 of 2 Posts_count   Goto page: Previous 1, 2
Author Message
L18L

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

PostPosted: Thu 13 Feb 2014, 09:04    Post_subject: Translated: "Welcome, this is the first time you run ....."
Sub_title: greyed out button
 

01micko wrote:
Ok.. but IF FILEEXISTS("/etc/resolv.conf") might be a better test (will exist if lan connected at first boot). I don't have that one Barry refers to, must be new in quirky.

Also, can the button be greyed out at all?


Think that this question does not concern translated texts, right?
Sorry, I have no idea how to grey out a button. Rolling Eyes

.
Back to top
View user's profile Send_private_message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Thu 13 Feb 2014, 09:15    Post_subject: Re: Translated: "Welcome, this is the first time you run ....."
Sub_title: greyed out button
 

L18L wrote:
01micko wrote:
Ok.. but IF FILEEXISTS("/etc/resolv.conf") might be a better test (will exist if lan connected at first boot). I don't have that one Barry refers to, must be new in quirky.

Also, can the button be greyed out at all?


Think that this question does not concern translated texts, right?
Sorry, I have no idea how to grey out a button. Rolling Eyes

.


My welcome1stboot is designed to work in Quirky.
It is called from /usr/sbin/delayedrun, which creates the files that are read in welcome1stboot.

_________________
http://bkhome.org/news/
Back to top
View user's profile Send_private_message Visit_website 
L18L

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

PostPosted: Thu 13 Feb 2014, 09:33    Post_subject: IF FILEEXISTS("/etc/resolv.conf")  

01micko,

hope that Barry's comment helps you.

If there is anything that slacko should handle differently let me know it
and I will convert your shell code to BaCon code.
Back to top
View user's profile Send_private_message 
01micko


Joined: 11 Oct 2008
Posts: 7836
Location: qld

PostPosted: Thu 13 Feb 2014, 18:18    Post_subject:  

Thanks Barry,

Sorry L18L for off topic. Do we need a separate thread, getting confusing finding latest source.

Anyway, I know how to make the button insensitive, just took a look in hug.bac
Code:
ATTACH(mainwin,label_c,571,172)
IF FILEEXISTS(internet_test_file_goes_here) THEN
 DISABLE(button_ic)
ENDIF

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send_private_message Visit_website 
L18L

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

PostPosted: Fri 14 Feb 2014, 11:08    Post_subject: "Welcome, this is the first time you run ....."
Sub_title: button
 

Thanks mick, easy to remember for disabled and gray outed ones Laughing

Pointers to actual code will always be in 2nd post of this thread besides a 32bit executable.
This may take a while as I am not at home today. Posting from quirky tahr on usb stick on daughter's laptop.

I think it is a good idea to disable the connect button if the connection is already done.
I know from own experience that if this button is clicked by accident then the connection is broken, Not good in a Welcome First Boot.
One might say: the text has also to be changed in grayout case--- but who is reading text? or if they read it there are other methods mentioned in the text,

I do not think all of this is really OT. There is no better fitting section on this forum.
Back to top
View user's profile Send_private_message 
L18L

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

PostPosted: Sat 15 Feb 2014, 17:13    Post_subject: Re: "Welcome, this is the first time you run ....."
Sub_title: button
 

L18L wrote:
Pointers to actual code will always be in 2nd post of this thread besides a 32bit executable.


...done

Changes:
gray outed button
larger screen (640x480) for language choice
Back to top
View user's profile Send_private_message 
L18L

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

PostPosted: Mon 03 Mar 2014, 06:35    Post_subject:  

Some other languages would be nice Smile
Back to top
View user's profile Send_private_message 
vicmz


Joined: 15 Jan 2012
Posts: 1117

PostPosted: Wed 05 Mar 2014, 14:26    Post_subject:  

Portuguese (from mariojrmatos' langpack)
Italian (my Italian is somewhat correct, but a native speaker's check would be great).
welcome1stboot_it_woof-ce.tar.gz
Description  Italiano
gz

 Download 
Filename  welcome1stboot_it_woof-ce.tar.gz 
Filesize  2.41 KB 
Downloaded  82 Time(s) 
welcome1stboot_pt_woof-ce.tar.gz
Description  Português
gz

 Download 
Filename  welcome1stboot_pt_woof-ce.tar.gz 
Filesize  3.6 KB 
Downloaded  77 Time(s) 

_________________
OB Precise 14.07.26 Woof-CE|Puppy Linux en español
Back to top
View user's profile Send_private_message 
L18L

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

PostPosted: Fri 28 Mar 2014, 14:40    Post_subject:  

vicmz wrote:
Portuguese (from mariojrmatos' langpack)
Italian (my Italian is somewhat correct, but a native speaker's check would be great).

I did not forget you.
Thank you very much.

...and here is the 100-liner that created the image

Code:
#!/bin/sh
# let user choose a language from installed mo files for app
# was implemented in welcome1stboot.bac
# but as shell script here now
# L18L March 2014 GPL
#

version=0.1

die() { echo $1; exit 1;}

usage()
{
 echo "
 usage: $0 textdomain [ app ]
 
 app only needed if different from textdomain
 choose a language from available textdomains
 app will be launched in chosen language
 
 -h this help
 -v version
 "    
}

[ $1 = '-h' ] && { usage; exit 0; }
[ $1 = '-v' ] && { echo ${0##*/} version $version; exit 0; }

textdomain=$1 && [ $textdomain ] || die "which textdomain?"
app=$2 && [ "$app" ] || app=$textdomain

# some files
all_language_names=/usr/share/i18n/lang_names
[ -f $all_language_names ] || all_language_names=lang_names
[ -f $all_language_names ] || die "missing file lang_names, exiting"
these_languages=/dev/shm/language_names
chosen_lang=/dev/shm/chosen_lang_code

# English plus all other available languages for textdomain
langs="en `find /usr/share/locale/*/LC_MESSAGES/${textdomain}.mo|cut -d'/' -f5`"
num_languages="`echo $langs | wc -w`"
echo -n '' > $these_languages
for x in $langs;do echo "`grep ^$x $all_language_names`">>$these_languages;done

# GUI ========================================================================
num_cols=2 # number of columns
[ $num_languages -gt 4 ] && num_cols=3
[ $num_languages -gt 6 ] && num_cols=4

choose_language='
<window title="'$textdomain'" icon-name="gtk-preferences" window-position="1">
<vbox space-expand="true" space-fill="true">
 <vbox spacing="10" space-expand="true" space-fill="true">
 <frame ? ? ?>
  <hbox spacing="10" homogeneous="true" space-expand="true" space-fill="true">
'
x=0
col=0
while [ $x -lt $num_languages ] ; do
 x=$(($x + 1))
 col=$(($col + 1))
 read language_name             #ex: de:Deutsch 
 lang_code=${language_name%:*}  #ex: de
 lang_name=${language_name#*:} #ex: Deutsch
 choose_language=${choose_language}'
    <button image-position="2">
     <label>"'$lang_name'"</label>
     '"`/usr/lib/gtkdialog/xml_button-icon reboot.svg huge`"'
     <action>echo '$lang_code' > chosen_lang</action>
     <action>exit:exit</action>
    </button>'
 if [ $col -ge $num_cols ]; then
  col=0
  choose_language=${choose_language}'
   </hbox>
   <hbox spacing="10" homogeneous="true" space-expand="true" space-fill="true">'
 fi
done < $these_languages
choose_language=${choose_language}'
   </hbox>
  </frame>
 </vbox>
</vbox>
</window>'
# /GUI ========================================================================

export choose_language
eval `gtkdialog -p choose_language`
chosen_lang_code=`cat chosen_lang`
#echo chosen_lang_code=`cat chosen_lang`   #example: "nl"

#prepend chosen_lang_code to envirinment variable LANGUAGE
#echo LANGUAGE=$LANGUAGE                   #example: "fr:de:"
[ "$LANGUAGE" ] && LANGUAGE=":${LANGUAGE}" #example: ":fr:de:"
LANGUAGE="${chosen_lang_code}${LANGUAGE}"  #example: "nl:fr:de:"
export LANGUAGE

$app & #launch application
exit 0 #end
welcome_2014-03-28_195118.png
 Description   ...a work in progress
 Filesize   12.79 KB
 Viewed   92 Time(s)

welcome_2014-03-28_195118.png

Back to top
View user's profile Send_private_message 
L18L

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

PostPosted: Tue 01 Apr 2014, 08:35    Post_subject:  

Script in previous post works in slacko only I think.

Script development continued in cutting edge.
There is a pet you can use to run any application in any installed language. that is use it for welcome1stboot or geany or (even) xwin Cool

Should work with Brazilian and Chinese tooo...
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 2 of 2 Posts_count   Goto page: Previous 1, 2
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.0862s ][ Queries: 12 (0.0129s) ][ GZIP on ]