Gettext question...

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
ITSMERSH

Gettext question...

#1 Post by ITSMERSH »

Hi.

I have this on top of the script:
QTRSUITEVERSION="18.06.17"
MYTITLE="QTR Suite $QTRSUITEVERSION"

# Gettext, multiple Variables in Message
[ "`which gettext.sh`" != "" ] && . gettext.sh

# Gettext localization
export TEXTDOMAIN="QTR-Suite"
export OUTPUT_CHARSET=UTF-8

# Install DE locale
LOCALS="$APPDIR"/gettext-locales/de/LC_MESSAGES/"QTR-Suite".mo
[ -f "$LOCALS" ] && cp -a -u "$LOCALS" /usr/share/locale/de/LC_MESSAGES/"QTR-Suite".mo
And this in the Menu:
<menuitem label="'$(gettext "Archiving $MYTITLE RoxApp")'" icon="qtrsuite" accel-key="'$skey'" accel-mods="'$strgshiftkey'" tooltip-markup="'$(gettext " Archiving $MYTITLE RoxApp to save all Data, Songs and Mixdowns in a .tar.gz Archive.")'">
<action>'$APPDIR'/AppRun -MakeArchive &</action>
<action>SaveWindowGeometry "'$WINGEOCONFIG'"</action>
</menuitem>
And then I got this in the .po file:
msgid "Archiving %s RoxApp"
msgstr "%s RoxApp archivieren"
Though, when starting the program, gettext doesn't translate

Archiving QTR Suite 18.06.17 RoxApp

to

QTR Suite 18.06.17 RoxApp archivieren

So, what am I doing wrong here?

Thanks in advance...

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#2 Post by don570 »

Solution is eval_gettext

Try the examples on this page
http://www.murga-linux.com/puppy/viewtopic.php?t=96326
__________________________________________________________

ITSMERSH

#3 Post by ITSMERSH »

No, didn't get this to work. :cry:

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

example of eval_gettext

#4 Post by don570 »

I researched eval_gettext ....
It works well but I found that it needs strong quotes for momanager
to work . Here is the example I provided in attachment...
Read it and test in momanager.

Code: Select all

`eval_gettext 'Bacon Recorder $VERSION'`
If I had used weak quotes the script would appear to work in terminal but momanager wouldn't make a po file.

If you still have problems then you should post the script here and
someone can do the gettext conversion for you.
_______________________________________________
Attachments
example-eval-gettext.tar.gz
example of eval_gettext
(1016 Bytes) Downloaded 86 times

ITSMERSH

#5 Post by ITSMERSH »

Thanks.

I will try this.

Yes, I think I used weak quotes...

Post Reply