- Issue created by @mvonfrie
I just got this error message when extracting strings:
The first parameter to info() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there. At info(sprintf("%d profiles deleted.",count($profiles))) in src/Commands/CleanupProfilesCommands.php on line 171. Read more at http://drupal.org/node/322732
I understand the meaning of the error, but i this case it is just wrong because it detected
Symfony\Component\Console\Style\SymfonyStyle::info(string|array $message)
which like other methods of that class are not translatable.
Create a custom Drush command (class extending Drush\Commands\DrushCommands
) and create a call to $this->io()->info()
passing a variable or anything else than a string literal.
The method detection should not only rely on the method name but better on its full signature or class/interface which defines it.
Active
1.0
Code