[dev] Horde Metar Block

Jan Schneider jan at horde.org
Sat Dec 13 01:48:15 PST 2003


Zitat von Rick Emery <rick at emery.homelinux.net>:

> Quoting Jan Schneider <jan at horde.org>:
>
> > Zitat von Chuck Hagenbuch <chuck at horde.org>:
> >
> > > Quoting Joel Vandal <jvandal at infoteck.qc.ca>:
> > >
> > > > $html .= '<br /><b>' . _('Heading:') . '</b> ' .sprintf(_("%s
> inches"),
> > > $v);
> > >
> > > That looks like the better option of the lot, BUT: never use single
> > > quotes with
> > > gettext strings. They won't be picked up.
> >
> > Correct, but only because this is not a whole sentence. If it was,
> markup
> > would be acceptable inside the string.
>
> I'm not following this. Do you mean that the following is OK?
>
> $html .= sprintf(_("<br /><b>Heading:</b> %s inches"), $v);

No, only if it was sprintf(_("The <b>heading</b> is at %s inches"), $v). See
the difference? In your case you can separate "Heading:" and "%s inches"
because only the words order in sentences might change but not in tabular
data.

> For that matter, is the sprintf necessary? Could I say:
>
> $html .= _("<br /><b>Heading:</b> $v inches");

No, this wouldn't work, you *have to* use placeholders (%s, %d etc).

Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft


More information about the dev mailing list