2017 © Pedro Peláez
 

symfony-bundle translation-bundle

A symfony2 bundle help you to translate using Yandex API

image

krushnaghodke/translation-bundle

A symfony2 bundle help you to translate using Yandex API

  • Wednesday, August 2, 2017
  • by krushnaghodke
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

TranslationBundle

A package designed for string translation utilizing the Yandex API. Presently, it exclusively accommodates Yandex translation services. Integration with the Google Translation API is slated for future implementation., (*1)

Installation

To use this bundle in your Symfony2 project add the following to your composer.json:, (*2)

{
    "require": {
        // ...
       "krushnaghodke/translation-bundle": "dev-master"
    }
}

Then, you can install the new dependencies by running Composer's update command from the directory where your composer.json file is located:, (*3)

.. code-block :: bash, (*4)

$ php composer.phar install

Now, Composer will automatically download all required files, and install them for you. All that is left to do is to update your AppKernel.php file, and register the new bundle:, (*5)

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
       new Krushnaghodke\TranslationBundle\KrushnaghodkeTranslationBundle(),
    );
}

Configuration

Update following code in config.yml., (*6)

# app/config.yml
krushnaghodke_translation:
    api_key: %yandex_api_key%

Usage

Below is a brief demonstration illustrating the process of translating your initial string using the Yandex API. It is presumed that the configuration has been appropriately established:, (*7)

<?php

$translation = $this->get('krushnaghodke.translation.manager');
$result = $translation->translate("This is testing string", 'en-hi');

The Versions

02/08 2017

dev-master

9999999-dev

A symfony2 bundle help you to translate using Yandex API

  Sources   Download

MIT

The Requires

 

by Krishna Ghodke

yandextranslationbundle