Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I found the same question on StackOverflowStackOverflow. Try this out:

One argument, in one place:

Mage::helper('module')->__('Hi %s, there is an error', $name);

Two arguments, in two places:

Mage::helper('module')->__('Hi %s, there is an error with code %s', $name, $code);

One argument, in two places:

Mage::helper('module')->__('Hi %1$s, there is an error. Your name is %1$s', $name);

Two arguments, swapping places:

// Template or block file
Mage::helper('module')->__('Hi %1$s %2$s, there is an error', $firstname, $lastname);

// CSV translation
"Hi %1$s %2$s, there is an error", "%2$s, %1$s received an error"

I found the same question on StackOverflow. Try this out:

One argument, in one place:

Mage::helper('module')->__('Hi %s, there is an error', $name);

Two arguments, in two places:

Mage::helper('module')->__('Hi %s, there is an error with code %s', $name, $code);

One argument, in two places:

Mage::helper('module')->__('Hi %1$s, there is an error. Your name is %1$s', $name);

Two arguments, swapping places:

// Template or block file
Mage::helper('module')->__('Hi %1$s %2$s, there is an error', $firstname, $lastname);

// CSV translation
"Hi %1$s %2$s, there is an error", "%2$s, %1$s received an error"

I found the same question on StackOverflow. Try this out:

One argument, in one place:

Mage::helper('module')->__('Hi %s, there is an error', $name);

Two arguments, in two places:

Mage::helper('module')->__('Hi %s, there is an error with code %s', $name, $code);

One argument, in two places:

Mage::helper('module')->__('Hi %1$s, there is an error. Your name is %1$s', $name);

Two arguments, swapping places:

// Template or block file
Mage::helper('module')->__('Hi %1$s %2$s, there is an error', $firstname, $lastname);

// CSV translation
"Hi %1$s %2$s, there is an error", "%2$s, %1$s received an error"
Source Link

I found the same question on StackOverflow. Try this out:

One argument, in one place:

Mage::helper('module')->__('Hi %s, there is an error', $name);

Two arguments, in two places:

Mage::helper('module')->__('Hi %s, there is an error with code %s', $name, $code);

One argument, in two places:

Mage::helper('module')->__('Hi %1$s, there is an error. Your name is %1$s', $name);

Two arguments, swapping places:

// Template or block file
Mage::helper('module')->__('Hi %1$s %2$s, there is an error', $firstname, $lastname);

// CSV translation
"Hi %1$s %2$s, there is an error", "%2$s, %1$s received an error"