【发布时间】:2018-09-21 09:10:23
【问题描述】:
我的愿望:在控制器中提取 Symfony 4 中缺失的翻译/消息。
我知道这是可能的,使用命令行。
Extract missing translations with command lines
我所有的翻译都来自我的模板。
我试图加载对象 TranslatorInterface
示例:
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Translation\TranslatorInterface;
public function index(TranslatorInterface $translator)
{
dump($translator);
}
如果你有一个想法,一个捆绑的目的?
谢谢
【问题讨论】:
-
恕我直言,在 Symfony 中本机是不可能的。您可以检查命令的代码来自己完成这项工作。这是命令
vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php的路径
标签: symfony controller export translation