Developed with love by KnpLabs Hire us for your project!
25

GoogleTranslateBundle

by Exercise

GoogleTranslateBundle Build Statusknpbundles.com

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

License

exercise_google_translate:

# key for your app https://code.google.com/apis/console/b/0/?pli=1#project:247987860421:access
api_key: ~ # Required
  • Merge pull request #10 from Remiii/add-license
    By spolischook, 4 years ago
  • Update README.md
    By spolischook, 4 years ago
  • Merge pull request #11 from Remiii/add-packagist-keywords
    By spolischook, 4 years ago
  • Add Packagist keywords
    By Remiii, 4 years ago
  • Add License info - #9
    By Remiii, 4 years ago
  • Merge pull request #4 from albertofem/patch-2
    By spolischook, 5 years ago
  • 'api_key' configuration node required
    By albertofem, 5 years ago
  • Merge pull request #3 from albertofem/master
    By spolischook, 5 years ago
  • Fixed filename issue and russian translations in tests
    By albertofem, 5 years ago
  • Merge pull request #2 from jamesmoss/master
    By spolischook, 5 years ago
  • Fixing wrong bundle name in readme
    By , 5 years ago
  • Merge pull request #1 from spolischook/master
    By wizardz, 6 years ago
  • Merge pull request #1 from jmmerino/master
    By spolischook, 6 years ago
  • Update composer.json
    By , 6 years ago
  • Update composer.json
    By jmmerino, 6 years ago
  • fix fixtures
    By spolischook, 6 years ago
  • Update tests
    By spolischook, 6 years ago
  • Update doc
    By spolischook, 6 years ago
  • Update tranlate command - use translate instead of translateString method
    By spolischook, 6 years ago
  • Add ifPluralization condition. Now use translate instead of translateString method
    By spolischook, 6 years ago
  • Update fixtures for tests
    By spolischook, 6 years ago
  • Upgrade ParameterEscaper. Fix some issues by translate.
    By spolischook, 6 years ago
  • Add type hinting to translateArray method
    By spolischook, 6 years ago
  • Add true build status image
    By spolischook, 6 years ago
  • Add travis.yml
    By spolischook, 6 years ago
  • Add dernel dir to phpunit.xml.dist
    By spolischook, 6 years ago
  • Add gitignore
    By spolischook, 6 years ago
  • Add custom appKernel class
    By spolischook, 6 years ago
  • Update translation fixtures for tests
    By spolischook, 6 years ago
  • Add dependency for tests
    By spolischook, 6 years ago