Skip to main content
Improved quality of the answer. Explained that you should instead create a local copy of the file and edit it.
Source Link

As the other answer already stated, this is probably caused by too few arguments in a call to a translator method.

You have more %d or %s placeholders in the translations string then arguments passed additional to the string.

You could edit yourshould create a copy of app/code/core/Mage/Core/Model/Translate.php filein app/code/local/Mage/Core/Model/Translate.php and add a temporary debug call there in the translate() method just above the vsprintf($translated, $args) call.

You could add something like this:

if (substr_count($translated, '%') != count($args)) {
    Mage::log(
        __METHOD__ . '() possible argument count mismatch! '
        . 'Backtrace: ' . mageDebugBacktrace(true, false, true)
    );
}

Logs will be written to var/log/system.log when logging is enabled (and the log file is still the default system.log).

It's a simple check, so it would also appear when you have a translate string containing an escaped percentage character, like "You get 5%% discount!"

PleaseYou should not edit the core file directly, but if you do then please do not forget to revert this core file to it's original state afterwards! Or else Ben Marks will be mad!

As the other answer already stated, this is probably caused by too few arguments in a call to a translator method.

You have more %d or %s placeholders in the translations string then arguments passed additional to the string.

You could edit your app/code/core/Mage/Core/Model/Translate.php file and add a temporary debug call there in the translate() method just above the vsprintf($translated, $args) call.

You could add something like this:

if (substr_count($translated, '%') != count($args)) {
    Mage::log(
        __METHOD__ . '() possible argument count mismatch! '
        . 'Backtrace: ' . mageDebugBacktrace(true, false, true)
    );
}

Logs will be written to var/log/system.log when logging is enabled (and the log file is still the default system.log).

It's a simple check, so it would also appear when you have a translate string containing an escaped percentage character, like "You get 5%% discount!"

Please do not forget to revert this core file to it's original state afterwards! Or else Ben Marks will be mad!

As the other answer already stated, this is probably caused by too few arguments in a call to a translator method.

You have more %d or %s placeholders in the translations string then arguments passed additional to the string.

You should create a copy of app/code/core/Mage/Core/Model/Translate.php in app/code/local/Mage/Core/Model/Translate.php and add a temporary debug call there in the translate() method just above the vsprintf($translated, $args) call.

You could add something like this:

if (substr_count($translated, '%') != count($args)) {
    Mage::log(
        __METHOD__ . '() possible argument count mismatch! '
        . 'Backtrace: ' . mageDebugBacktrace(true, false, true)
    );
}

Logs will be written to var/log/system.log when logging is enabled (and the log file is still the default system.log).

It's a simple check, so it would also appear when you have a translate string containing an escaped percentage character, like "You get 5%% discount!"

You should not edit the core file directly, but if you do then please do not forget to revert this core file to it's original state afterwards! Or else Ben Marks will be mad!

added 29 characters in body
Source Link
7ochem
  • 7.6k
  • 14
  • 52
  • 80

As the other answer already stated, this is probably caused by too few arguments in a call to a translator method.

You have more %d or %s placeholders in the translations string then arguments passed additional to the string.

You could edit your app/code/core/Mage/Core/Model/Translate.php file and add a temporary debug call there in the translate() method just above the vsprintf($translated, $args) call.

You could add something like this:

if (substr_count($translated, '%') != count($args)) {
    Mage::log(
        __METHOD__ . '() possible argument count mismatch! '
        . 'Backtrace: ' . mageDebugBacktrace(true, false, true)
    );
}

Logs will be written to var/log/system.log when logging is enabled (and the log file is still the default system.log).

It's a simple check, so it would also appear when you have a translate string containing an escaped percentage character, like "You get 5%% discount!"

Please do not forget to revert this core file to it's original state afterwards! Or else Ben Marks will be madBen Marks will be mad!

As the other answer already stated, this is probably caused by too few arguments in a call to a translator method.

You have more %d or %s placeholders in the translations string then arguments passed additional to the string.

You could edit your app/code/core/Mage/Core/Model/Translate.php file and add a temporary debug call there in the translate() method just above the vsprintf($translated, $args) call.

You could add something like this:

if (substr_count($translated, '%') != count($args)) {
    Mage::log(
        __METHOD__ . '() possible argument count mismatch! '
        . 'Backtrace: ' . mageDebugBacktrace(true, false, true)
    );
}

Logs will be written to var/log/system.log when logging is enabled (and the log file is still the default system.log).

It's a simple check, so it would also appear when you have a translate string containing an escaped percentage character, like "You get 5%% discount!"

Please do not forget to revert this core file to it's original state afterwards! Or else Ben Marks will be mad!

As the other answer already stated, this is probably caused by too few arguments in a call to a translator method.

You have more %d or %s placeholders in the translations string then arguments passed additional to the string.

You could edit your app/code/core/Mage/Core/Model/Translate.php file and add a temporary debug call there in the translate() method just above the vsprintf($translated, $args) call.

You could add something like this:

if (substr_count($translated, '%') != count($args)) {
    Mage::log(
        __METHOD__ . '() possible argument count mismatch! '
        . 'Backtrace: ' . mageDebugBacktrace(true, false, true)
    );
}

Logs will be written to var/log/system.log when logging is enabled (and the log file is still the default system.log).

It's a simple check, so it would also appear when you have a translate string containing an escaped percentage character, like "You get 5%% discount!"

Please do not forget to revert this core file to it's original state afterwards! Or else Ben Marks will be mad!

added 31 characters in body
Source Link
7ochem
  • 7.6k
  • 14
  • 52
  • 80

As the other answer already stated, this is probably caused by too few arguments in a call to a translator method.

You have more %d or %s placeholders in the translations string then arguments passed additional to the string.

You could edit your app/code/core/Mage/Core/Model/Translate.php file and add a temporary debug call there in the translate() method just above the vsprintf($translated, $args) call.

You could add something like this:

if (substr_count($translated, '%') != count($args)) {
    Mage::log(
        __METHOD__ . '() possible argument count mismatch! '
        . 'Backtrace: ' . mageDebugBacktrace(true, false, true)
    );
}

Logs will be written to var/log/system.log when logging is enabled (and the log file is still the default system.log).

It's a simple check, so it would also appear when you have a translate string containing an escaped percentage character, like "You get 5%% discount!"

Please do not forget to revert this core file to it's original state afterwards! Or else Ben Marks will be mad!

As the other answer already stated, this is probably caused by too few arguments in a call to a translator method.

You have more %d or %s placeholders in the translations string then arguments passed additional to the string.

You could edit your app/code/core/Mage/Core/Model/Translate.php file and add a temporary debug call there in the translate() method just above the vsprintf($translated, $args) call.

You could add something like this:

if (substr_count($translated, '%') != count($args)) {
    Mage::log(
        __METHOD__ . '() possible argument count mismatch! '
        . 'Backtrace: ' . mageDebugBacktrace(true, false, true)
    );
}

Logs will be written to var/log/system.log when logging is enabled (and the log file is still the default system.log).

It's a simple check, so it would also appear when you have a translate string containing an escaped percentage character, like "You get 5%% discount!"

Please do not forget to revert this core file to it's original state afterwards!

As the other answer already stated, this is probably caused by too few arguments in a call to a translator method.

You have more %d or %s placeholders in the translations string then arguments passed additional to the string.

You could edit your app/code/core/Mage/Core/Model/Translate.php file and add a temporary debug call there in the translate() method just above the vsprintf($translated, $args) call.

You could add something like this:

if (substr_count($translated, '%') != count($args)) {
    Mage::log(
        __METHOD__ . '() possible argument count mismatch! '
        . 'Backtrace: ' . mageDebugBacktrace(true, false, true)
    );
}

Logs will be written to var/log/system.log when logging is enabled (and the log file is still the default system.log).

It's a simple check, so it would also appear when you have a translate string containing an escaped percentage character, like "You get 5%% discount!"

Please do not forget to revert this core file to it's original state afterwards! Or else Ben Marks will be mad!

added 126 characters in body
Source Link
7ochem
  • 7.6k
  • 14
  • 52
  • 80
Loading
Source Link
7ochem
  • 7.6k
  • 14
  • 52
  • 80
Loading