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 Thu 17 Apr 2014, 17:39
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects
Fatdog64-630rc1 (16 Oct 2013) [CLOSED]
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 12 of 13 [195 Posts]   Goto page: Previous 1, 2, 3, ..., 10, 11, 12, 13 Next
Author Message
L18L

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

PostPosted: Sat 07 Dec 2013, 10:46    Post subject: Fatdog64-630rc1
Subject description: internationalisation tool
 

Here is the tool for internationalization of Fatdog.

momanager-20131206.pet uploaded only here because
- pets made by dir2pet in Fatdog cannot be installed in Puppy.
- number of Fatdog users who wish to translate (and can / have a 64 bit system) is unknown

If you want to use it for your language install basic langpack from puppy first.

Feedback appreciated.
Have fun

edit
Viewing the picture I have to add
Next improvement should be:
do not dispay every single script, just 1 for each textdomain is shorter and better
create_languagepackFatdog.png
 Description   
 Filesize   33.06 KB
 Viewed   634 Time(s)

create_languagepackFatdog.png

momanager-20131206.pet
Description  fit for Fatdog
pet

 Download 
Filename  momanager-20131206.pet 
Filesize  26.49 KB 
Downloaded  113 Time(s) 
Back to top
View user's profile Send private message 
L18L

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

PostPosted: Sun 08 Dec 2013, 08:56    Post subject: Fatdog64-630
Subject description: example for t12s method of internationalization
 

example for t12s method of internationalization

/usr/sbin/set-time-for-puppy
Code:
#!/bin/sh
#2007 Lesser GPL licence v2 (http://www.fsf.org/licensing/licenses/lgpl.html)
# A small script used to set the time under Linux with hwclock...
# MU: updated for puppy 1.0.7.
# jamesbond 2012 - add gtksu & other fixes
#131112 L18L internationalisation
#131208 t12s version

#export TEXTDOMAIN=fatdog
export OUTPUT_CHARSET=UTF-8
#. gettext.sh #131208
[ "$LC_MESSAGES" ] && LANG=$LC_MESSAGES # for --calendar and --timebox

app=`basename $0`
T=/usr/share/locales # TEXTDOMAINDIR
# a one-liner to find existing translation file LOCALES allowing 'dialects'
[ ! -f ${T}/${LANG%.*}/${app} ] && LOCALES=${T}/${LANG%_*}/${app} || LOCALES=${T}/${LANG%.*}/${app}
[ -f $LOCALES ] && . $LOCALES # (re)load translation file (when using variables)


# Title to be used for all Xdialog boxes.

#APPTITLE="$(gettext 'Set System Time')"
APPTITLE="${_M_1:-Set System Time}"
set
HWCLOCKPARM="--localtime" # default
HWCLOCKCONF=/etc/hwclock.conf
[ -e $HWCLOCKCONF ] && . $HWCLOCKCONF

[ $(id -u) -ne 0 ] && exec gtksu "$APPTITLE" "$0"

# Get the date (returned in DD/MM/YYYY format by Xdialog)
#! NEWDATE=`Xdialog --stdout --title "$APPTITLE" --calendar "$(gettext 'Please set the date...')" 0 0 0 0 0` && exit
! NEWDATE=`Xdialog --stdout --title "$APPTITLE" --calendar "${_M_2:-Please set the date...}" 0 0 0 0 0` && exit

# Get the time in HH:MM:SS format.
#if ! NEWTIME=`Xdialog --stdout --title "$APPTITLE" --timebox "$(gettext 'Please set the time...')" 0 0`; then
if ! NEWTIME=`Xdialog --stdout --title "$APPTITLE" --timebox "${_M_3:-Please set the date...}" 0 0`; then
#   Xdialog --title "$APPTITLE" --msgbox "$(gettext 'Aborted.')" 0 0
   Xdialog --title "$APPTITLE" --msgbox "${_M_4:-Aborted.}" 0 0
   exit
fi

# Set system time, then use system time to set the hardware clock (RTC)
OIFS=$IFS; IFS=/; set -- $NEWDATE
D=$1 M=$2 Y=$3

IFS=:; set -- $NEWTIME; IFS=$OIFS
H=$1$2
DT=$M$D$H$Y

date $DT
#Xdialog --title "$(gettext 'info')" --msgbox "$(gettext 'Your screen might turn black now for some seconds, just wait...')" 0 0
Xdialog --title "${_M_5:-info}" --msgbox "${_M_6:-Your screen might turn black now for some seconds, just wait...}" 0 0

hwclock --systohc $HWCLOCKPARM
THEDATE=`date`
#Xdialog --title "$(gettext 'info')" --msgbox "$(eval_gettext 'Finished. Time was set to $THEDATE')" 0 0

[ -f $LOCALES ] && . $LOCALES # (re)load translation file (when using variables)
Xdialog --title "${_M_5:-info}" --msgbox "${_M_7:-Finished. Time was set to $THEDATE}" 0 0


German translation in file /usr/share/locales/de/set-time-for-puppy:
Code:
_M_1="Datum und Uhrzeit"
_M_2="Bitte Datum einstellen..."
_M_3="Bitte Uhrzeit einstellen..."
_M_4="Abgebrochen."
_M_5="Info"
_M_6="Der Bildschirm kann jetzt für ein paar Sekunden schwarz werden, einfach abwarten..."
_M_7="Fertig. Zeit wurde auf $THEDATE gesetzt."


(This example has been "hand made" without yad GUI)

Faster? How much?

--------------------------------------------------

edit
...and translators would be happy if they had a pot file like:
Code:
#set-time-for-puppy.pot

#_M_1
msgid "Set System Time"
msgstr ""

#_M_2
msgid "Please set the date"
msgstr ""

#_M_3
msgid "Please set the time..."
msgstr ""

#_M_4
msgid "Aborted."
msgstr ""

#_M_5
msgid "info"
msgstr ""

#_M_6
msgid "Your screen might turn black now for some seconds, just wait..."
msgstr ""

#_M_7
msgid "Finished. Time was set to $THEDATE"
msgstr ""
Back to top
View user's profile Send private message 
L18L

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

PostPosted: Sun 08 Dec 2013, 11:36    Post subject: Re: Fatdog64-630
Subject description: example for t12s method of internationalization
 

L18L wrote:
...and translators would be happy if they had a pot file like:

Here is how we will be able to format the messages for t12s:
messages.
Code:
#set-time-for-puppy.po

#_M_1
msgid "Set System Time"
msgstr "Systemzeit einstellen"

#_M_2
msgid "Please set the date"
msgstr "Bitte Datum einstellen..."

#_M_3
msgid "Please set the time..."
msgstr "Bitte Uhrzeit einstellen..."

#_M_4
msgid "Aborted."
msgstr "Abgebrochen."

#_M_5
msgid "info"
msgstr "Info"

#_M_6
msgid "Your screen might turn black now for some seconds, just wait..."
msgstr "Der Bildschirm kann jetzt für ein paar Sekunden schwarz werden, einfach abwarten..."

#_M_7
msgid "Finished. Time was set to $THEDATE"
msgstr "Fertig. Zeit wurde auf $THEDATE gesetzt."


The formatting code
Code:
.#!/bin/sh
# t12s_msgfmt by L18L dec 2013, GPL
#
if [ -z "$1" ]; then echo "usage $0 file.po [> file]"; exit 1; fi
if [ $1 = "-h" -o $1 = "--help" ]; then echo "Convert portable object (po) file.po to translated messages for t12s"; exit 0; fi
if [ ! -f "$1" ]; then echo "$1 is not a file"; exit 1; fi

echo "#created `date` by $0 for script $1"
while read LINE; do
 case $LINE in
  \#_M_*) ID=${LINE:1} ;;
  msgstr*) echo "${ID}=${LINE#* }" ;;
 esac
done < $1

exit 0

The test run
Code:
# ./t12s_msgfmt set-time-for-puppy.po
#created Son Dez  8 16:42:09 CET 2013 by ./t12s_msgfmt for script set-time-for-puppy.po
_M_1="Systemzeit einstellen"
_M_2="Bitte Datum einstellen..."
_M_3="Bitte Uhrzeit einstellen..."
_M_4="Abgebrochen."
_M_5="Info"
_M_6="Der Bildschirm kann jetzt für ein paar Sekunden schwarz werden, einfach abwarten..."
_M_7="Fertig. Zeit wurde auf $THEDATE gesetzt."
#
#

And the run
Code:
# ./t12s_msgfmt set-time-for-puppy.po > /usr/share/locale/de/set-time-for-puppy
Back to top
View user's profile Send private message 
christhi

Joined: 20 Feb 2007
Posts: 12

PostPosted: Fri 13 Dec 2013, 23:35    Post subject: Problem with kernel-source  

I gave a try at FatDog64 thinking it would work ok with my old AMD 64 Athlon tower.

I had to go through a lot of butthurt in order to do what's pretty much simple under Puppy 5.5. I had to download the huge Devx SFS, then the kernel-source SFS, that wasn't recognized by Getnvidia even it that was the correct version (3.11.4).

In other non-64 Puppies, did not require all this stuff to be installed for having the Nvidia drivers up and running. Why so complicated? Is it because of the specific kernel images for the AMD 64 hardware?

Perhaps the more stable versions of FatDog don't have these problems.

anyways.... some suggestions would be appreciated. Thanks!
Back to top
View user's profile Send private message 
Ted Dog


Joined: 13 Sep 2005
Posts: 2051
Location: Heart of Texas

PostPosted: Sat 14 Dec 2013, 00:41    Post subject:  

you are trying a RC1 that was highlighted above as a shortcoming. The release Kernel Version was expected to be bumped so the premade blobs for video drivers was not going to be done. Sorry, it is much easier normally.
I think a rumored 64bit Christmas gift is in the works. James and company do get very quiet before an announcement. Its been quiet almost dead on this thread, So your post got me all excited. .... darn not a early Christmas after all... Mad
Back to top
View user's profile Send private message 
L18L

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

PostPosted: Sun 15 Dec 2013, 08:14    Post subject: Fatdog64-630rc1 (16 Oct 2013)
Subject description: internationalization
 

I am working at momanager being able to process t12s method.
Translator will see not much difference from gettext.

Just some bug fixing...
Back to top
View user's profile Send private message 
p310don

Joined: 19 May 2009
Posts: 686
Location: Brisbane, Australia

PostPosted: Mon 16 Dec 2013, 02:39    Post subject:  

Late to the party, but I tried 630 over the weekend. Was great, and bad...

I had to rip a DVD. I had used Saluki to do this task, took a couple of hours. Did the same DVD on the same PC in FD64-630RC1, took two minutes. I thought it was majorly broken, but worked fine.

I decided, this is awesome, time to upgrade to a new pup.

Rebooted machine, created save file. Will not reboot. It went to command prompt, tried xorgwizard, tried to change nvidia drivers, no dice.

Deleted save file, rebooted, worked fine. Created a new save file, with no additions (which I had before), rebooted, and no dice again. This time, I just gets to a screen with a "static" line across the top.

PC is AMD64 Athlon II 3.2Ghz, 8gig ram, Nvidia GT-210 booting manual frugal install.

What am I doing wrong?

BTW, I thought it was me, so I did the same install with 620, and it worked fine, with and without a save file.
Back to top
View user's profile Send private message 
nooby

Joined: 29 Jun 2008
Posts: 10518
Location: SwedenEurope

PostPosted: Mon 16 Dec 2013, 03:02    Post subject:  

p310don wrote:
Late to the party, but I tried 630 over the weekend. Was great, and bad...

I had to rip a DVD. I had used Saluki to do this task, took a couple of hours. Did the same DVD on the same PC in FD64-630RC1, took two minutes. I thought it was majorly broken, but worked fine.

I decided, this is awesome, time to upgrade to a new pup.

Rebooted machine, created save file. Will not reboot. It went to command prompt, tried xorgwizard, tried to change nvidia drivers, no dice.

Deleted save file, rebooted, worked fine. Created a new save file, with no additions (which I had before), rebooted, and no dice again. This time, I just gets to a screen with a "static" line across the top.

PC is AMD64 Athlon II 3.2Ghz, 8gig ram, Nvidia GT-210 booting manual frugal install.

What am I doing wrong?

BTW, I thought it was me, so I did the same install with 620, and it worked fine, with and without a save file.


As I remember one have to follow their instructions and
not do the save file like one are used to. First time one should
boot with noRAM somethign. Read their FAQ I am too lazy
Edit I thought first I was in a slacko thread and I created a save file
in that distro. Sorry for my mistake.

_________________
I use Google Search on Puppy Forum
not an ideal solution though
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 1875
Location: The Blue Marble

PostPosted: Mon 16 Dec 2013, 09:34    Post subject:  

Ted Dog wrote:
I think a rumored 64bit Christmas gift is in the works. James and company do get very quiet before an announcement. Its been quiet almost dead on this thread, So your post got me all excited. .... darn not a early Christmas after all... Mad
Laughing The reason why kirk and I have been quiet is because both of us are out of town at the moment with intermittent or slow internet access Very Happy and not much time left for Fatdog until we're back home.

p310don, if you open the Fatdog ISO file, you will find isolinux.cfg which contains many workarounds. You may try the ones relevant for nvidia. I think I've already included nouveau.noaccel=1 by default, if not, try that on the kernel parameter and see it improves the situation. If it doesn't work, then let's wait for rc2 - perhaps the newer kernel/nouveau driver has that issue fixed.

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13
Back to top
View user's profile Send private message 
p310don

Joined: 19 May 2009
Posts: 686
Location: Brisbane, Australia

PostPosted: Mon 16 Dec 2013, 17:45    Post subject:  

Well played JB.

Putting

Code:
nouveau.noaccel=1


at the end of the kernel line in menu.lst for grub4dos worked for me.

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

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

PostPosted: Thu 19 Dec 2013, 14:19    Post subject: Fatdog64-630rc1 (16 Oct 2013) internationalization
Subject description: package manager and quickapps
 

bug fix for package-manager:

/usr/sbin/fatdog-package-manager.sh (mark was nor working in installed packages)

/usr/sbin/fatdog-package-manager.sh.xml (some translatable=yes added)

QuickApps internationalized using "puppy's official method" t12s
translated using very latest momanager.

BTW, these 2 are my favorite Fatdog apps Very Happy

QuickApps internationalized using t12s method
Code:
#!/bin/sh
# Quick Apps - create shortcut to often used applications
# Copyright (C) James Budiono 2012
# License: GNU GPL Version 3 or later
#
#131215 Internationalization
#131216 t12s version

export OUTPUT_CHARSET=UTF-8
[ "$LC_MESSAGES" ] && LANG=$LC_MESSAGES # for --calendar and --timebox
export TEXTDOMAIN=fd-control-panel

T=/usr/share/locales # TEXTDOMAINDIR
# a one-liner to find existing translation file LOCALES allowing 'dialects'
[ ! -f ${T}/${LANG%.*}/${TEXTDOMAIN} ] && LOCALES=${T}/${LANG%_*}/${TEXTDOMAIN} || LOCALES=${T}/${LANG%.*}/${TEXTDOMAIN}

[ -f $LOCALES ] && . $LOCALES # (re)load translation file (when using variables)


### configuration
APPTITLE="${_M_15:-QuickApps}"
APPICON=/usr/share/midi-icons/go48.png   # temporary icon
QUICKAPPS_HOME=$HOME/QuickApps
DESKTOP_FILES_DIR=/usr/share/applications
REBUILD_LINK="0-${_M_17:-Finish-Configuration}"
INDEX_FILE=.apps

##################### helper #####################

create_quickapps() {
   # if already exist, do nothing
   [ -d "$QUICKAPPS_HOME" ] && return
   
   # otherwise, create it
   mkdir -p "$QUICKAPPS_HOME"
   ln -sfT $(readlink -f "$0") "$QUICKAPPS_HOME/AppRun"
   ln -sfT $(readlink -f "$0") "$QUICKAPPS_HOME/$REBUILD_LINK"
   
   # create AppInfo.xml
   cat > "$QUICKAPPS_HOME/AppInfo.xml" <<EOF
<?xml version="1.0"?>
<AppInfo>
  <Summary>$APPTITLE</Summary>
  <About>
    <Purpose>${_M_19:-Application Launcher - create shortcuts for often-used applications}</Purpose>
    <Version>1.0</Version>
    <Authors>James Budiono</Authors>
    <License>GNU General Public License Version 3 or Later</License>
  </About>
  <AppMenu>
    <Item option="configure" icon="gtk-preferences">
      <Label>${_M_20:-Add/remove application shortcuts}</Label>
    </Item>
  </AppMenu>
</AppInfo>      
EOF
   ln -sfT "$APPICON" "$QUICKAPPS_HOME/.DirIcon"
}

launch_app() {
   fatdog-control-panel.sh "$APPTITLE" "$QUICKAPPS_HOME/$INDEX_FILE"
}

configure_app() {
   rox -d "$QUICKAPPS_HOME"
   rox -d "$DESKTOP_FILES_DIR"
   Xdialog --title "$APPTITLE" --left --infobox "
${_M_13:-Two folders have been opened. One is the QuickApps folder, the other one is the "All applications folder".}
${_M_12:-You can identify them by looking at the window title. To add a shortcut, follow these three easy steps:}

1. ${_M_18:-Create a new folder in the QuickApps folder.}
   `gettext "This new folder serves as 'Category' and will appear as a tab in the QuickApps."`
   
2. ${:M_:-From the 'All applications folder', select then drag and drop the applications you want
   into the 'Category' folder you created in step 1. Choose 'Link' when asked.}
   
3. ${_M_21:-Repeat step 1 and 2 as necessary. When done, click $REBUILD_LINK on the QuickApps folder.}

${_M_11:-Your QuickApps is available from your HOME folder.}
" 0 0 90000
}

###_:-Repeat step 1 and 2 as necessary. When done, click ${REBUILD_LINK} on the QuickApps folder.}
### TODO avoid failure from ${} inside $ { _ M _ * }

rebuild_app() {
   rox -D "$QUICKAPPS_HOME"
   rox -D "$DESKTOP_FILES_DIR"
   cd "$QUICKAPPS_HOME"
   rm $INDEX_FILE 2> /dev/null
   tab_count=0
   find . -maxdepth 1 -type d | sed '1 d; s_\./__' | while read p; do
      tab_count=$((tab_count + 1))
      {
         echo -n TAB$tab_count=\'$p\|
         ls "$p" | sed 's/.desktop$//' | tr '\n' ' '
         echo \'
      } >> $INDEX_FILE
   done
}

############# main ##############
# check how we're launched - directly or as rox app?
case $0 in
   *AppRun) # as rox app
      case $1 in
         "")       launch_app ;;
         configure)   configure_app ;;
      esac ;;
   
   *$REBUILD_LINK) # to finish configuration
      rebuild_app ;;   # as "
      
   *)   # as standalone app - do configure
      create_quickapps; exec "$QUICKAPPS_HOME/AppRun" configure ;;
esac



Momanager has 2 "hello world" samples , one for gettext and one for t12s to play with....
momanager.png
 Description   
 Filesize   39.24 KB
 Viewed   700 Time(s)

momanager.png

fatdog-package-manager.sh.xml.gz
Description  save to /usr/sbin/fatdog-package-manager.sh.xml
gz

 Download 
Filename  fatdog-package-manager.sh.xml.gz 
Filesize  43.99 KB 
Downloaded  118 Time(s) 
fatdog-package-manager.sh.gz
Description  save to /usr/sbin/fatdog-package-manager.sh
gz

 Download 
Filename  fatdog-package-manager.sh.gz 
Filesize  31.62 KB 
Downloaded  119 Time(s) 
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 1875
Location: The Blue Marble

PostPosted: Fri 20 Dec 2013, 23:18    Post subject:  

L18L,

Thanks for all these. I'm looking at your changes and I have a few questions.
1. For package-manager - where can I find this "gettext.sh"?
2. For t12s quick-apps, how would translation be handled if in the future the application is modified (e.g. deletion of existing strings, addition of new strings (how do these ${M_xxx} gets generated), changes of existing strings)? Can mo-manager automatically re-create all these changes? I surely hope I don't have to look at them one by one?

cheers!

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13
Back to top
View user's profile Send private message 
L18L

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

PostPosted: Sat 21 Dec 2013, 05:33    Post subject: Fatdog64-630rc1 (16 Oct 2013) internationalization
Subject description: gettext.sh
 

jamesbond wrote:
1. For package-manager - where can I find this "gettext.sh"?
locate found it here:
Code:
# locate gettext.sh | grep pup_ro
/aufs/pup_ro10/usr/bin/gettext.sh
#


BTW, I had appended
Code:
# update database for locate
updatedb &
to /etc/rc.d/rc.local
but it did not work, my 1st try was:
Code:
# locate gettext.sh
locate: warning: database `/var/state/locatedb' is more than 8 days old (actual age is 21,6 days)
/aufs/devsave/bootupi18n/puppyrcd_i18n/usr/bin/gettext.sh
/aufs/devsave/dotpup_i18n/usr/bin/gettext.sh
/aufs/pup_ro10/usr/bin/gettext.sh
/usr/bin/gettext.sh
#
Should I better use $HOME/Startup for this?
Last edited by L18L on Sat 21 Dec 2013, 05:34; edited 1 time in total
Back to top
View user's profile Send private message 
L18L

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

PostPosted: Sat 21 Dec 2013, 05:33    Post subject: Fatdog64-630rc1 (16 Oct 2013) internationalization
Subject description: ${M_xxx}
 

jamesbond wrote:
2. For t12s quick-apps, how would translation be handled if in the future the application is modified (e.g. deletion of existing strings, addition of new strings (how do these ${M_xxx} gets generated), changes of existing strings)? Can mo-manager automatically re-create all these changes? I surely hope I don't have to look at them one by one?

The tricky part is t12s_xgettext which does that what xgettext does:
create a portable object template file for TEXTDOMAIN At least it tries to do so....
Some rules:
1- In one line of script only one ${_M_}
2- No {} inside ${_M_:-No curly bracket here}
3- No line breaks in ${_M_}, use very long lines, activate Document>Line Wrapping in geany
4 - reload translation file before any ${_M_n:-A $variable inside message}

Adding new message: use just: ${_M_:-new message}
t12s_xgettext will insert the ID number which can be
- an existing one if the message already exists in the TEXTDOMAIN
- or otherwise a new one (last highest number + 1)

Deleting a message: it will not appear in actual TEXDOMAIN.pot

Changing a message: Don't do it. Just remove the ID and change th text, e.g.:
Code:
#MESSAGE="${_M_4711:-Fatdog is just a fat dog}"
MESSAGE="${_M_:-Fatdog is my favorite operating system}"


Then the existing translation
(TEXTDOMAIN.po created by t12s_msgunfmt from translation file /usr/share/locales/<language>/TEXTDOMAIN)
is merged with the actual TEXTDOMAIN.pot by gettext tool msgmerge --no-fuzzy.

The translator will see
- the deleted message commented
- and the translation for new message - msgstr - empty
... almost no difference to working with gettext

Cheers!

I am going to change some of the other scripts to t12s method (using a shell script) maybe just for fun ...
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 1875
Location: The Blue Marble

PostPosted: Sat 21 Dec 2013, 12:52    Post subject:  

L18L wrote:
jamesbond wrote:
1. For package-manager - where can I find this "gettext.sh"?
locate found it here:
Code:
# locate gettext.sh | grep pup_ro
/aufs/pup_ro10/usr/bin/gettext.sh
#

Ah, yes, of course I was being stupid - I didn't check devx. Thanks! This will have to be moved from devx to the base sfs then.

Quote:
BTW, I had appended
Code:
# update database for locate
updatedb &
to /etc/rc.d/rc.local
but it did not work, my 1st try was:
Code:
# locate gettext.sh
locate: warning: database `/var/state/locatedb' is more than 8 days old (actual age is 21,6 days)
/aufs/devsave/bootupi18n/puppyrcd_i18n/usr/bin/gettext.sh
/aufs/devsave/dotpup_i18n/usr/bin/gettext.sh
/aufs/pup_ro10/usr/bin/gettext.sh
/usr/bin/gettext.sh
#
Should I better use $HOME/Startup for this?

Someone commented in earlier post that you need to create /var/state before running updatedb.

L18L wrote:
jamesbond wrote:
2. For t12s quick-apps, how would translation be handled if in the future the application is modified (e.g. deletion of existing strings, addition of new strings (how do these ${M_xxx} gets generated), changes of existing strings)? Can mo-manager automatically re-create all these changes? I surely hope I don't have to look at them one by one?

The tricky part is t12s_xgettext which does that what xgettext does:
create a portable object template file for TEXTDOMAIN At least it tries to do so....
Some rules:
1- In one line of script only one ${_M_}
2- No {} inside ${_M_:-No curly bracket here}
3- No line breaks in ${_M_}, use very long lines, activate Document>Line Wrapping in geany
4 - reload translation file before any ${_M_n:-A $variable inside message}

Adding new message: use just: ${_M_:-new message}
t12s_xgettext will insert the ID number which can be
- an existing one if the message already exists in the TEXTDOMAIN
- or otherwise a new one (last highest number + 1)

Deleting a message: it will not appear in actual TEXDOMAIN.pot

Changing a message: Don't do it. Just remove the ID and change th text, e.g.:
Code:
#MESSAGE="${_M_4711:-Fatdog is just a fat dog}"
MESSAGE="${_M_:-Fatdog is my favorite operating system}"


Then the existing translation
(TEXTDOMAIN.po created by t12s_msgunfmt from translation file /usr/share/locales/<language>/TEXTDOMAIN)
is merged with the actual TEXTDOMAIN.pot by gettext tool msgmerge --no-fuzzy.

The translator will see
- the deleted message commented
- and the translation for new message - msgstr - empty
... almost no difference to working with gettext

This sounds good. Where does these t12s tools are, I suppose they are not part of momanager? I can put them into devx if you like.
I have one more question - the POT file created by t12s, is it compatible with POT file created by the real msgformat? (I guess not ...)

I have reviewed package-manager's script, I think the gettext method shouldn't have any impact on performance (and if it does, we can always move the slowness outside of a loop). Before you go on commmitting more time on this, which way do you reckon you want to go - gettext of t12s? Speed-wise I think t12s is faster, but gettext is the "standard" method ... I'm slightly leaning towards gettext for two reasons:
- standard
- the gtk-server uses gettext, so if the script is done by t12s that means there are *two* sets of strings to be translated.
Now, I'm not doing the translation so I'm not sure whether the last statement has any impact at all in the translation part. In anyway, I'll go with the method that you choose, but I'd rather we choose one or the other (not both).

EDIT: Package manager localisation is checked in.

EDIT: I wanted to click the quote button but pressed the Edit button and destroyed this original post. Managed to recover it but the formatting is all gone, so be it.

EDIT: Just want to say that I run some unscientific test with localised package manager, it is 2times slower and unlocalised one. Seems to be "bash" slowness - if I unset LC_MESSAGES then everything runs as fast as before (even with eval_gettext left intact)... have to find other ways to optimise it.

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13

Last edited by jamesbond on Sun 22 Dec 2013, 13:50; edited 2 times in total
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 12 of 13 [195 Posts]   Goto page: Previous 1, 2, 3, ..., 10, 11, 12, 13 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Projects
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.1288s ][ Queries: 12 (0.0072s) ][ GZIP on ]