为 Laravel 实现 Google Cloud AI API 翻译与 Google Translate 的对比

电子设备,黑白
Table of Contents

对于拥有基于 Laravel 的网站的用户来说,提供准确自然的翻译内容对于 翻译您的网站 并提供良好的用户体验非常重要。

幸运的是,有多种自动翻译服务可以帮助开发者克服这一挑战,包括 Google Cloud AI API Translation 和 Google Translate。这两项服务都利用机器技术提供翻译能力。.

在本文中,我们将探讨为的主要区别,并为您的 Laravel 应用实施 Laravel 网站推荐最佳翻译服务。Google Cloud AI Translation 和 Google Translate

Google Cloud AI API 翻译和 Google 翻译是什么?

在开始讨论之前,我们将先讨论一下 Google Cloud AI API 和 Google Translate 翻译各自的含义。.

Google Cloud AI API 翻译

Google Cloud 服务器和云存储

Google Cloud AI API Translation 是 Google Cloud Platform 提供的一项先进的 自动翻译服务 。该服务利用最新的人工智能 (AI) 和机器学习技术,为文本、语音和文档提供准确自然的翻译。

Google Cloud AI API 翻译采用基于深度学习的神经翻译模型,能够更好地捕捉语言的细微差别和上下文,提供更符合实际语言习惯的地道翻译。此外,使用 Google Cloud AI 翻译,前 500,000 个字符免费,之后的 75,000 个字符将按每百万字符 20 美元收费。. 

Google 翻译

翻译设置界面。语言设置选项。.

与此同时,Google Translate 是一项历史悠久且广为人知的自动文本翻译服务。它采用较为传统的统计翻译方法,根据从大量训练数据集中学习到的模式和概率来生成译文。.

尽管在准确性和处理语言细微差别方面不如 Google Cloud AI API 翻译先进,但 Google 翻译因其易用性和对非商业用途的免费可用性,仍然是一个受欢迎的选择。.

在 Laravel中实现 Google Cloud AI API 翻译

包括 Linguise 在内的多种翻译服务,使用 AI 翻译 云技术来翻译网站。

语言翻译服务使用云端 AI API 作为其翻译技术之一。以下是 在 Laravel 网站上的实施步骤。 我们在此假设您已经拥有一个现成的 Laravel 项目网站。

创建 Linguise 帐户

要使用 Linguise,您必须先 注册一个账户 。您可以免费使用,也可以按月或按年订阅。您只需提供电子邮件、用户名和密码等信息。

添加 Laravel 网站信息

之后,添加您将使用的网站信息,输入您的 Linguise 账户信息和网站 URL,选择 Laravel 平台,并添加默认语言以及您想要添加到网站的语言。.

 

加载动画

然后通过以下按钮下载 PHP 脚本并将其保存到您的本地计算机上。.

上传并配置 PHP 脚本

下载脚本后,解压并将其上传到安装 Laravel 的根文件夹。确保它位于 Laravel 安装的根目录(通常是您的 CMS 文件所在的位置)。确保该文件夹命名为“linguise”(解压文件夹时的默认名称)。.

计算机文件系统导航菜单

然后,必须将 Linguise API 密钥复制到您上传到服务器的 …/linguise/Configuration.php 文件中。编辑该文件,将您的 API 密钥粘贴到引号之间,替换文本 REPLACE_BY_YOUR_TOKEN。.

代码配置截图

插入语言切换器脚本

接下来,插入你从Linguise 。控制面板获取的语言切换脚本

脚本语言切换器 - 为 Laravel 实现 Google Cloud AI API 翻译与 Google Translate 的对比

已将脚本插入到 resources/views/layouts/ 目录下的 front.blade.php 文件中。以下是插入脚本的预览。.

终端窗口显示代码输出

配置 .htaccess

最后,需要在 .htaccess 文件中配置基于语言的 URL。如果您的文件中包含“RewriteBase /”,只需在该行之后复制并粘贴以下代码。.

				
					<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule ^(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-cn|zh-tw|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu|zz-zz)(?:$|/)(.*)$ linguise/linguise.php?linguise_language=$1&original_url=$2 [L,QSA]
</IfModule>
				
			

完成。至此,您已成功在 Linguise 服务上实现了云端 AI API 翻译。现在,您可以检查 Laravel 网站。将出现一个默认的语言切换器,您可以通过仪表盘 为 Laravel 自定义语言切换器。

一个男人,深色背景,神秘氛围

在 Laravel中实现 Google 翻译

现在我们将尝试在 Laravel中实现 Google Translate。这里我们假设您已成功创建了一个 Laravel 项目,只需添加 Google Translate 即可。.

您也可以在 Laravel 官方 Laravel 网站上找到以下安装步骤。

安装 Google Translator 包

要安装 Google Translator 包,请打开项目提示符并输入以下命令。该包将让您能够使用 google-translator-language 的工作功能。.

				
					composer require stichoza/google-translate-php
				
			

Google Translator 包的设置

我们需要在应用程序中设置“谷歌翻译包”。打开 /config 文件夹中的 app.php 文件,找到“aliases”部分,并添加以下代码行。.

一台显示代码文本的计算机终端。屏幕上显示着多行代码。.
				
					/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/

'aliases' => Facade::defaultAliases()->merge([
    // 'Example' => App\Facades\Example::class,
    'GoogleTranslate' => Stichoza\GoogleTranslate\GoogleTranslate::class,
])->toArray(),

				
			

设置语言控制器

您需要创建一个如下所示的语言控制器文件

				
					php artisan make:controller LangController
				
			

它将在 /app/Http/Controllers 文件夹内创建 LangController.php 文件。.

电脑屏幕上显示着一行行代码
				
					<?php

namespace App\Http\Controllers;

use Illuminate\Contracts\View\View;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;

class LangController extends Controller
{
    public function index(): View
    {
        return view('lang');
    }

    public function change(Request $request)
    {
        App::setLocale($request->lang);
        
        session()->put('locale', $request->lang);

        return redirect()->back();
    }
}


				
			

创建 Blade 模板文件

导航到 /resources/views 文件夹,创建一个名为 lang.blade.php 的文件。打开该文件并将以下代码插入其中。.

电脑屏幕上的代码图像。编程文本。.
				
					<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Laravel 10 Create Multi Language Website Tutorial</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

<script type="application/ld+json" class="gnpub-schema-markup-output">
{"@context":"https:\/\/schema.org\/","@type":"NewsArticle","@id":"https:\/\/www.linguise.com\/blog\/guide\/implement-google-cloud-ai-api-translation-vs-google-translate-for-laravel\/#newsarticle","url":"https:\/\/www.linguise.com\/blog\/guide\/implement-google-cloud-ai-api-translation-vs-google-translate-for-laravel\/","image":{"@type":"ImageObject","url":"https:\/\/www.linguise.com\/wp-content\/uploads\/2024\/05\/Implement-Google-Cloud-AI-API-translation-vs-Google-Translate-for-Laravel-150x150.png","width":150,"height":150},"headline":"Implement Google Cloud AI API translation vs Google Translate for Laravel","mainEntityOfPage":"https:\/\/www.linguise.com\/blog\/guide\/implement-google-cloud-ai-api-translation-vs-google-translate-for-laravel\/","datePublished":"2024-05-31T07:32:47+00:00","dateModified":"2024-08-26T19:19:15+00:00","description":"For those of you who own Laravel-based websites, providing accurate and natural translation content is very important to translate your website and offer a good","articleSection":"Guide","articleBody":"For those of you who own Laravel-based websites, providing accurate and natural translation content is very important to translate your website and offer a good user experience.\nFortunately, several automatic translation services are available to help developers overcome this challenge, including Google Cloud AI API Translation and Google Translate. Both services offer translation capabilities using machine technology.\nIn this article, we will explore the main differences between implementing Google Cloud AI Translation and Google Translate for Laravel applications and recommend the best translation services for your Laravel website.&nbsp;\t\t\n\t\t\tWhat are Google Cloud AI API translation &amp; Google Translate?\n\t\t\n\t\tBefore entering into the discussion, we will discuss the respective meanings of Google Cloud AI API and Google Translate translations.\t\t\n\t\t\tGoogle Cloud AI API translation\n\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\tGoogle Cloud AI API Translation is an advanced automatic translation service provided by Google Cloud Platform. This service leverages the latest artificial intelligence (AI) and machine learning technologies to deliver accurate and natural translations of text, voice, and documents.Google Cloud AI API Translation uses neural translation models based on deep learning, which allows it to capture language nuances and context better, providing more idiomatic translations that align with actual language usage. Additionally, using Google Cloud AI Translation for up to 500,000 characters is free of charge, while the next 75,000 characters will incur a cost of $20 per million characters.\u00a0\t\t\n\t\t\tGoogle Translate\n\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\tMeanwhile, Google Translate is a long-standing and widely known automatic text translation service. It uses a more traditional statistical translation approach, which generates translations based on patterns and probabilities learned from large training datasets.Although it is not as advanced as Google Cloud AI API Translation in terms of accuracy and handling language nuances, Google Translate remains a popular choice due to its ease of use and free availability for non-commercial use.\t\t\n\t\t\tImplement Google Cloud AI API translation on Laravel\n\t\t\n\t\tSeveral translation services, including Linguise, use AI Translation cloud technology to translate websites.The language translation service uses cloud AI API as one of its translation technologies. The following are the implementation steps on the Laravel website. We assume here that you already have a ready Laravel project website.\t\t\n\t\t\tCreate Linguise account\n\t\t\n\t\tTo use Linguise, you must register an account first. You can do this for free or subscribe for one month or a year. You only need to provide information such as your email, username, and password.\t\t\n\t\t\tAdd Laravel website info\n\t\t\n\t\tAfter that, add information about the website you will use, enter your Linguise account info and web URL, select the Laravel platform, and add the default language and the language you want to add to the website.\u00a0\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\tThen download the PHP script via the following button and save it on your local computer.\t\t\n\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tDOWNLOAD PHP-JS TRANSLATION SCRIPT\n\t\t\t\t\t\n\t\t\tUpload and configure the PHP script\n\t\t\n\t\tAfter downloading the script, unzip it and upload it to the root folder where Laravel is installed. Ensure it is located at the root of your Laravel installation (typically where your CMS files are). Ensure the folder is named \"linguise\" (the default name when the folder is unzipped).\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\tThen, the Linguise API key must be copied into the \u2026\/linguise\/Configuration.php file you uploaded to your server. Edit the file and paste your API key between the quotes, replacing the text REPLACE_BY_YOUR_TOKEN.\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tInsert script of language switcher\t\t\n\t\tNext, insert the language switch script that you got from the Linguise dashboard.\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\tInserted into the front.blade.php file in the resources\/views\/layouts\/ directory. Here is a preview of the inserted script.\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tConfigure .htaccess\n\t\t\n\t\tLastly, language-based URLs need to be configured in the .htaccess file. If your file includes \"RewriteBase \/,\" simply copy and paste the following code after that line.\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n  RewriteEngine On\n  RewriteRule ^(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-cn|zh-tw|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu|zz-zz)(?:$|\/)(.*)$ linguise\/linguise.php?linguise_language=$1&original_url=$2 [L,QSA]\n\n\t\t\t\t\n\t\t\t\n\t\tDone. At this point, you have successfully implemented cloud AI API Translation on the Linguise service. Now, you can check the Laravel website. A default language switcher will appear, and you can customize the Language switcher for Laravel via the dashboard.\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tImplement Google Translate on Laravel\t\t\n\t\tNow we will try to implement Google Translate in Laravel. Here we assume that you have successfully created a Laravel project and just need to add Google Translate.You can also find the following installation steps on the official Laravel website.\t\t\n\t\t\tInstall Google Translator Package\n\t\t\n\t\tTo install the Google Translator Package, open the project prompt and input the following command. This package will enable you to utilize the working functions of the google-translator-language.\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tcomposer require stichoza\/google-translate-php\n\t\t\t\t\n\t\t\t\n\t\t\tSetting of Google Translator Package\n\t\t\n\t\tWe must set up the \"google translator package\" within the the application. Open the app.php file in the \/config folder, find the \"aliases\" section, and add the following line of code.\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\/*\n|--------------------------------------------------------------------------\n| Class Aliases\n|--------------------------------------------------------------------------\n|\n| This array of class aliases will be registered when this application\n| is started. However, feel free to register as many as you wish as\n| the aliases are \"lazy\" loaded so they don't hinder performance.\n|\n*\/\n'aliases' => Facade::defaultAliases()->merge([\n    \/\/ 'Example' => AppFacadesExample::class,\n    'GoogleTranslate' => StichozaGoogleTranslateGoogleTranslate::class,\n])->toArray(),\n\n\t\t\t\t\n\t\t\t\n\t\t\tSetup Language Controller\n\t\t\n\t\tYou need to create a language controller file like the following\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tphp artisan make:controller LangController\n\t\t\t\t\n\t\t\t\n\t\tIt will create LangController.php file inside \/app\/Http\/Controllers folder.","keywords":"","name":"Implement Google Cloud AI API translation vs Google Translate for Laravel","thumbnailUrl":"https:\/\/www.linguise.com\/wp-content\/uploads\/2024\/05\/Implement-Google-Cloud-AI-API-translation-vs-Google-Translate-for-Laravel-150x150.png","wordCount":809,"timeRequired":"PT3M35S","mainEntity":{"@type":"WebPage","@id":"https:\/\/www.linguise.com\/blog\/guide\/implement-google-cloud-ai-api-translation-vs-google-translate-for-laravel\/"},"author":{"@type":"Person","name":"Tristan","url":"https:\/\/www.linguise.com\/author\/tristan\/","sameAs":[],"image":{"@type":"ImageObject","url":"https:\/\/secure.gravatar.com\/avatar\/50d7238660b192d8d54ebf6367be5e97bb41c24dbd190daae062d931efd351ae?s=96&d=mm&r=g","height":96,"width":96}},"editor":{"@type":"Person","name":"Tristan","url":"https:\/\/www.linguise.com\/author\/tristan\/","sameAs":[],"image":{"@type":"ImageObject","url":"https:\/\/secure.gravatar.com\/avatar\/50d7238660b192d8d54ebf6367be5e97bb41c24dbd190daae062d931efd351ae?s=96&d=mm&r=g","height":96,"width":96}}}
</script>
</head>

<body>
    <div class="container mt-5">
        <div class="row">
            <div class="col-md-12">
                <div class="card w-75 m-auto">
                    <div class="card-header text-center bg-primary text-white">
                        <h4 style="font-size: 17px;">Laravel 10 Create Multi Language Website Tutorial</h4>
                    </div>
                    <div class="card-body">
                        <div class="row">
                            <div class="col-md-4">
                                <strong>Select Language: </strong>
                            </div>
                            <div class="col-md-4">
                                <select class="form-select changeLang">
                                    <option value="en" {{ session()->get('locale') == 'en' ? 'selected' : '' }}>
                                        English
                                    </option>
                                    <option value="fr" {{ session()->get('locale') == 'fr' ? 'selected' : '' }}>
                                        French
                                    </option>
                                    <option value="ar" {{ session()->get('locale') == 'ar' ? 'selected' : '' }}>
                                        Arabic
                                    </option>
                                    <option value="hi" {{ session()->get('locale') == 'hi' ? 'selected' : '' }}>
                                        Hindi
                                    </option>
                                </select>
                            </div>
                        </div>

                        <div style="margin-top: 20px;">
                            <p>{{ GoogleTranslate::trans('Welcome to Online Web Tutor', app()->getLocale()) }}</p>
                            <p>{{ GoogleTranslate::trans('It is a passionate and innovative Web Development Community dedicated to empowering aspiring web developers with the latest tools and techniques. Our platform offers a comprehensive range of web development courses, including PHP and its frameworks, Node.js, MySQL, Javascript and WordPress.', app()->getLocale()) }}
                            </p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!--- Language Change event from Dropdown --->
    <script type="text/javascript">
    var url = "{{ route('changeLang') }}";

    $(".changeLang").change(function() {
        window.location.href = url + "?lang=" + $(this).val();
    });
    </script>

</body>

</html>

				
			

语言中间件的设置

打开项目终端并运行以下命令:

				
					php artisan make:middleware LanguageManager


				
			

它将在 /app/Http/Middleware 文件夹内创建一个 LanguageManager.php 文件,并粘贴以下内容。.

一张黑白像素化图像。没有可见的清晰细节。.
				
					<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
use Illuminate\Support\Facades\App;

class LanguageManager
{
    /**
     * Handle an incoming request.
     *
     * @param  \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response)  $next
     */
    public function handle(Request $request, Closure $next): Response
    {
        if (session()->has('locale')) {

            App::setLocale(session()->get('locale'));
        }

        return $next($request);
    }
}

				
			

通过 Kernel.php 注册语言中间件

打开位于 /app/Http 目录下的 Kernel.php 文件。找到 $middlewareGroups 数组并导航到 web 部分。.

黑色背景上的模糊文字图像,文字无法辨认。.
				
					/**
 * The application's route middleware groups.
 *
 * @var array<string, array<int, class-string|string>>
 */
protected $middlewareGroups = [
    'web' => [
        
        //...

        \App\Http\Middleware\LanguageManager::class,
    ],

    'api' => [
        
        //...
    ],
];

				
			

添加路线

打开 /routes 文件夹中的 web.php 文件,并将这些路由添加到其中。.

Web.php - 为 Laravel实现 Google Cloud AI API 翻译与 Google Translate 的对比
				
					//...
use App\Http\Controllers\LangController;

//...

Route::get('lang/home', [LangController::class, 'index']);
Route::get('lang/change', [LangController::class, 'change'])->name('changeLang');


				
			

测试网站

在项目终端中执行此命令以启动开发服务器。.

				
					php artisan serve
				
			

这是已创建的 Laravel 网站展示,来自网站 onlinewebtutorblog.com  ,如以下展示所示,有一个 Google Translate 下拉菜单。

一张扭曲的图像,看起来像是电脑屏幕。.

然后,这就是 Laravel 网站被翻译成阿拉伯语后的样子。.

出现故障的电脑屏幕。显示着扭曲的代码和文字。.

在 Laravel上实现 Google Cloud AI 翻译与 Google 翻译有什么区别?

在了解了 Google Cloud AI 和 Google Translate 翻译在 Laravel中的各自实现方式后,我们将讨论它们之间的差异。.

安装和配置过程

一幅黑白插画。人们站在一个巨大的目标附近。.
  • Google Cloud AI API 翻译: 安装和配置过程较为复杂,因为您必须在 Google Cloud Platform (GCP) 上创建一个项目,启用 Cloud Translation API,创建服务帐号,生成 API 密钥,并在 Laravel 应用程序中配置 API 客户端。这涉及多个步骤,并且需要有效的 GCP 帐号。
  • Google 翻译: 安装和配置要简单得多。您只需通过 Composer 安装第三方包或库,例如 stichoza/google-translate-php。之后,您可以在 Laravel 配置文件中配置 Google 翻译 API 密钥。

翻译准确度

一群人围坐在电脑旁。.
  • Google Cloud AI API 翻译: 凭借其深度学习能力,该服务能够更好地捕捉复杂的语言语境和细微差别。这使得习语表达、比喻性短语以及难以直译的文字游戏能够获得更准确的翻译。
  • Google 翻译: 往往难以捕捉更细微的语言语境和语义差别,导致结果听起来生硬或不够自然。由于采用统计方法,翻译惯用表达或比喻性短语时通常不够准确。

响应速度

一艘火箭飞船从笔记本电脑和手机上起飞。.
  • Google Cloud AI API 翻译: 由于使用托管在 Google 强大云基础设施上的优化 神经机器翻译 模型,通常在响应翻译请求时速度更快。这提供了更快的响应时间,尤其是对于较长的文本或大量翻译内容。
  • Google 翻译: 它在响应翻译请求时可能稍慢一些,尤其是对于较长的文档或文本。这是因为它采用了更传统的统计翻译与神经翻译相结合的方法,其效率可能不如 Google Cloud AI API 翻译所使用的神经模型。

自定义与控制能力

一个带有故障效果的扭曲电脑屏幕。图像似乎已损坏。.
  • Google Cloud AI API Translation: 提供更多自定义和控制翻译过程的选项,例如设置翻译偏好、上传自定义词汇表,以及访问 实时编辑器翻译 界面来手动编辑翻译结果。这允许用户根据自身需求提高翻译准确性。
  • Google翻译: 自定义和控制选项较为有限。用户必须依赖自动翻译结果,几乎没有能力编辑或直接自定义翻译结果。

高级功能

带有辅助功能和咖啡杯的电脑屏幕
  • Google Cloud AI API 翻译: Google Cloud AI 翻译技术具有多项高级功能,例如术语表、模型选择和 AutoML 模型。此外,在与 Linguise 进行云端 AI 翻译时,它还具备诸如 翻译排除 等高级功能,可基于行、页面或 URL 针对技术术语、品牌名称等特定词汇进行排除。
  • Google 翻译: 安装在 Laravel 中的 Google 翻译无法翻译音频文档或其他内容。它只能将网站上的文本翻译成另一种语言,且无法编辑翻译结果。
Break Language Barriers
告别语言障碍,迎接无限增长!今天就试试我们的自动翻译服务。.

为您的 Laravel 网站选择翻译服务时应考虑哪些因素

以下是为您的 Laravel 网站选择最佳翻译服务时的一些考虑因素。.

  • 高翻译准确度 – 最重要的因素之一是所生成翻译的准确度。如果您的网站需要高度准确的翻译,尤其是针对复杂内容和细微语言,那么 Google Cloud AI API 翻译可能是比 Google 翻译更好的选择。
  • 集成与配置的便捷性—— 考虑在您的 Laravel 应用中安装和配置翻译服务。Google Translate 通常更易于集成,因为它以 PHP 包或库的形式提供。而 Google Cloud AI API Translation 则需要在 Google Cloud Platform 上进行更复杂的配置。
  • 功能与自定义选项 – 如果您需要术语表或专业术语翻译、 编辑器翻译 结果或其他自定义选项等附加功能,Google Cloud AI API Translation 比 Google Translate 提供更多选择。
  • 速度与响应时间 – 对于翻译量大或需要快速响应的应用,Google Cloud AI API Translation 通常比 Google Translate 更快地响应翻译请求。
  • 成本与预算 – Google 翻译可免费用于非商业用途,而 Google Cloud AI API Translation 则采用基于用量的付费计费模式。请考虑您的预算和预计翻译量,以选择最具成本效益的服务。
  • 支持与文档 – 此外,还要考虑每项服务可用的技术支持与文档。Google Cloud AI API Translation 可能拥有更全面的文档以及来自 Google 的支持。

Linguise,适用于 Laravel 网站的最佳云端 AI 翻译服务

专业的网站设计与开发服务,SEO 优化

到目前为止,您已经了解了为 Laravel选择翻译服务时需要考虑的因素;上述几乎所有因素都体现在 Linguise 翻译服务中。.

Linguise 是一项网站翻译服务 ,采用云端 AI 翻译技术生成内容翻译。该服务可以成为翻译基于 Laravel 的网站的最佳解决方案。为什么呢?因为 Linguise 解决了上述提到的各种考量因素。

  • Linguise 拥有 完美的翻译质量。 尽管这种准确性因语言对而异, Linguise 的准确率接近 97%,与人工翻译相似。
  • Linguise 还集成了 40 多个 CMS 和网站构建器,并且 集成了像 Laravel 这样基于 PHP 的网站。
  • 尽管 Linguise 会自动翻译,但它有一个实时编辑器,可用于编辑翻译结果。这样,翻译就可以根据业务偏好进行调整。.
  • 多语言页面的加载时间仅比原始语言页面长 5%。.
  • 我们的服务提供三种套餐,价格从每月15美元到45美元不等。虽然这是一项付费服务,但我们也提供为期30天的免费试用期,翻译字数上限为600,000词。.
  • 最后, Linguise 支持所有形式的客户帮助,包括指南文章、文档、产品新闻、YouTube 视频教程和 24/7 全天候支持聊天。.

综上所述, Linguise 可以成为面向 Laravel的云端 AI 翻译技术解决方案。.

准备好探索新市场了吗?免费试用我们的自动翻译服务,享受 1 个月无风险试用。无需信用卡!

Conclusion

在本文中,我们探讨了为 Laravel Web 应用程序实施 Google Cloud AI API 翻译与 Google 翻译之间的主要区别。.

Google Cloud AI API 翻译在准确性和高精度翻译需求方面表现出色。然而,该服务的配置更为复杂,且比 Google Translate 更昂贵。另一方面,Google Translate 易于集成,但在准确性和自定义选项方面存在局限。.

Linguise 作为一款基于云 AI 的替代翻译服务崭露头角,兼容 Laravel 网站。凭借几乎媲美人工翻译的准确度、翻译编辑器选项、快速加载时间以及全面的客户支持, Linguise 成为您 Laravel 网站的出色翻译解决方案。.

如果您想尝试 Linguise,您可以 注册一个免费账户 并享受 30 天试用期,翻译字数上限为 600,000 字。访问 linguise.com 了解更多信息!

您可能还感兴趣阅读

别错过!
订阅我们的新闻简报

获取有关网站自动翻译、国际SEO等的最新资讯!

Invalid email address
试一试吧。每月一次,您可以随时取消订阅。.

别走,留下您的邮箱!

我们无法保证您会中彩票,但我们可以承诺提供一些关于翻译的有趣资讯以及偶尔的折扣。.

别错过!
Invalid email address