Re: How to insert variables within gettext

Tomas Kuliavas <[email protected]> Thu, 10 Jan 2008 21:52:54 +0200
Newsgroups gmane.comp.php.internationalization
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

-- 
PHP Unicode & I18N Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php