skolodyazhnyy/onesky-bundle
最新稳定版本:1.0.0
Composer 安装命令:
composer require skolodyazhnyy/onesky-bundle
包简介
Onesky Translations Downloader
README 文档
README
Installation
Add bundle to your composer requirements
php composer.phar require skolodyazhnyy/onesky-bundle
Add bundle to your application kernel (app/AppKernel.php)
class AppKernel extends Kernel { public function registerBundles() { $bundles = array( ... new Seven\Bundle\OneskyBundle\SevenOneskyBundle(), );
Create a configuration for the bundle. Add following configuration to your app/config/config.yml
seven_onesky: api_key: %onesky_api_key% secret: %onesky_secret% project: %onesky_project% # Configure mappings to match your needs, every mapping includes, # sources - list of files to export, all by default # locales - list of locales to export, all by default # output - output filename pattern, you can use [filename], [locale], [extension] and [dirname] as parameters mappings: - { sources: ["messages.xliff"], locales: ["en", "es"], output: "%kernel.root_dir%/Resources/translations/messages.[locale].xliff" }
Setup OpenSky API parameters in app/config/parameters.yml
parameters: onesky_api_key: <replace with your OneSky API key> onesky_secret: <replace with your OneSky secret> onesky_project: <replace with your OneSky project ID>
Usage
Simply run onesky:dump command to dump all your location files to desired destination,
app/console onesky:dump
You are free to keep your translations under version control system or outside.
Usage with capifony
If you are using capifony you can setup a task to update translations on remote server, simply add this task to your app/deploy.rb:
namespace :onesky do desc "Dumps all translations from OneSky" task :dump, :roles => :app, :except => { :no_release => true } do capifony_pretty_print "--> Dumping all translations" run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} onesky:dump #{console_options}'" capifony_puts_ok end end
And then run it, using
cap onesky:dump
Also you can add it to the deployment process
after "symfony:assetic:dump", "onesky:dump"
统计信息
- 总下载量: 445
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-17