Problem/Motivation

I installed the module on a Drupal 9 (composer) with google translate v3 config (API enable + SA setup) and when I'm trying to translate a node I have this error message.

Error: Call to undefined method Drupal\auto_node_translate\GoogleTranslationApi::t() in Drupal\auto_node_translate\GoogleTranslationApi->translate() (line 64 of modules/contrib/auto_node_translate/src/GoogleTranslationApi.php).

Did I miss something in the installation process ?

Bonus question: Can we translate a product from Drupal commerce ?

CommentFileSizeAuthor
#6 3360856.patch8.32 KBkallado
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

    Comments

    darkjeff created an issue. See original summary.

    kallado’s picture

    Doesn't look like you did but you are getting an error on the translation wich means you probably don't have the configuration correct.
    I'm kind of on a schedule right now but i'll get to this as soon as possible.
    By the way does it work with MyMemory api?

    kallado’s picture

    Looks like the messages are related to deprecated funtions in Google\Protobuf soo your configuration might be ok.
    If i fix the the error in the api
    \Drupal::messenger()->addError($this->t('Error @code: @message'
    ->
    \Drupal::messenger()->addError(t('Error @code: @message'
    The node is translated.
    I'll release a patch as son as i can

    kallado’s picture

    for now to avoid the deprecation erros you can update the google/protobuf
    just run:
    composer update google/protobuf --with-dependencies

    kallado’s picture

    kallado’s picture

    StatusFileSize
    new8.32 KB

    Patch availabel can you test it?

    kallado’s picture

    Assigned: Unassigned » kallado
    kallado’s picture

    Status: Active » Needs review

    • kallado committed c355f8c2 on 1.0.x
      Issue #3360856 by kallado: Call to undefined method Drupal\...
    jmauricio’s picture

    Status: Needs review » Reviewed & tested by the community

    Patch solved the issue.

    kallado’s picture

    kallado’s picture

    Fixed in 2.1.7

    kallado’s picture

    Status: Reviewed & tested by the community » Fixed

    Status: Fixed » Closed (fixed)

    Automatically closed - issue fixed for 2 weeks with no activity.