pmdevelopment/translate-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Google Translate API Bundle for Symfony2

1.0.0 2016-10-18 11:33 UTC

This package is not auto-updated.

Last update: 2022-01-19 12:22:58 UTC


README

Google Translate API Bundle

Config.yml

"from" and "to" are optional. Default is "en" to "de".

    pm_translate:
        api_key: '%google_api_translate_key%'
        from: de
        to: en

Usage

    /*
     * Default Language
     */
    $translation = $this->get('pm_translate.services.translation_service')->translate($keywordName);
    
    /*
     * Custom Language
     */
    $translation = $this->get('pm_translate.services.translation_service')->translate($keywordName, 'en', 'fr');