All views created by cake bake which call 'format' => __() return the following error:
vsprintf(): Too few arguments [CORE/Cake/basics.php, line 565]
I looked at basics.php, line 565. It is part of the function __(). The code documentation states that the purpose of this function is to "Returns a translated string if one is found; Otherwise, the submitted message."
The line in question is:
return vsprintf($translated, $args);
I looked up vsprintf in the php docs. vsprintf accepts 2 arguments. The first being the format, and the next being an array of values. ' The function call in the view is:
'format' => __('Some Text',true);
I debugged $translated and $args.
I get $translated = 'Some Text'
and $args = array((int)0=>true)
.
From what I see cakephp is passing the correct number of arguments to vsprintf.
How can I fix this error, or is this a bug?
What I have tried that causes the error to go away:
Change the function call to 'format' => __('Some Text')
- omitting the true. Which causes the function to just return $translated skipping the vsprintf()
call.