Skip to content

[6.x] Fix translator error with Symfony Console 8#14330

Merged
jasonvarga merged 2 commits into6.xfrom
translator-symfony-console
Mar 24, 2026
Merged

[6.x] Fix translator error with Symfony Console 8#14330
jasonvarga merged 2 commits into6.xfrom
translator-symfony-console

Conversation

@duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Mar 24, 2026

This pull request fixes an issue where the translator script throws an error when running on Symfony Console 8.0.

This was happening because Symfony Console 8.0 removed the Application::add() method, which was deprecated in 7.4.

This PR fixes it by using the replacement Application::addCommand() method instead.

Fixes #14324

Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the reported error but now when I run php translator translate fr for example, I get a different error:

Fatal error: Declaration of Statamic\Translator\Commands\Stats::configure() must be compatible with Symfony\Component\Console\Command\Command::configure(): void in /Users/jason/Code/statamic/cms/src/Translator/Commands/Stats.php on line 27

@duncanmcclean
Copy link
Member Author

Whoops - should be sorted now. Sorry! 😬

@jasonvarga jasonvarga merged commit 2bdae1f into 6.x Mar 24, 2026
17 checks passed
@jasonvarga jasonvarga deleted the translator-symfony-console branch March 24, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Translator throwing an uncaught error

2 participants