Re: How to insert variables within gettext
| From: | Tomas Kuliavas | Date: | Thu, 10 Jan 2008 19:52:54 +0000 |
| Subject: | Re: How to insert variables within gettext | ||
| References: | 1 | Groups: | php.i18n |
| Request: | Send a blank email to php-i18n+get-1140@lists.php.net to get a copy of this message | ||
> 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