Author |
Message |
L18L
Joined: 19 Jun 2010 Posts: 3431 Location: www.eussenheim.de/
|
Posted: Sat 04 Aug 2012, 14:24 Post subject:
pfind Subject description: alpha |
|
Please test version 5.02
NLS has German (of course) and Russian (converted from old system)
So you can change between de, ru and English
Next I will try to convert the other languages.......
Description |
|
Filesize |
7.97 KB |
Viewed |
759 Time(s) |

|
Description |
Russian (to be completed) and German
|

Download |
Filename |
pfind-NLS.pet |
Filesize |
8.45 KB |
Downloaded |
526 Time(s) |
Description |
|

Download |
Filename |
pfind-5.02.pet |
Filesize |
18.72 KB |
Downloaded |
545 Time(s) |
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3431 Location: www.eussenheim.de/
|
Posted: Sat 04 Aug 2012, 14:35 Post subject:
Re: Gettext in pBurn. Subject description: Not tested well. |
|
rodin.s wrote: | ...I haven't change set-language section of pburn script so translation only works if I choose or type in 'ru' language in Preferences.... |
Hope you understand my solution in pfind ( used it in ymount some time ago ) Search for LANGUAGE NEW_LANGUAGE and LANGUAGES
Sorry I cannot help very much with testing because I do NOT have CD burner
|
Back to top
|
|
 |
shinobar

Joined: 28 May 2009 Posts: 2664 Location: Japan
|
Posted: Sun 05 Aug 2012, 07:05 Post subject:
zigbert2gettext-0.1 |
|
zigbert wrote: | Gettext has the advantage of making the code more readable (also for me ). That is a good thing for the community. Converting the locales-file would sure be good for backward compatibility, but for moving the project further, I think updating the code itself is the way to go. |
OK, the first trial to place gettext inline the code.
But for multiple lines, i think we are better to stay the substitution method, that is:
Code: | export LOCXXX=$(gettext "First line
Second lne")
export DIALOG="<text><input>echo -n \"\$LOCXXX\"</inout></text>" |
Extract the attached, add executable, place it at /root/my-applications/bin.
# zigbert2gettext --help
zigbert2gettext 0.1
Convert zigbert apps into gettext version.
usage: zigbert2gettext [PATH_TO_MAIN_SCRIPT] [TEXT_DOMAIN]
PATH_TO_MAIN_SCRIPT - example: /usr/local/pburn/pburn
But still you need to remove manually some code, loading the locales file, from the converted main script.
Description |
Unzip, add executable, place at /root/my-applications/bin.
|

Download |
Filename |
zigbert2gettext.gz |
Filesize |
2.3 KB |
Downloaded |
564 Time(s) |
_________________ Downloads for Puppy Linux http://shino.pos.to/linux/downloads.html
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Sun 05 Aug 2012, 07:18 Post subject:
|
|
Hi guys
I am a bit out of time for Puppy right now.
I will try to catch up within a few days.
Thank you all for your effort to push Puppy forward.
Sigmund
_________________ Stardust resources
|
Back to top
|
|
 |
rodin.s
Joined: 22 Sep 2010 Posts: 340 Location: Ukraine
|
Posted: Sun 05 Aug 2012, 09:42 Post subject:
pBurn updated |
|
I did some tests on pBurn. Tried to burn CD-R. Seems OK. I have also completed translation of mo-file: just have copied lines from old locale file in Poedit with some modifications.
I have also made some changes to previous pet: commented out set-locale this time.
I changed some translation lines for example:
Blank Disc - To blank the disc
and
Blank Disc - The disc is blank
have different translation so I have added whitespace to 'Blank Disc ' in func.
Same with 'Burn ISO-image' button in GUI: to burn and the burn have different translations.
Description |
Updated pBurn
|

Download |
Filename |
pburn_gtxt2-3.7.3.pet |
Filesize |
71.7 KB |
Downloaded |
482 Time(s) |
Description |
Full Russian translation this time.
|

Download |
Filename |
MoManager-ru_UA-pburn-3.7.3.tar.gz |
Filesize |
14.14 KB |
Downloaded |
478 Time(s) |
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3431 Location: www.eussenheim.de/
|
Posted: Sun 05 Aug 2012, 14:11 Post subject:
ptiming Subject description: simple things first |
|
L18L wrote: | ...Next I will try to convert the other languages....... |
done
using shinobar's locale2gettext in
Code: | #!/bin/sh
#
# convert translation file "Zigbert" to "Gettext"
# convert /usr/local/app/locals/LANG to /usr/share/locale/language/app.mo
# which then can be checked/modified using momanager
# 20120805 by L18L
apps="`find /usr/local -name locals | cut -d'/' -f4`" # pburn pfind pfilesearch ...
apps="ptiming" # no, just pvd for now
for app in $apps; do
[ "$app" = "pfind" ] && continue
[ "$app" = "pfilesearch" ] && continue
SOURCE=/usr/local/$app/locales
[ -f "$SOURCE" ] || SOURCE=/usr/local/$app/locals/en_US:english
[ -f "$SOURCE" ] || continue # nothing to translate here
echo " converting /usr/local/$app ..."
# locale2gettext usage: $APPNAME [PATH_TO_LOCALE_FILE] [TEXT_DOMAIN]"
[ -f "$SOURCE.converted" ] || locale2gettext $SOURCE
# $SOURCE.converted has LOCxxx=$(gettext "bla bla")
langs=`ls /usr/local/$app/locals | cut -d'_' -f1 | sort -u`
for lang in $langs; do # for each language
[ "$lang" = "en" ] && continue
echo " from /usr/local/$app/locals/$lang ..."
# input
TEMPLfile=$SOURCE.converted
# we know just ru and must say ru_RU
LOCfile=`ls /usr/local/$app/locals/$lang* | head -n1`
# output
LOCfilePO=$LOCfile.po
echo '#, fuzzy
msgid ""
msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
' > $LOCfilePO
while read LINE ; do
case $LINE in
\#*) continue # skip comments
;;
*) [ -z "$LINE" ] && continue # skip blank lines
[ "`echo $LINE | grep '^export TEXTDOMAIN='`" ] && continue # skip
[ "`echo $LINE | grep '^export OUTPUT_CHARSET='`" ] && continue # skip
[ "`echo $LINE | grep '^set'`" ] && continue # skip
[ "${LINE:0:7}" = "export " ] && LINE="${LINE//export }" # delete 'export '
LINEid=`echo $LINE | cut -d '=' -f1`
msgid=`echo $LINE | cut -d '"' -f2`
msgstr=`grep $LINEid $LOCfile | cut -d '"' -f2 | head -n1`
[ "`grep $LINEid $LOCfilePO`" ] && continue # avoid douplicates
#echo "# $LINEid"
#echo "msgid \"$msgid\""
echo "msgstr \"$msgstr\""
#echo ""
echo "# $LINEid" >> $LOCfilePO
echo "msgid \"$msgid\"" >> $LOCfilePO
echo "msgstr \"$msgstr\"" >> $LOCfilePO
echo "" >> $LOCfilePO
;;
esac
done < $TEMPLfile
# create mo file and delete po file
if [ "`msgfmt -o /usr/share/locale/$lang/LC_MESSAGES/$app.mo $LOCfilePO`" ]; then
echo could not create /usr/share/locale/$lang/LC_MESSAGES/$app.mo
else
rm $LOCfilePO
echo /usr/share/locale/$lang/LC_MESSAGES/$app.mo created
fi
echo ''
done # lang
echo " ... $app converted"
rm $SOURCE.converted
done # app
echo "finished
You can edit the translations using momanager
"
exit 0 |
And in the created /usr/local/ptiming-converted just change this:
Code: | ##set language
#. $APPDIR/locals/en_US:english #always run to fill gaps in translation
#LANGUAGE="`ls -1 $APPDIR/locals/ | grep ${LANG%.*}`"
##fallback to macrolanguage if available (ISO 639-1 two letter code: en, es, fr, etc.)
#if [ -z $LANGUAGE ]; then LANGUAGE="`ls -1 $APPDIR/locals/ | grep ${LANG%_*}:`"; fi
#[ "$LANGUAGE" != "en_US:english" ] && . $APPDIR/locals/$LANGUAGE 2> /dev/null
# |
Description |
|
Filesize |
30.03 KB |
Viewed |
690 Time(s) |

|
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Fri 10 Aug 2012, 02:28 Post subject:
|
|
Pburn is updated with gettext - thanks a lot.
I have some time today - let's see what I get done..... will be back after the weekend
Sigmund
_________________ Stardust resources
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3431 Location: www.eussenheim.de/
|
Posted: Fri 10 Aug 2012, 06:54 Post subject:
pburn Subject description: version |
|
zigbert wrote: | Pburn is updated with gettext |
downloaded version 3.7.4 shows as 3.7.3
Anyhow, I have converted all languages to pburn.mo using rodin.s `s version above.
So everyone will have to start not from zero
---
edit
going to test version now
Description |
some locals converted to pburn.mo
|

Download |
Filename |
pburn_NLS.pet |
Filesize |
48.96 KB |
Downloaded |
525 Time(s) |
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Fri 10 Aug 2012, 07:09 Post subject:
Re: pfind Subject description: alpha |
|
L18L wrote: | Please test version 5.02 |
$TEXTDOMAIN=pfilesearch in your pFind. I guess it's because there only can be one text domain, and code from pFilesearch is embedded into pFind.
That means NLS files for pFilesearch will contain gettext-strings for both pFind and pFilesearch? Not the best solution for those who uses only pFilesearch as a backend for pBurn/pMusic.... My intention is to separate the backend and frontend.
What is the downside of having an unique $TEXTDOMAIN=pfind?
Sigmund
_________________ Stardust resources
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3431 Location: www.eussenheim.de/
|
Posted: Fri 10 Aug 2012, 07:48 Post subject:
Re: pfind Subject description: alpha -> beta |
|
zigbert wrote: | $TEXTDOMAIN=pfilesearch in your pFind. I guess it's because there only can be one text domain, and code from pFilesearch is embedded into pFind. |
Good guess!
That was before Barry changed momanager.
Now everything is possible:
I will separate them and make a version 5.03
TEXTDOMAIN=pfind
and pfilesearch using TEXTDOMAIN=pfilesearch containing the messages from pfilesearch only.
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Fri 10 Aug 2012, 08:11 Post subject:
Re: pfind Subject description: alpha -> beta |
|
L18L wrote: | zigbert wrote: | $TEXTDOMAIN=pfilesearch in your pFind. I guess it's because there only can be one text domain, and code from pFilesearch is embedded into pFind. |
Good guess!
That was before Barry changed momanager.
Now everything is possible:
I will separate them and make a version 5.03
TEXTDOMAIN=pfind
and pfilesearch using TEXTDOMAIN=pfilesearch containing the messages from pfilesearch only. | Thank you.
I will be back Tuesday (probably).
Sigmund
_________________ Stardust resources
|
Back to top
|
|
 |
L18L
Joined: 19 Jun 2010 Posts: 3431 Location: www.eussenheim.de/
|
Posted: Fri 10 Aug 2012, 10:06 Post subject:
Re: pfind Subject description: beta |
|
L18L wrote: | I will separate them and make a version 5.03
TEXTDOMAIN=pfind |
done
included is german pfind.mo so you can test changinging of GUI language
for testers only, delete /root/.pfind/pfindrc
a lot of warnings like:
/usr/local/pfind/func: line 4: /tmp/pfind-TREE6413: Datei oder Verzeichnis nicht gefunden <-- not found
cat: /tmp/pfind-treeitems6413: Datei oder Verzeichnis nicht gefunden <-- not found
Description |
TEXTDOMAIN=pfind was pfilesearch before
|

Download |
Filename |
pfind-5.03.pet |
Filesize |
23.33 KB |
Downloaded |
469 Time(s) |
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Mon 13 Aug 2012, 05:23 Post subject:
|
|
Ok, updated stuff
Thank you guys
Sigmund
_________________ Stardust resources
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Sat 18 Aug 2012, 04:18 Post subject:
|
|
I have started on the next cycle of pMusic, and will add gettext to it
_________________ Stardust resources
|
Back to top
|
|
 |
rodin.s
Joined: 22 Sep 2010 Posts: 340 Location: Ukraine
|
Posted: Sun 26 Aug 2012, 15:51 Post subject:
pburn |
|
Pburn doesn't switch to Russian automatically. But it does when 'ru' is selected in Preferences. Usually gettext doesn't need this manual language switching. The language of an application is defined by global locale settings of the system.
|
Back to top
|
|
 |
|