【问题标题】:Silex + Get translate strings from twig viewsSilex + 从树枝视图中获取翻译字符串
【发布时间】:2014-04-09 13:08:51
【问题描述】:

我正在使用来自 Silex 的TranslationServiceProvider(基于 symfony2 组件的微框架构建)。我现在翻译我认为这样的东西:

<h1>{{ 'psttoday'|trans }}</h1>

psttoday 是我使用的标签。翻译存储在 yml 文件中。有没有一种方法可以设置{{ 'psttodo'|trans }},然后运行脚本并将标签写入我的数据库或其他文件?

【问题讨论】:

    标签: php symfony silex


    【解决方案1】:

    是否要提取所有带有 |trans 过滤器的字符串?

    看看那个答案:
    How to generate translation file (.po, .xliff, .yml,...) from a Symfony2/Silex project?

    他们提议:

    这个Bundle还有一个提取任务:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-05-23
      • 2017-01-26
      • 1970-01-01
      • 2021-11-04
      • 2019-05-07
      • 2018-07-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多