1

查看文档我找不到任何提及它,所以我会问:Twig i18n 扩展是否支持嵌入式注释,可以通过 gettext 提取?换句话说,是否有等效的 Twig 语法:

/// TRANSLATORS: Please leave %s as it is, because it is needed by the program.
/// Thank you for contributing to this project.
printf(_("My name is %s."), $myName);

这将是可提取的:

#. TRANSLATORS: Please leave %s as it is, because it is needed by the program.
#. Thank you for contributing to this project.
msgid "My name is %s."
msgstr ""
4

1 回答 1

1

由于似乎没有任何功能,因此我为它编写了一个扩展:Twig_Extension_Gettext。它添加了许多缺少的 gettext 功能,包括支持可提取注释的本机模板解析器。

于 2013-03-06T05:21:06.037 回答