On 10/28/2010 12:24 PM, Matt Read wrote:

     _t(''moved %s blocks to %s.');

I beat you thought the first placeholder was the number of blocks,
didn't you? :P

No, because it's a %s instead of a %d. But I did think it caused an error as written.

Also note that you don't need to use sprintf() with _t() anymore.

You can specify the substitutions as an array in the second parameter:

_t('moved %s blocks to %s', array('red', 'trash'));

This is still compatible with the module specifier as long as you pass the substitutions as an array:

_t('moved %s blocks to %s', array('red', 'trash'), 'mymodule');

Note that you *must* specify the substitutions as an array, even if there is only one:

_t('moved %d blocks', array(4)); // Correct
_t('moved %d blocks', 4); // Causes cancer in rats

Owen

--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/habari-dev

Reply via email to