weasty/exercise-google-translate-bundle
Composer 安装命令:
composer require weasty/exercise-google-translate-bundle
包简介
This bundle include service for translate with Google Translate and command which translate messages in your Bundles
README 文档
README
About Bundle
This bundle include service for translate with Google Translate and command which translate messages in your Bundles
Install
A) Add GoogleTranslateBundle to your composer.json
{ "require": { "exercise/google-translate-bundle": "*" } }
B) Enable the bundle
Enable the bundle in the your kernel:
// app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Exercise\GoogleTranslateBundle\ExerciseGoogleTranslateBundle(), ); }
C) Configuration
Enter your private api key in configuration
# app/config/config.yml exercise_google_translate: api_key: your_api_key
Usage
You can it use as a service
// Acme/DemoBundle/Controller/WelcomeController.php public function indexAction() { ... $translator = $this->get('exercise_google_translate.translator'); $translatedString = $translator->translate('Hello World!', 'en', 'fr'); // Bonjour tout le monde! return new Response($translatedString); }
or you can use console command to translate messages
app/console gtranslate:translate en fr AcmeDemoBundle
Bug tracking
GoogleTranslateBundle uses GitHub issues. If you have found bug, please create an issue.
License
This bundle is under the MIT license. See the complete license in LICENSE.md
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-02-15