Comments (7)
I confirm than a simple composer update should fix the issue for Languages method. You should have:
▶ composer update eko/googletranslatebundle
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Updating eko/googletranslatebundle dev-master (ac90d27 => dfd84c9)
Checking out dfd84c95150f5e917078f93cbb5e857868380ec0
I just tested your code (with hardcoded values) here:
$translator = $this->get('eko.google_translate.translator');
$value = $translator->translate('test', 'fr', 'en');
and here is the result (because I do not have an API key actually, so it's normal):
Client error response [url] https://www.googleapis.com/language/translate/v2?key=fake-api-key&q=test&source=en&target=fr [status code] 400 [reason phrase] Bad Request
However, I cannot reproduce your issue.
Can you please paste me the result of the following command: composer show eko/googletranslatebundle
?
Thank you
from googletranslatebundle.
The composer show result is:
name : eko/googletranslatebundle
descrip. : A Symfony bundle to deals with Google Translate API
keywords : api, bundle, detect, google, language, translate
versions : dev-master, * 1.1.0, 1.0.x-dev, 1.0.0
type : library
license : MIT
source : [git] https://github.com/eko/GoogleTranslateBundle.git dedd3f2
dist : [zip] https://api.github.com/repos/eko/GoogleTranslateBundle/zipball/dedd3f21c0651a1751572e7b582bf03291e7cdbc dedd3f2
names : eko/googletranslatebundle
autoload
psr-4
Eko\GoogleTranslateBundle\ => .
requires
guzzlehttp/guzzle 5.0.*@dev
php >=5.3.2
symfony/framework-bundle ~2.0
If it helps below is the stack trace:
Stack Trace
- in /var/www/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php at line 364 -
continue;
}
throw new Iae("No method can handle the {$key} config key");
}
}
} - at MessageFactory ->applyOptions (object(Request), array('allow_redirects' => true, 'exceptions' => true, 'decode_content' => true, 'verify' => true, 'headers' => array('User-Agent' => 'Guzzle/5.0.3 curl/7.26.0 PHP/5.5.18-1~dotdeb.1'), 'key' => 'server_public_api_key_generated_in_google_developers_console', 'query' => '
testing all good things
', 'source' => 'en', 'target' => 'es'))
in /var/www/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php at line 97 +
from googletranslatebundle.
You're not up-to-date with latest tag commits.
Can you please run the following command and paste me the result?
composer update eko/googletranslatebundle --prefer-source
Thank you
from googletranslatebundle.
$ composer update eko/googletranslatebundle --prefer-source
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
Updating the "app/config/parameters.yml" file
Clearing the cache for the dev environment with debug true
Installing assets using the hard copy option
Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
...
...
...
In the composer.json I have the require on the bundle as:
"require": {
"eko/googletranslatebundle": "1.1.*"
}
from googletranslatebundle.
Alright, I just released a tag 1.1.1
, can you try it again please?
from googletranslatebundle.
awesome! that worked perfectly! thank you so much :)
from googletranslatebundle.
Great, you're welcome, sorry for this issue and happy translating ;)
Do not hesitate if you have other issues.
Thank you
from googletranslatebundle.
Related Issues (8)
- New tag HOT 2
- Issues Call Google Api Key HOT 3
- not install, not compatible guzzle HOT 3
- bulk mode HOT 2
- guzzle version update HOT 1
- API Key in config.yml HOT 2
- Translate texts longer than 2000 bytes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from googletranslatebundle.