[dev] Horde Metar Block

Chuck Hagenbuch chuck at horde.org
Sat Dec 13 06:41:11 PST 2003


Quoting Rick Emery <rick at emery.homelinux.net>:

> > > $html .= _("<br /><b>Heading:</b> $v inches");
> >
> > No, this wouldn't work, you *have to* use placeholders (%s, %d etc).
>
> I don't understand this; if I don't use sprintf() or printf(), I'm not sure
> why I'd need placeholders. But I don't need to understand it, as long as the
> code is acceptable :-).

Because with _("Foo $var bar"), what gets passed to the gettext function isn't
'Foo $var bar' - it's 'Foo whatever the value of $var is at the time bar'. So
the gettext dictionary would have to have a seperate translation for every
possible value of $var.

-chuck

--
Charles Hagenbuch, <chuck at horde.org>
"I'm really... I'm not too fascinated by green food." - Average Joe


More information about the dev mailing list