Quick heads up if you’re using Magento 2’s __
function to translate strings in your extensions. Magento 1’s translation functions allowed you to use sprintf style replacement tokens.
Mage::helper('module')->__('Hello %s', $string);
$this->__('Hello %s', $string);
Magento two opts to use a globally accesible __
function.
$translate_string = __('Hello World');
This new function is not sprintf
compatible. It does support replacement tokens, but those tokens are numerical based instead of type based.
$translate_string = __('Hello %1, how are %2', $string, $foo);
Substitute your own treaties on the appropriateness of sprintf
existing in a language that allows you to concatenate any two things together and get a string out the other side automatically.