Re: TRANSTEXT - Complimentary alternative to gettext
I've done some testing using your "transtext-0.1.tar.gz"
In a test Puppy, I dropped the "gettext" script into the savefolder as "/usr/bin/gettext", effectively replacing the installed "gettext".
Used an "export lng=fr" line at the beginning of the script.
I then ran FrugalPup v40, which calls "gettext":
1) "gettext" failed with syntax error, unexpected "else", so I commented out the following lines:
Code: Select all
# else
# echo -e "$WORK" > /usr/share/locale/transtext/"$lng"/"$HANDLE".transtext
# fi
# unset WORK ALT_WORK ORIGINAL
# rm -f "$track"/"$lng"-options
2) I got errors about a non-existent file or directory "/usr/share/locale/transtext/fr":
So I manually created it.
But the real problem is that the "transtext" function does not create this directory,
while the actual translation code does.
3) I got confused when confronted with French text in the "gettext" dialog,
so I got "transtext" to do nothing, just return "$1".
(My test case is a little odd because I am translating away from my native language.)
4) The resulting FrugalPup screen contained no text, but if I exited FrugalPup and ran it again,
I got the translated screen.
Problem is that after storing a "translation", nothing is echoed back to the calling script.
I added:
Code: Select all
WORK=$(cat /usr/share/locale/transtext/"$lng"/"$HANDLE".transtext)
echo "$WORK"
after the "esac", and it worked as expected.
5) It would probably be easier to use if the check boxes were radio buttons, but yad does not support that.
6) Lots of scripts in Puppy call "gettext", so it became frustrating when they all wanted to be translated.
So I disabled the transtext "gettext" before doing anything else.
PS: I'm working on a "transtext-g", which will be my take on "transtext" for use in the automatic translation of scripts.
Later I still intend to write a utility which translates a ".po" file by simply calling the interactive "transtext" version of "gettext" for each "msgid". It will generate only the ".transtext" files, it will not write a "translated" ".po" file.