php-i18n Digest 10 Jan 2008 19:52:57 -0000 Issue 377
Topics (messages 1139 through 1140):
How to insert variables within gettext
1139 by: Prabath Kumarasinghe
1140 by: Tomas Kuliavas
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Hi All
I would like to know how add variable within gettext and translate it correctly
Best Regards
Prabath
--- End Message ---
--- Begin 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
--- End Message ---