natxet/twig-po 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

natxet/twig-po

Composer 安装命令:

composer require natxet/twig-po

包简介

Extract {%trans%} keys from twig and insert them in your PO file

README 文档

README

Extract translation keys from twig templates and move them to PO

Instructions

Fork and install (you need composer for that!):

git clone git@github.com:natxet/twig-po.git
cd twig-po
composer install

Then, go to folder and execute:

./console find:tags /path/to/twig/templates  /path/to/messages.po Po -d -v -o

Once you see that nothing wrong is going to happen then

./console find:tags /path/to/twig/templates  /path/to/messages.po Po

If you want to use it with other tags, for instance, for your PHP files with _('translation')

./console find:tags /path/to/twig/templates  /path/to/messages.po Po -t "/_\((?: )?['\"]([^$]*)['\"](?: )?\)/muU"

For help:

./console help find:tags

Once you have the PO translated, convert to .mo with your editor or command line:

msgfmt -cv -o messages.mo messages.po

(Note: you need to have gettext installed for this command)

统计信息

  • 总下载量: 2.32k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-11-09