Re: i18l, gettext and (X)dialog
Am 2006-04-29 14:34:32, schrieb Bas Wijnen:
> On Tue, Apr 25, 2006 at 11:52:14PM +0200, Michelle Konzack wrote:
> > Xdialog --title "sampleprogi" --screen-center --no-cancel --wrap \
> > --backtitle "Here a text which show $FOO BAR" --fixed-font \
> > --textbox $FILE 30 $DLGW
> >
> > this is working fine, but I want the Backtitle i18n.
> > So I have tried:
> >
> > BACKTITLE=`eval_gettext "Here a text which show \$FOO BAR"`
> > Xdialog --title "sampleprogi" --screen-center --no-cancel --wrap \
> > --backtitle "$BACKTITLE" --fixed-font \
> > --textbox $FILE 30 $DLGW
>
> What do you want to achieve? Is the value of the variable already translated,
> or untranslatable? Or should the string be translated including the
> substituted value? In the latter case, you should remove the \ before the $.
The original text is "Here a text which show \$FOO BAR" but I can
do `eval_gettext "Here a text which show \$FOO BAR"` inside the
Dialog options. This is why I have changed the text inside to a
variable and tried to use
BACKTITLE=`eval_gettext "Here a text which show \$FOO BAR"`
but this does not work.
> What string should eval_gettext see as its argument? You need to make sure
> that it gets that.
"Here a text which show \$FOO BAR"
> > Xdialog --title "sampleprogi" --screen-center --no-cancel --wrap \
> > --backtitle "`eval_gettext \"Here a text which show \$FOO BAR\"`" \
> > --fixed-font --textbox $FILE 30 $DLGW
>
> This gives eval_gettext several arguments instead of one, which is very
> unlikely to be what you want. Also, you actually give the quotes to it, which
> also doesn't seem to be what you want.
>
> A good way of debugging this is by using echo instead of eval_gettext. It
> will show you exactly what string is given to it.
If I try
Xdialog --title "sampleprogi" --screen-center --no-cancel --wrap \
--backtitle "`echo \"Here a text which show \$FOO BAR\"`" \
--fixed-font --textbox $FILE 30 $DLGW
it is outputed correctly, but replacing "echo" by "eval_gettext" does
not work.
> I hope this helps,
Unfortunatly not... Oh, I try to internationalize several dozen
(X)dialog frontends to console commands...
Greetings
Michelle Konzack
--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack Apt. 917 ICQ #328449886
50, rue de Soultz MSM LinuxMichi
0033/3/88452356 67100 Strasbourg/France IRC #Debian (irc.icq.com)
Reply to: