Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple words are not translating #9

Open
pavan-git opened this issue Sep 1, 2015 · 1 comment
Open

Multiple words are not translating #9

pavan-git opened this issue Sep 1, 2015 · 1 comment

Comments

@pavan-git
Copy link

I used following code , I need to translation multiple words at a time.

require_once './vendor/autoload.php';

use Yandex\Translate\Translator;
use Yandex\Translate\Exception;

try {
  $translator = new Translator('keyansdnaksndjkjsajk');
  $translation = $translator->translate(array('banana','apple'), 'en-ru');
        echo "<pre>";
        print_r($translation);
  echo $translation->getSourceLanguage(); // en
  echo $translation->getResultLanguage(); // ru
} catch (Exception $e) {
  // handle exception
}

But result is not having translated words. It is working for only single word not array

Yandex\Translate\Translation Object
(
    [source:protected] => Array
        (
            [0] => banana
            [1] => apple
        )

    [result:protected] => Array
        (
        )

    [language:protected] => Array
        (
            [0] => en
            [1] => ru
        )

)
@berejant
Copy link
Contributor

berejant commented Dec 5, 2015

I fix this bug in pull-reqeust #7
Or in my fork of this library https://github.com/berejant/translate-api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants