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 20 Sep 2014, 02:07
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 [25 Posts]   Goto page: Previous 1, 2
Author Message
L18L

Joined: 19 Jun 2010
Posts: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Thu 13 Feb 2014, 09:04    Post subject: Translated: "Welcome, this is the first time you run ....."
Subject description: 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 ....."
Subject description: 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 poster's website 
L18L

Joined: 19 Jun 2010
Posts: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

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: 7802
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 poster's website 
L18L

Joined: 19 Jun 2010
Posts: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Fri 14 Feb 2014, 11:08    Post subject: "Welcome, this is the first time you run ....."
Subject description: 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: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Sat 15 Feb 2014, 17:13    Post subject: Re: "Welcome, this is the first time you run ....."
Subject description: 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: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

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

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  74 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  69 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: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

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   87 Time(s)

welcome_2014-03-28_195118.png

Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2505
Location: Burghaslach, Germany somewhere also known as "Hosla"

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 from previous:   Sort by:   
Page 2 of 2 [25 Posts]   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:  

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
[ Time: 0.0793s ][ Queries: 13 (0.0057s) ][ GZIP on ]