繁体   English   中英

无法使用 statickidz api google translate-php 进行翻译

[英]Cannot translate with statickidz api google translate-php

我不能用 statickidz/php-google-translate-free 翻译这是我的代码:

<?php

    require_once ('vendor/autoload.php');
    use \Statickidz\GoogleTranslate;

    $source = 'fr';
    $target = 'en';
    $text = 'Bonjour';

    $trans = new GoogleTranslate();
    $result = $trans->translateGhost($source, $target, $text);

    echo $result;

?>

我遇到的问题是: Fatal error: Uncaught Error: Call to undefined method Statickidz\GoogleTranslate::translateGhost() in C:\xampp\htdocs\licenceactivation\test\index.php:11 Stack trace: #0 {main} thrown in C:\xampp\htdocs\licenceactivation\test\index.php on line 11

我假设您安装了最新版本 (1.1.1)。 该方法称为translate (请参阅文档

翻译($源,$目标,$文本); 回显$结果; ?>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM