GithubHelp home page GithubHelp logo

API Key in config.yml about googletranslatebundle HOT 7 CLOSED

eko avatar eko commented on May 23, 2024
API Key in config.yml

from googletranslatebundle.

Comments (7)

eko avatar eko commented on May 23, 2024

@anneachey,

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.

anneachey avatar anneachey commented on May 23, 2024

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

  1. 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");
    }
    }
    }
  2. 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.

eko avatar eko commented on May 23, 2024

@anneachey,

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.

anneachey avatar anneachey commented on May 23, 2024

$ 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.

eko avatar eko commented on May 23, 2024

@anneachey,

Alright, I just released a tag 1.1.1, can you try it again please?

from googletranslatebundle.

anneachey avatar anneachey commented on May 23, 2024

awesome! that worked perfectly! thank you so much :)

from googletranslatebundle.

eko avatar eko commented on May 23, 2024

@anneachey,

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.