Page 2 of 3

Posted: Tue 09 Apr 2013, 17:54
by Karl Godt
I dont know : My simple "./configure" gettext msgfmt compiles maans ascii .po without problems :
bash-3.2# /usr/local/bin/msgfmt screeny.po
bash-3.2#
So Puppy gettext might be compiled with --disable-øl --without-beer --without--aquavit --enable-grumpy --follow-ubuntu --force-utf8 --giveus-herring ??

Posted: Tue 09 Apr 2013, 19:50
by Karl Godt
OK hurtigloopen :

Code: Select all

read -p "/Path/To/The/Program.po : " programpo
echo "$programpo"
[ "$programpo" ] || { echo "Need filename.";exit 1; }
[ -e "$programpo" ] || { echo "'$programpo' does not exist. Not enough beer intus?";exit 1; }
[ -f "$programpo" ] || { echo "'$programpo' is not a regular file. Sorry need more beer"'!';exit 1; }
[ "${programpo##*\.}" = 'po' ] || { echo "'$programpo' is not a .po file. Fill up the fridge maybe?"'!';exit 1; }

echo "Checking '$programpo' for html errors .."

MPDB="<b>.*</b>
<u>.*</u>
<i>.*</i>
"

MPDBNOT=`echo "$MPDB" |tr -d '[[:blank:]]' |tr '\n' '|' |sed 's%^|*%%;s%|*$%%'`


edit_html_func(){
echo -e "\\033[0;39m";
sleep 3s
defaulttexteditor "$programpo"
}


check_html_errors(){
while [ "$RETVAL" != 0 ] ; do
while read P; do
echo "P=$P'"
[ "$P" ] || continue;
RETVAL=0
#P1=`echo "$P" | sed 's%\(.\)%\.\*\1\.\*%g'`; ##doesn't work for me
P1=`echo "$P" | sed 's%\(.\)%\1\.\*%g'`;
echo "P1=$P1'"
echo -e "\\033[1;31m"
grep -n -o "$P1" "$programpo" | grep -v "$P" | grep -vE "$MPDBNOT" && {
edit_html_func
RETVAL=2
break
}
echo -e "\\033[0;39m"
done<<EOI
$(echo "$MPDB")
EOI
[ "$RETVAL" != 2 ] && RETVAL=0
[ "$RETVAL" = 2 ] && continue
RETVAL=0
done
RETVAL=0
}

RETVAL=1
until [ "$RETVAL" = 0 ] ; do
check_html_errors
done

check_msgfmt_compile(){
dirnamepo=`dirname "$programpo"`
basnamepo=`basename "$programpo" .po`
echo -e "\\033[1;31m"
msgfmt --strict -o /tmp/"${basnamepo}.mo" "$programpo"
if [ $? = 0 ] ; then ##alright..
echo -e "\\033[1;32m""Enough liquor intus"'!'"Well done"'!'"\\033[0;39m"
cp --remove-destination /tmp/"${basnamepo}.mo" "$dirnamepo"
RETVAL1=0
else
echo "Urgs... Something went wrongodongo .. Please edit '$programpo'"
edit_html_func
RETVAL1=1
fi
}

RETVAL1=1
until [ "$RETVAL1" = 0 ] ; do
check_msgfmt_compile
done

echo "S0: Session completed. Have a nice day"'!'
exit $RETVAL1

Posted: Tue 09 Apr 2013, 20:27
by maans
Hi Karl & L18L

I appreciate your help very much :D :D

I just needed to know that I should replace the text-content type to UTF-8 to make it work!

I've updated the langpack_da-20130409.pet with a translated Screeny script.

Before I did that - I made a quick remaster where I replaced the initrd file with one that had been translated by lang2initrd (usr/sbin) - and I tried to make it startup with danish as default.

i copied profile, codemap and fontmap from /etc in the remaster process - but I didn't know how to make it choose the right timezone as default....

Would you happen to know what file I should copy/edit to set Europe/Copenhagen as default?

I also need to translate the big puppydialog which starts up after the quicksetup - however I don't know what it is called and therefore I can't find it in the loong list of translatable scripts.

Do you happen to know what it is called?

Last question in this post:
My remaster shows a save-icon on the destop even if it's run in live-mode - and it's not translated - as it wasn't present in the destop-strings file...
1) It shouldn't be there in the first place
2) When there *is* a savefile it should show up - and should be translated to ("gem")...

Sorry if I'm asking too much in one post, however you both seem to be very experienced with Puppy and I guess you can answer these questions without too much effort?! 8) :D

precise_da-5.4.3.iso (ca. 160 Mb) md5sum:

Code: Select all

e6cee2ff89747d577cfdffa653dee24a
md5sum:

Code: Select all

e6cee2ff89747d577cfdffa653dee24a

startup with your language as default.

Posted: Wed 10 Apr 2013, 09:33
by L18L
maans wrote:...startup with danish as default.

i copied profile, codemap and fontmap from /etc in the remaster process - but I didn't know how to make it choose the right timezone as default....

Would you happen to know what file I should copy/edit to set Europe/Copenhagen as default?...
I suggest
/etc/clock
and
/etc/localtime

Posted: Wed 10 Apr 2013, 10:03
by L18L
maans wrote:...I also need to translate the big puppydialog which starts up after the quicksetup - however I don't know what it is called and therefore I can't find it in the loong list of translatable scripts.

Do you happen to know what it is called?...
/usr/sbin/welcome1stboot
... and don't forget to create a danish menu2png
and put it into /usr/share/doc/help/da/

save icon

Posted: Wed 10 Apr 2013, 11:12
by L18L
maans wrote:Last question in this post:
My remaster shows a save-icon on the destop even if it's run in live-mode - and it's not translated - as it wasn't present in the destop-strings file...
1) It shouldn't be there in the first place
2) When there *is* a savefile it should show up - and should be translated to ("gem")...

Sorry if I'm asking too much in one post, however you both seem to be very experienced with Puppy and I guess you can answer these questions without too much effort?! 8) :D

Don't worry.
Karl is very much more experienced than me with scripting and compiling.
And my experience with live-mode is zero.

I only know /etc/rc.d/PUPMODE
My PUPMODE is 12.
I have never seen that icon. :roll:

momanager

Posted: Wed 10 Apr 2013, 16:00
by L18L
please test new momanager
http://murga-linux.com/puppy/viewtopic. ... h&id=66493

Save as /usr/sbin/momanager

Posted: Wed 10 Apr 2013, 17:02
by Karl Godt
The icon is created by /etc/rc.d/rc.sysinit :
############ MISC DESKTOP STUFF ##################
[ .. ]

Code: Select all

#save button on desktop when booted from flash drive...
if [ $PUPMODE -eq 3 -o $PUPMODE -eq 7 -o $PUPMODE -eq 13 ];then #pup_rw is tmpfs.
 if [ "`cat /root/Choices/ROX-Filer/PuppyPin | grep "save2flash"`" = "" ];then
  echo '<icon x="768" y="128" label="save">/usr/sbin/save2flash</icon>' >> /root/Choices/ROX-Filer/PuppyPin
  cat /root/Choices/ROX-Filer/PuppyPin | grep -v '/pinboard' > /tmp/PuppyPin-CPY
  sync
  cp -f /tmp/PuppyPin-CPY /root/Choices/ROX-Filer/PuppyPin
  echo '</pinboard>' >> /root/Choices/ROX-Filer/PuppyPin
 fi
fi
That code alters the PuppyPin file .
Live PUPMODE number is 5 .
I am wondering how it managed to show that way . Maybe you followed the advise of L18L to use a save-file but on USB drive and your PUPMODE was 13 that time .
PUPMODE number 12 is for frugal on normal internal HDD .
That differs in the way /tmp directory is managed :
In 13 /tmp is a mount point with tmpfs filesystem in ram
and in 12 /tmp is a folder inside the save-file.

Remaster is really tricky if it involves /etc folder and /root like it does in these cases .
I remasterd a lot in the end of the year 2010 and a lot because everytime there had been things missing .
So I am not "The Expert" when it comes to remaster but I know some hidden files that should be left out ( ie /etc/.XLOADED ) .

Thats it for now. Had a day off today :)

save icon on desktop

Posted: Wed 10 Apr 2013, 17:09
by L18L
maans wrote:...My remaster shows a save-icon on the destop even if it's run in live-mode - and it's not translated - as it wasn't present in the destop-strings file...
I see it now in your precise_da 8)
as for translation:

try to add it to /usr/share/sss/desk_strings/desk_strings.da
under [_root_Choices_ROX-Filer_PuppyPin]:

s%"save"%"gem"%

Hope that helps

Posted: Fri 12 Apr 2013, 14:28
by maans
Hi Karl
Karl Godt wrote:Maybe you followed the advise of L18L to use a save-file but on USB drive and your PUPMODE was 13 that time .
PUPMODE number 12 is for frugal on normal internal HDD .
That differs in the way /tmp directory is managed :
In 13 /tmp is a mount point with tmpfs filesystem in ram
and in 12 /tmp is a folder inside the save-file.
Exactly what i did!
I'm really impressed that you found a possible reason why this happened!

Thanks a lot :D

Cheers Måns Mårtensson

Re: save icon on desktop

Posted: Fri 12 Apr 2013, 14:32
by maans
Hi L18L
L18L wrote:add it to /usr/share/sss/desk_strings/desk_strings.da
under [_root_Choices_ROX-Filer_PuppyPin]:

s%"save"%"gem"%
Great - I'll do that for the next PET version..
Thanks a lot :-)

Cheers Måns Mårtensson

Posted: Fri 12 Apr 2013, 14:43
by maans
Hi again

Sorry for spamming this thread with questions for (almost) every script I attempt to translate, however I keep running into trouble.

This time it's the shutdownconfig which is the problem.
If it's not too much of a hazzle could you please look into the translation and maybe pinpoint the error(s).... (I think (hope) it's a new type this time...) :

Cheers Måns Mårtensson

Posted: Fri 12 Apr 2013, 14:55
by maans
Hi again

I installed L18L's momanager hack:

official (momanager) language packs

It seems that it now will compile a mo file from my script...?!

No error messages..

GREAT - (just have to check if it works in the shutdown process - I guess it does..

THANKS A LOT L18L !!!!!

Cheers Måns Mårtensson

Re: momanager

Posted: Fri 12 Apr 2013, 15:10
by maans
Hi L18L
L18L wrote:please test new momanager
http://murga-linux.com/puppy/viewtopic. ... h&id=66493

Save as /usr/sbin/momanager
Sorry didn't see this post untill now - however I saw your contribution and it seems that it solves some of the compiling problems all by it self...

THANKS A LOT :-)

Great to be called a puppian btw - makes me feel welcome. (and "barking up the right tree" - for once) thanks - and woof woof :D

Cheers Måns Mårtensson

Posted: Fri 12 Apr 2013, 15:12
by Karl Godt
Dette gør ikke null, Måns ! That does'nt matter , Maans !

If You use geany text editor, it seems that to go to
Document > Set Encoding > Unicode > Unicode UTF-8 makes these resembling error messages
sh-3.00# msgfmt shutdownconfig.po
shutdownconfig.po:22:10: invalid multibyte sequence
..
shutdownconfig.po:69:31: invalid multibyte sequence
msgfmt: too many errors, aborting
go away .

Now there is still a tiny thing left :
sh-3.00# msgfmt shutdownconfig-utf8.po
shutdownconfig-utf8.po:454: end-of-line within string
msgfmt: found 1 fatal error

which is missing a ' " ' double quote at the end of line 453 :
old.po wrote:msgid ""
"You can now choose to save the personal session files to a file, named '${DISTRO_FILE_PREFIX}save.2fs'. Your choice will be remembered at next bootup.\n"
"\n"
"NOTE: You cannot choose to save the session to the entire partition ${xPDEV}, as Puppy is installed into a sub-directory '${xPSUBDIR}'. If Puppy had been installed at '/', not in a folder, then you would have the option of saving the session to the entire partition (assuming that the partition does not have any other distro installed in it) which has the advantage of all the free space in the partition available for your session files."
msgstr ""
"Du kan nu vælge at gemme de personlige session-filer til en fil, der hedder '${DISTRO_FILE_PREFIX}save.2fs'. Dit valg vil blive husket ved næste opstart. \n
"\n"
"BEMÆRK:. Du kan ikke vælge at gemme sessionen til hele partitionen $ {xPDEV}, da Puppy er installeret i en under-mappe '${xPSUBDIR}'. Hvis Puppy var blevet installeret i '/' og ikke i en mappe, så ville du have mulighed for at gemme sessionen til hele partition (forudsat, at partitionen ikke har en anden distro installeret på sig), som får udbytte af al den ledige plads på partitionen til dine sessionsfiler. "
newer.po wrote:msgid ""
"You can now choose to save the personal session files to a file, named '${DISTRO_FILE_PREFIX}save.2fs'. Your choice will be remembered at next bootup.\n"
"\n"
"NOTE: You cannot choose to save the session to the entire partition ${xPDEV}, as Puppy is installed into a sub-directory '${xPSUBDIR}'. If Puppy had been installed at '/', not in a folder, then you would have the option of saving the session to the entire partition (assuming that the partition does not have any other distro installed in it) which has the advantage of all the free space in the partition available for your session files."
msgstr ""
"Du kan nu vælge at gemme de personlige session-filer til en fil, der hedder '${DISTRO_FILE_PREFIX}save.2fs'. Dit valg vil blive husket ved næste opstart. \n"
"\n"
"BEMÆRK: Du kan ikke vælge at gemme sessionen til hele partitionen $ {xPDEV}, da Puppy er installeret i en under-mappe '${xPSUBDIR}'. Hvis Puppy var blevet installeret i '/' og ikke i en mappe, så ville du have mulighed for at gemme sessionen til hele partition (forudsat, at partitionen ikke har en anden distro installeret på sig), som får udbytte af al den ledige plads på partitionen til dine sessionsfiler."

Danish language pack

Posted: Fri 12 Apr 2013, 15:38
by L18L
maans wrote:...Sorry for spamming this thread with questions for (almost) every script I attempt to translate, however I keep running into trouble...
Dette gør ikke null, Måns !

These questions and hopefully the answers may help
- other translators
- the writer of momanager for dummies
- further development

All open questions have been answered now, thank you Karl :D

Posted: Fri 12 Apr 2013, 15:53
by Karl Godt
Yup always these tipsies :D And the posts that show up while you still copy and paste from geany to the browser :lol:

Posted: Mon 15 Apr 2013, 11:42
by maans
Dear L18L & Karl Godt

Thank you for all your help :D :D :D

Latest Danish languagepack (Seneste sprogpakke): langpack_da-20130415.pet
MD5:

Code: Select all

4470a70ef91354bdd4e471b35567497d
Featuring danish translations of:
notecase*
osmo*
Rox-filer
1stboot
shutdownconfig
AbiWord
GnuCalc
Inkscape Light
All categories, menus, submenus, all standard desktop files + some addtional ones..
etc etc etc.

This is how far I could take it this time... If you want to participate/contribute or report bugs/bad language - please do so via: humamamm at gmail dot com.

Cheers Måns Mårtensson

*Thanks to L18L :D

Danish language pack

Posted: Mon 15 Apr 2013, 17:28
by L18L
well done :)
here is a small contribution I have found on the web...
and let momanager built the tgz file.

Posted: Mon 15 Apr 2013, 20:30
by maans
Hi L18L

Thanks a LOT :D :D

I've updated the package above with your files and cleaned the languagepack from files that aren't translated yet - help-htmls etc... and a couple of dirs that were in the former compilation - I don't know why - eg. jre 1.7.1

Cheers Måns Mårtensson