becklyn/translations-extractor

从给定目录中提取翻译。

1.1.1 2023-05-23 14:49 UTC

This package is auto-updated.

Last update: 2024-09-23 17:38:59 UTC


README

CLI 命令,帮助在 Symfony 项目中提取翻译。

安装

最好使用 composer-bin-plugin 安装此命令。

composer bin test req becklyn/translations-extractor 

使用方法

使用 CLI 调用此命令

./vendor/bin/extract-translations src/ templates/

作为参数,传递要搜索的目录列表。

选项

您可以传递扩展名名称给 Twig,这样 Twig 就不会对缺失的函数(或过滤器等)发出警告。

  • --mock-function 要模拟的函数名称
  • --mock-filter 要模拟的过滤器名称
  • --mock-test 要模拟的测试名称
./vendor/bin/extract-translations src/ --mock-filter normalize --mock-filter normalize_another

有一个预定义的模拟列表,请查看 MockExtension