在 Symfony/Component/Translation 中删除了 MessageSelector

removed MessageSelector in Symfony/Component/Translation

我刚刚尝试升级到 Symfony 5.0,但是,我收到以下错误:

You have requested a non-existent service "translator.selector".

在我的代码中 services.yaml 我有

Symfony\Component\Translation\MessageSelector: '@translator.selector'

https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Translation/CHANGELOG.md我看到它被删除了。我该如何继续?提前致谢!

最好的方法是查看更新日志https://github.com/symfony/symfony/blob/master/UPGRADE-5.0.md

The MessageSelector, Interval and PluralizationRules classes have been removed, use IdentityTranslator instead