Re: How to insert variables within gettext

[email protected] (Tomas Kuliavas) Thu, 10 Jan 2008 21:52:54 +0200
Newsgroups php.i18n
Message-ID <[email protected]>
> I would like to know how add variable within gettext and translate it correctly

// i18n: %s is some variable
echo sprintf(_("%s test"),$variable);

// i18n: %d sets number of squirrels
echo sprintf(ngettext("%d squirrel on the tree.","%d squirrels on the
tree.",abs($i)),$i);

-- 
Tomas