You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

谷歌云翻译西语译意大利语返回英语异常问题咨询

Troubleshooting Google Cloud Translate's Spanish-to-Italian Unexpected English Output

Hey Ramón, sorry to hear you're stuck with this frustrating translation quirk—let's break down what might be happening and how to fix it.

Why This Might Be Happening

The phrases {Código de calendario} and {Nombre del calendario} are common technical terms, and it seems Google Translate's default model is falling back to English for these terms when translating from Spanish to Italian. This often happens because technical jargon is widely standardized in English across many industries, so the model might prioritize that over the direct Italian equivalent unless explicitly guided.

Fixes to Try

1. Use Custom Glossaries (Most Reliable)

The best way to enforce accurate term translations is to create a custom glossary in Google Cloud Translate that maps your Spanish terms directly to their Italian counterparts. Here's how you can implement this in your C# code with the V3 SDK:

First, create a glossary in your Google Cloud project with these term pairs:

  • Código de calendario → Codice di calendario
  • Nombre del calendario → Nome del calendario

Then, reference the glossary in your translation request:

using Google.Cloud.Translate.V3;

var client = TranslationServiceClient.Create();
var glossaryPath = "projects/YOUR_PROJECT_ID/locations/global/glossaries/YOUR_GLOSSARY_NAME";

var request = new TranslateTextRequest
{
    Contents = new[] { "{Código de calendario};{Nombre del calendario};" },
    TargetLanguageCode = "it",
    SourceLanguageCode = "es",
    GlossaryConfig = new TranslateTextGlossaryConfig
    {
        Glossary = glossaryPath
    }
};

var response = client.TranslateText(request);
foreach (var translation in response.Translations)
{
    Console.WriteLine(translation.TranslatedText);
}

This will force the model to use your predefined Italian terms instead of falling back to English.

2. Add Context to Your Text

Isolated phrases are more likely to be misinterpreted. Try wrapping your terms in a simple sentence to give the model more context:

Original: El {Código de calendario} y el {Nombre del calendario} son campos obligatorios en el formulario.

After translation, you can extract the specific terms from the full sentence output.

3. Verify Request Parameters

Double-check that your TargetLanguageCode is explicitly set to "it" (the ISO 639-1 code for Italian) and that SourceLanguageCode is set to "es" for Spanish. Sometimes ambiguous source/target settings can lead to unexpected fallback languages.

4. Experiment with Different Models

Try specifying the latest neural machine translation (NMT) model in your request, as newer models might handle term consistency better. Add this to your TranslateTextRequest:

Model = "projects/YOUR_PROJECT_ID/locations/global/models/nmt"

Since you're seeing the same issue on the public translate.google.com site, this confirms it's a model-level behavior rather than an SDK-specific bug—so the glossary approach should resolve it across both the SDK and the web interface once the glossary is applied.

内容的提问来源于stack exchange,提问作者Ramón García

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.11 08:18:52