Translated: "Welcome, this is the first time you run ....."

For efforts in internationalising Puppy and solving problems in this area
Message
Author
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Translated: "Welcome, this is the first time you run ....."

#16 Post by L18L »

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. :roll:

.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

Re: Translated: "Welcome, this is the first time you run ....."

#17 Post by BarryK »

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. :roll:

.
My welcome1stboot is designed to work in Quirky.
It is called from /usr/sbin/delayedrun, which creates the files that are read in welcome1stboot.
[url]https://bkhome.org/news/[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

IF FILEEXISTS("/etc/resolv.conf")

#18 Post by L18L »

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.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#19 Post by 01micko »

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: Select all

ATTACH(mainwin,label_c,571,172)
IF FILEEXISTS(internet_test_file_goes_here) THEN
 DISABLE(button_ic)
ENDIF
Puppy Linux Blog - contact me for access

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

"Welcome, this is the first time you run ....."

#20 Post by L18L »

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

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.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: "Welcome, this is the first time you run ....."

#21 Post by L18L »

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

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#22 Post by L18L »

Some other languages would be nice :)

User avatar
vicmz
Posts: 1262
Joined: Sun 15 Jan 2012, 22:47

#23 Post by vicmz »

Portuguese (from mariojrmatos' langpack)
Italian (my Italian is somewhat correct, but a native speaker's check would be great).
Attachments
welcome1stboot_it_woof-ce.tar.gz
Italiano
(2.41 KiB) Downloaded 314 times
welcome1stboot_pt_woof-ce.tar.gz
Português
(3.6 KiB) Downloaded 298 times
[url=http://murga-linux.com/puppy/viewtopic.php?t=76948]Puppy Linux en español[/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#24 Post by L18L »

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: Select all

#!/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
Attachments
welcome_2014-03-28_195118.png
...a work in progress
(12.79 KiB) Downloaded 191 times

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#25 Post by L18L »

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 8)

Should work with Brazilian and Chinese tooo...

Post Reply