Translation AI in Google Cloud
A friendly, step-by-step guide to the services that translate text, documents and speech between more than a hundred languages. Learn how machine translation works, which Google Cloud option fits which job, and how to build reliable multilingual products.
Imagine opening an online shop and discovering that most of your future customers do not read your language. A shopper in Brazil lands on your English page, hesitates, and leaves. A support request arrives in Japanese and nobody on your team can read it. A contract in German needs to be understood by lawyers in India by tomorrow. Language is one of the oldest walls between people, and for a growing business it is also a wall between you and your customers.
Translation AI is Google Cloud’s answer. It is a family of services that use machine learning to translate words, whole documents and even speech, quickly and at any scale. In this guide we begin from zero. We explain how machines learned to translate, what each Google Cloud option does, how to choose between them, and how to build a system that people can trust. Every new word is explained when it first appears, with everyday comparisons and practical examples along the way.
WWhat Is Translation AI in Google Cloud?
A first, simple picture before we open the details.
Machine translation means using a computer program to convert text from one human language into another. The language you start with is called the source language, and the language you want is the target language. Machine translation is something most people have already used, for example when a web browser offers to translate a page.
Translation AI is the name Google Cloud uses for its collection of translation services that developers and companies can build into their own products. At the centre is Cloud Translation, a service that you call from your software with a small request containing text, a source language and a target language. The reply contains the translation. Around this core sit extra capabilities: glossaries to protect important terms, document translation that keeps formatting, batch translation for huge volumes, custom and adaptive models that learn your style, and links to speech services for spoken language.
Think of Cloud Translation as a team of interpreters who work at a giant international office day and night. You hand them a note, tell them which language you need, and a few moments later you receive the translated note. You never meet the interpreters, you never worry about holidays or hiring, and you can send one note or a million notes.
A short history
Google Translate began in 2006 as a statistical service that learned patterns from millions of already translated documents. In 2016 Google moved to neural machine translation, which reads whole sentences and produces smoother, more natural output. The Cloud Translation API made this technology available to developers, first as a simple version and later as a richer Advanced edition with glossaries, batch and document features. More recently Google has added large language model approaches, including a Translation model based on Gemini technology and an Adaptive Translation feature that adjusts to your own examples. Names and features keep evolving, so always check the current documentation.
Translation AI is not one single button. It is a toolbox. The skill is choosing the right tool for each job, and this guide teaches that choice step by step.
TThe Problem: Reaching People in Their Own Language
Why translation matters so much, and why doing it by hand does not scale.
People prefer their own language
Surveys of online shoppers have repeatedly found that people are far more likely to buy when a page is in their own language, even if they speak some English. Support is similar: customers feel respected and understood when they get answers in their language. For software, translation is called localization when it also adjusts dates, currencies, units and cultural details, not only the words.
The cost of human-only translation
Professional human translators produce excellent work, but they are limited by time and money. A single product catalogue with fifty thousand items in twenty languages would need a million translated entries, and prices change every week. Hiring translators for every request is slow, and some content, such as chat messages, needs an answer in seconds.
Hand translation is like carrying water to a village in buckets. Each bucket is carefully filled, but there is only so much one person can carry. Machine translation is like laying a pipe: after the pipe is built, water flows all day for everyone. Human experts are still needed to check the water’s quality, but they no longer carry every drop.
What good translation must achieve
Accuracy
The meaning must be right. A wrong dosage on a medicine label or a wrong price can cause real harm.
Fluency
The text should read naturally, like something a native speaker would write.
Consistency
Brand names, product terms and legal phrases must be translated the same way every time.
Speed
Chat, search and live events need answers in a fraction of a second.
Scale
Millions of words per day, in dozens of languages, without extra staff.
Format
Documents, web pages and slides must keep their layout, images and styling.
Machine translation is very good and still imperfect. Treat it as a fast, scalable first draft for most content, and add human review wherever errors would be costly, such as legal, medical or safety text.
HHow Machine Translation Learned to Translate
Four big ideas in the history of translation by computer, told simply.
Rule-based translation
Early programs used dictionaries and grammar rules written by linguists. They were predictable but brittle, because languages have countless exceptions and idioms.
Statistical translation
Systems learned from huge collections of sentences already translated by humans, finding which phrases usually matched which. Output was better, but often clumsy, because it worked on small pieces of a sentence.
Neural machine translation
Neural networks, a kind of learning software inspired loosely by the brain, read the whole sentence and produce a whole sentence. Smoothness and grammar jumped forward.
Large language models
Very large models trained on enormous amounts of text can translate while also following instructions about tone, context and style, and can adapt from a few examples.
The key idea behind neural translation
A neural translation model has been shown many millions of pairs of sentences, one in each language. During training, it practises guessing the target sentence one small piece at a time and adjusts millions of internal numbers whenever it is wrong. After enough practice, it learns patterns such as word order, agreement and meaning. The most successful design is called the Transformer, which uses a mechanism named attention to decide which words in the source sentence matter most when writing each word of the translation.
Imagine an interpreter listening to a long sentence. When choosing the right word for “bank,” they look back at the clues: was the sentence about rivers or money? Attention is that glance back at the relevant clues. The model does this for every word it writes, so it stays aware of the whole sentence.
Why context matters
Many words have several meanings. The English word “light” can mean not heavy, not dark, or to ignite. A good model uses neighbouring words to choose the right meaning. Context can also come from outside the sentence, such as the type of document, the product category or the audience. Modern services let you supply some of this context through glossaries, custom examples or instructions.
How we judge a translation
People who study translation need ways to measure quality. A classic automatic score called BLEU compares the machine’s sentence with a human reference, rewarding matching word groups. Newer learned scores such as COMET and MetricX try to judge meaning more like a human reader. The gold standard is still careful human review, often using a checklist called MQM that counts errors by type and severity. We will return to measuring quality in a later chapter.
Automatic scores are handy for comparing two systems on the same test set, but they can miss subtle errors. Never use a single number as the only proof that a translation is good enough.
CCore Concepts You Must Know
A small vocabulary that makes the rest of the guide easy.
Source and target
The language of the original text and the language you want back. The source can often be detected automatically.
Language code
A short standard label for a language, such as en for English, hi for Hindi or es for Spanish. Some include a region or script.
Locale
A language together with a region and its habits, such as Portuguese in Brazil versus Portuguese in Portugal.
Translation model
The trained software that performs the translation. Different models suit different needs.
Glossary
A list of terms and their required translations, used to keep brand names and technical words consistent.
Adaptive translation
A way of steering a model with your own example sentence pairs, so it matches your style and vocabulary.
Batch translation
Translating many files at once in the background, with results saved to storage.
Document translation
Translating whole files such as PDFs and Word documents while keeping their layout.
Characters, not words
Translation services usually measure and bill your usage in characters, meaning letters, digits, punctuation and spaces, not in words. A short English sentence of forty characters costs less than a long paragraph of four thousand. Knowing this helps you estimate cost: count the characters in your content, multiply by the number of target languages, and compare with the current price per character.
Synchronous and asynchronous
A synchronous call means you send a request and wait a moment for the answer in the same connection. It suits short text where you need the result at once, such as translating a chat message. An asynchronous call means you submit a job and come back later for the results. It suits large files and big sets of text, where waiting on an open connection would be unwise.
A synchronous request is like asking a shop assistant a question at the counter and waiting for the reply. An asynchronous request is like leaving a big order at a print shop and being told to collect it tomorrow. Both are correct, and the right one depends on the size of the job.
Detecting language
When you do not know the source language, the service can detect it. This is useful for user-generated content such as reviews and messages. Detection is usually reliable for longer text and less reliable for very short phrases, names or mixed-language messages, so give extra context when you can.
If you already know the language, such as a field in your database, pass it explicitly. This saves the detection step and avoids occasional mistakes on short text.
TThe Translation AI Family: The Big Picture
Which services exist, and how they fit together.
flowchart LR
A["Websites and apps: text strings"] --> T["Translation AI services in Google Cloud"]
B["Documents: PDF, Word, slides"] --> T
C["Audio and video: speech and subtitles"] --> T
T --> O1["Translated text for users"]
T --> O2["Translated documents with layout kept"]
T --> O3["Live captions and spoken translations"]
The main members
| Service or feature | What it does | Best for |
|---|---|---|
| Cloud Translation Basic | Simple, fast translation of text using Google’s general neural model | Quick start, small apps, prototypes |
| Cloud Translation Advanced | Everything in Basic plus glossaries, batch, document translation, custom models and more control | Production systems and enterprise content |
| Glossaries | Force chosen translations for terms | Brand names, product terms, legal phrases |
| Adaptive Translation | Uses your example sentence pairs to match your domain and style | Specialist content such as medical, legal or marketing |
| Custom models | Models trained on your own translation data | Organisations with large collections of approved translations |
| Translation LLM and Gemini | Large language model based translation with more flexible instructions | Natural, context-rich translation and tone control |
| Document translation | Translates files while preserving layout | Contracts, manuals, presentations |
| Speech services working with Translation | Speech-to-Text and Text-to-Speech around translation | Live captions and spoken translation |
Google renames and reorganises AI products often. Some older offerings have been replaced or retired, such as certain portals and speech translation APIs. Confirm the current product list and availability in the official documentation before you design.
How the pieces connect to the rest of Google Cloud
- Cloud Storage holds files for batch and document translation and receives the results.
- Pub/Sub, Cloud Run and Cloud Functions trigger translation when new content arrives.
- BigQuery can call translation from SQL, which is handy for translating many table rows.
- Document AI and Vision read text from scanned images before translating.
- Dialogflow and contact center tools use translation for multilingual conversations.
- IAM, Cloud Monitoring and Cloud Logging provide access control, observability and audit trails.
BBasic Versus Advanced: Choosing an Edition
The first practical decision for most teams.
Cloud Translation Basic, sometimes called version two of the API, is the simple edition. It translates text, detects languages and lists supported languages. It is easy to try, and it can use simple API keys for access. It is a good fit for quick experiments and for apps that need only plain translation.
Cloud Translation Advanced, version three of the API, adds the features that serious projects need. It uses stronger access control through service accounts, lets you choose a processing location, and supports glossaries, batch translation, document translation, custom and adaptive models, and newer large language model translation. Most new production projects should plan for Advanced from the start.
Basic edition
- Very quick to start with a simple key
- Plain text and HTML translation
- Language detection and language list
- Fewer settings to learn
Advanced edition
- Glossaries, batch and document features
- Custom and adaptive models
- Location choice and finer access control
- More setup steps to learn and manage
| Need | Basic | Advanced |
|---|---|---|
| Translate short text quickly | Yes | Yes |
| Protect brand and product terms | No | Yes, with glossaries |
| Translate large sets of files in the background | No | Yes, with batch translation |
| Translate documents and keep the layout | No | Yes |
| Train or adapt to your own data | No | Yes |
| Choose where data is processed | Limited | Yes, through location settings |
| Access method | API keys or service accounts | Service accounts and OAuth |
Basic is like a pocket phrasebook: light, quick and good for simple needs. Advanced is like hiring an interpreter agency: more setup and more cost, but with specialists, style guides and the ability to handle big projects.
Which features are available in which edition, location and language pair changes over time. Verify against the current documentation, especially for custom models and large language model translation.
AArchitecture and the Life of a Request
What sits between your application and the translated text.
flowchart TD
CL["Your application or script"] --> EP["Cloud Translation API endpoint: Basic or Advanced"]
EP --> NMT["Neural machine translation model"]
EP --> LLM["Translation LLM"]
EP --> CUS["Custom or adaptive model"]
GL["Glossary stored in the chosen location"] -.-> EP
GCS["Cloud Storage for batch and documents"] -.-> EP
IAM["IAM and service accounts"] -.-> EP
MON["Cloud Monitoring and Logging"] -.-> EP
Reading the diagram
Your application never talks to a model directly. It talks to an API endpoint, which checks who you are, applies quotas and decides which model should do the work. The model might be Google’s general neural model, a large language model tuned for translation, or a model adapted to your data. Glossaries and files live in the background and are attached to the request when needed. Access control, logging and monitoring wrap around everything.
sequenceDiagram
participant App as Your Application
participant API as Translation API
participant GL as Glossary Store
participant M as Translation Model
App->>API: Send text, source and target language, optional glossary
API->>API: Check credentials and quota
API->>GL: Load glossary terms if requested
GL-->>API: Term pairs
API->>M: Translate sentences with glossary rules
M-->>API: Translated text
API-->>App: Return translations and detected language
The request step by step
Prepare the request
Your code collects the text, the target language, optionally the source language, the format such as plain text or HTML, and any glossary or model choice.
Authenticate
The call includes credentials, such as a service account token, proving that your application is allowed to use the project.
Check limits
The service checks quotas for requests and characters per minute, and the size of each request.
Split and translate
The text is divided into sentences or segments, translated by the chosen model, and put back together in order.
Apply glossary rules
If a glossary is attached, matching terms are forced to the required translation.
Return and record
The translated text and any detected language are returned, and usage is recorded for billing and monitoring.
Each request stands alone. The service does not remember earlier requests, so if context matters, send it along inside the same request or through a glossary or adaptive dataset.
IInside the Model: How Translation Really Works
A gentle look under the bonnet, with no mathematics required.
Step one: breaking text into pieces
Computers cannot read letters the way we do. Before translation begins, the text is cut into small units called tokens. A token may be a whole common word, a part of a long word, or a single character for rare words. Cutting words into reusable pieces lets the model handle names, new words and spelling mistakes without panicking, because it can still recognise familiar fragments.
Tokens are like building blocks. With a few hundred kinds of blocks you can build almost any word, just as a child with a box of bricks can build almost any house. The model learns which blocks usually follow which.
Step two: turning pieces into meaning numbers
Each token is converted into a long list of numbers called an embedding. Words with similar meaning end up with similar numbers. The word for “dog” sits near “puppy” and far from “invoice.” These numbers are the model’s private way of representing meaning, and, importantly, they work across languages: the English “water” and the Spanish “agua” land in similar places.
Step three: the encoder and the decoder
A classic translation model has two halves. The encoder reads the entire source sentence and builds a rich understanding of it. The decoder then writes the target sentence one token at a time, consulting the encoder’s understanding through attention before choosing each next token. It stops when it decides the sentence is complete.
flowchart LR
S["Source sentence"] --> TK["Split into tokens"]
TK --> EM["Convert to meaning numbers"]
EM --> EN["Encoder builds understanding"]
EN --> AT["Attention picks relevant parts"]
AT --> DE["Decoder writes one token at a time"]
DE --> TS["Target sentence"]
The diagram shows a simple line, but the middle steps repeat many times. The decoder writes the first token, then uses that token and the source understanding to write the second, and so on. If you have ever finished someone’s sentence in your head, you have done something similar.
Choosing among many possible sentences
At each step the model does not pick a single certain word. It scores thousands of candidates. A technique called beam search keeps several promising partial sentences alive at the same time and finally chooses the best complete one. This reduces the chance of a sentence that starts well and ends badly.
Beam search is like a traveller exploring a few promising roads at once instead of committing to the first road seen. After some distance, the traveller drops the poor roads and keeps the best one.
How training teaches the model
Training uses very large collections of parallel text, meaning sentences and their human translations side by side. Sources include public documents translated by international organisations, multilingual websites and curated datasets. The model repeatedly predicts a translation, measures how far it is from the human version, and adjusts its internal numbers a tiny amount. After billions of such adjustments the model becomes skilled. Languages with lots of parallel text, such as French or Spanish, are usually translated better than languages with little written material online.
Low-resource languages
A low-resource language is one with little digital text available. Research teams use clever tricks to help, such as training one model on many languages together so that knowledge from big languages helps small ones. Quality for these languages is improving, but it can still lag behind, so treat important output with extra care.
Models can mistranslate idioms, sarcasm, rare names and very specialised terms. They can also reflect biases found in training text, for example by guessing a gender for a person when the source language did not specify it. Review and testing exist to catch these cases.
TTranslating Text in Practice
The everyday job: send words, get words back.
What a request contains
- The contents: one or more strings of text to translate.
- The target language code: required, for example fr for French.
- The source language code: optional. If omitted, the service detects it.
- The format: plain text or HTML, so tags are handled properly.
- Optional controls: a glossary, a model choice, labels for cost tracking, and a location.
What comes back
For each input string you receive a translated string. If detection was used, you also receive the detected language and sometimes a confidence value. When a glossary was used, you may receive a second translated version that shows the glossary effect so you can compare.
Translating HTML safely
Web pages contain tags such as bold or links. If you send them as plain text, the model may translate or damage them. When you tell the service the content is HTML, it keeps tags in place and translates only the visible words. You can mark parts that must never be translated, such as brand names or code snippets, using a “do not translate” attribute or a special class that the service recognises. Check the current documentation for the exact marker.
Translating HTML is like translating the text on a printed greeting card without tearing the card. The tags are the card’s folds and decorations; the service must translate the message and leave the card intact.
Size, batching and limits
Each request can contain only a limited number of characters and strings. If you have a large list, group strings into sensible batches rather than sending thousands of tiny requests. Tiny requests waste time on network overhead, while a single enormous request may exceed limits. Keep batches modest, and design your code to split work automatically.
Caching to save money and time
Many applications translate the same phrases again and again, such as menu labels, product categories and error messages. Store each translation in a cache, a fast memory store keyed by the text, language and glossary version. Next time the same phrase appears, you read it from the cache and skip the paid call. Remember to clear the cache entry when the source text, glossary or model changes.
flowchart TD
R["Text to translate"] --> C{"Already in cache?"}
C -->|"Yes"| H["Return cached translation"]
C -->|"No"| API["Call Translation API"]
API --> W["Save result to cache"]
W --> H
Handling special content
Placeholders
Strings such as “Hello, {name}” need the placeholder protected so it is not translated or reordered incorrectly.
Numbers and units
Dates, prices and measurements need locale rules. Format them separately when you can.
Short fragments
A single word like “Book” could be a noun or a verb. Provide context or full phrases.
Right-to-left languages
Arabic and Hebrew need interface layouts that flip direction.
Models translate better with full sentences. Avoid building a sentence out of many separately translated words, because grammar differs between languages and the pieces rarely fit back together.
GGlossaries: Protecting Your Important Words
How to make sure your brand and technical terms are always translated your way.
A glossary is a list of source terms with the exact translation you want for each. Without one, the model might translate a product name as an ordinary word, or translate a technical term in several different ways across your site. With one, the service replaces or guides the translation of those terms every time.
A glossary is the sticky note you give a new interpreter on their first day: “Always say Utivra, never translate it. Always say ‘invoice’ as ‘factura’ here.” The interpreter still does the translating, but obeys the note.
Two kinds of glossary
| Kind | Meaning | Example use |
|---|---|---|
| Unidirectional | One source language to one target language, one direction only | English “shopping cart” always becomes the chosen Spanish phrase |
| Equivalent term sets | Groups of equivalent terms across several languages, usable in any direction | A company term list covering English, German, French and Japanese |
Where glossaries live
You prepare the glossary as a simple file, for example a table of columns separated by tabs or commas, or a translation memory exchange file. You upload it to Cloud Storage and then create a glossary resource in the Translation service, in a particular location. When you translate, you reference the glossary by name. The glossary and the translation request must use the same location.
Collect terms
Ask product, legal and marketing teams for the words that must stay consistent.
Write the file
List each source term next to its approved translation, one pair per line.
Upload and create
Place the file in Cloud Storage and create the glossary resource for that language pair.
Use in requests
Reference the glossary in each translation request that needs it.
Review and improve
Check outputs, update terms, and keep a versioned history.
Glossary design tips
- Keep entries short and exact. Long sentences belong in a translation memory or adaptive dataset instead.
- Include different word forms where the language needs them, since glossaries match terms, not the grammar around them.
- Decide whether matching should ignore capital letters, and test the effect.
- Avoid contradictions, such as the same source term mapped to two different targets.
- Give every glossary an owner who approves changes.
A glossary forces a term, but the sentence around it must still be grammatical. In languages with cases or genders, the forced term may not match the surrounding words perfectly. Test with real sentences and consider adaptive translation or a language-model approach for the hardest cases.
AAdaptive Translation and Custom Models
When the general model is good, but your content is special.
General models know everyday language well. Your company, however, may use special vocabulary, a particular tone, or a style that only your past translations reveal. Google Cloud offers two ways to teach the service about your world.
Adaptive Translation
Adaptive Translation uses a small set of your own example sentence pairs, called a dataset. At translation time, the service picks the most relevant examples for the sentence in front of it and uses them to steer a large language model. You do not run a long training job; you simply upload examples and the service uses them immediately. This works well when you have a modest amount of high-quality approved translations, such as a few hundred or a few thousand pairs.
It is like showing a new employee a folder of past letters before they write a new one. They read the three most similar letters, copy the tone and wording, and produce a letter that sounds like your company.
Custom models
A custom model is trained on a larger collection of your sentence pairs, building on Google’s base model through a process called fine-tuning. It requires more data, more preparation and a training run, but results can be tailored deeply and reused at scale. Google has changed the AutoML-style offerings over time, so check which custom training options are currently supported and recommended before starting.
Adaptive Translation
- Start with a small dataset
- No separate training job to wait for
- Update examples at any time
- Good for tone and domain wording
Custom models
- Need larger, cleaner datasets
- Training takes time and effort
- Retraining is needed to absorb changes
- Strongest when volume is high and stable
Preparing good data
Quality beats quantity. Collect translations that human experts approved, remove duplicates, fix alignment errors where a source line is paired with the wrong target, and split off a separate test set that the model never sees during training. Remove personal or confidential data that should not travel into a dataset. Keep records of where each pair came from.
flowchart LR
A["Approved past translations"] --> B["Clean and align pairs"]
B --> C["Split into training and test sets"]
C --> D["Create adaptive dataset or train custom model"]
D --> E["Evaluate on the test set"]
E --> F{"Better than general model?"}
F -->|"Yes"| G["Use in production"]
F -->|"No"| H["Improve data and try again"]
H --> B
Start with the general model. Add a glossary if terms are inconsistent. Add adaptive examples if style is the problem. Consider a custom model only when simpler steps are not enough and you have the data to support it.
TTranslation LLM and Gemini on Vertex AI
Using large language models when you want flexibility, tone and context.
A large language model, or LLM, is a very large neural network trained on huge amounts of text. It can translate, but it can also follow written instructions. That makes it useful when a plain translation is not enough. You can tell it who the audience is, which tone to use, which words to keep and what the text is for.
Google Cloud offers LLM translation in two main ways. One is a Translation LLM option inside the Cloud Translation family, tuned specifically for translation. The other is general Gemini models on Vertex AI, Google Cloud’s platform for building with AI models, where you write a prompt describing the translation task. Availability and names change quickly, so check the current model list.
The classic neural model is a very fast specialist interpreter who works from a standard form. An LLM is a talented writer who also speaks several languages. Ask it for a friendly tone for teenagers, or a formal one for lawyers, and it adjusts, but it may also take more time and occasionally get creative when you wanted it literal.
What LLMs add
- Tone and register control: formal or casual, marketing or technical.
- Context awareness: understanding of surrounding paragraphs.
- Rewriting and explanation: simplifying, summarising, or explaining while translating.
- Few-shot learning: following a handful of examples inside the prompt.
What to watch for
- Consistency: results can vary slightly between runs.
- Over-helpfulness: the model may add explanations or skip hard parts unless you instruct it clearly.
- Cost and latency: often higher than the classic model for the same text.
- Prompt sensitivity: small wording changes can change results, so test prompts like code.
| Question | Classic neural model | LLM based |
|---|---|---|
| Speed | Very fast | Usually slower |
| Cost for large volume | Usually lower | Usually higher |
| Tone control | Limited | Strong |
| Consistency run to run | Very stable | Can vary |
| Handling long context | Sentence level mostly | Paragraph or document level |
| Good for | Bulk, support chat, product feeds | Marketing, creative and nuanced text |
If you translate text written by users, a malicious user could write words like “ignore your instructions.” With LLM approaches, treat user text strictly as data, keep your instructions separate, and test for this behaviour. This is called prompt injection.
BBatch Translation: Translating in Bulk
When you have thousands of files, do not wait at the counter.
Batch translation lets you submit many files at once. You place them in a Cloud Storage bucket, tell the service the languages you want, and name an output bucket. The job runs in the background, and the translated files appear in the output location when finished. Because it is asynchronous, the service returns an operation, a kind of receipt, which you can check for progress and completion.
flowchart LR
IN["Input bucket: source files"] --> B["Batch translation job"]
B --> OUT["Output bucket: one folder per language"]
B --> OP["Operation status"]
OUT --> PS["Pub/Sub message or workflow step"]
PS --> BQ["Index in BigQuery or publish to website"]
Typical settings
- Input files and MIME types: plain text, HTML and other supported formats.
- Target languages: you can request several in a single job.
- Output location: a Cloud Storage prefix; results are organised by language.
- Glossaries and models: optional, per language pair.
- Labels: tags such as team and project for cost tracking.
Batch translation is like dropping a pile of laundry at a service. You hand it over with instructions, leave, and pick it up later. Washing it by hand one shirt at a time while standing at the counter would be silly.
Designing a reliable batch pipeline
Detect new content
A trigger fires when a new file lands in the input bucket or when your content system publishes.
Submit the job
A small function or workflow starts the batch translation with the right glossary and languages.
Track completion
Poll the operation, or listen for a completion event, and record the job status.
Validate
Check that every expected file exists, is non-empty and passes simple quality tests.
Publish or review
Send translations straight to the website, or to human reviewers for sensitive content.
Name output folders by date or version, and make your pipeline safe to run again. If a job fails halfway, you should be able to re-submit it without creating duplicate or conflicting results.
DDocument Translation: Keeping the Layout
Translating files such as contracts, manuals and presentations without breaking their look.
Document translation accepts whole files, such as PDF, Word, PowerPoint and Excel files, and returns a translated file in the same format. The service reads the text, translates it, and puts it back in the same position with similar fonts, tables, headers and images. This saves hours compared with copying text out, translating it, and rebuilding the design by hand.
It is like a skilled sign painter who replaces the words on a shop sign in a new language but keeps the same colours, frame and style. A plain text translator would give you the words on a loose sheet and leave you to repaint the sign.
Scanned documents
A scanned PDF is really a picture of text. The service may use OCR, short for optical character recognition, which is software that reads text from images. Quality depends on scan clarity. Blurry pages, handwriting, unusual fonts and complex tables increase errors. For important scans, consider a separate extraction step with Document AI, review the extracted text, then translate it.
Things to check after translation
- Text that became longer and overflowed boxes, since German or Finnish can be much longer than English.
- Fonts that lack characters for the target script.
- Tables and footnotes that moved or merged.
- Text inside images, which usually stays untranslated unless OCR handled it.
- Page numbers, references and tables of contents that need updating.
flowchart TD
U["Upload document"] --> T{"Scanned or digital?"}
T -->|"Digital"| TR["Translate with layout preserved"]
T -->|"Scanned"| OC["Read text with OCR"]
OC --> TR
TR --> QA["Automatic checks"]
QA --> HR{"High risk content?"}
HR -->|"Yes"| REV["Human review"]
HR -->|"No"| PUB["Deliver translated file"]
REV --> PUB
Supported file types, maximum file sizes, page counts and locations differ by feature and change over time. Look them up before promising a workflow to your users.
SSpeech and Real-Time Translation
From the spoken word in one language to captions or voices in another.
Translation AI works on written text. To translate speech, you chain services together. First, Speech-to-Text listens to audio and writes down what was said. Then Cloud Translation converts that text into the target language. Finally, if you want a spoken result, Text-to-Speech reads the translated text aloud in a natural voice. Google has also offered dedicated speech translation products in the past, and these have changed over time, so verify what is currently available.
flowchart LR
MIC["Speaker audio stream"] --> STT["Speech-to-Text"]
STT --> TR["Cloud Translation"]
TR --> CAP["Live captions on screen"]
TR --> TTS["Text-to-Speech"]
TTS --> LIS["Listener hears translated voice"]
This is a relay race with three runners. The first runner (Speech-to-Text) turns sound into words, the second (Translation) changes the language, and the third (Text-to-Speech) turns words back into sound. Each runner is good at one thing, and the baton passes quickly.
Why speech is harder
- Errors add up: a mistake in listening becomes a mistake in translation.
- No punctuation in speech: sentence boundaries must be guessed, and wrong guesses hurt translation.
- Accents, noise and overlapping voices reduce accuracy.
- Latency matters: a three-second delay can ruin a conversation.
Practical advice
- Use streaming recognition for live events, and show captions as partial results arrive.
- Wait for a natural pause before translating, to avoid translating half-finished sentences.
- Supply speech hints such as product names to improve recognition.
- Allow users to see the original transcript next to the translation, so they can notice mistakes.
For recorded videos you have time. Transcribe, fix the transcript, translate, review and then add subtitles. The extra review step greatly improves quality compared with live work.
CChoosing the Right Approach
A simple decision guide for the most common situations.
flowchart TD
S["What are you translating?"] --> Q1{"Spoken audio?"}
Q1 -->|"Yes"| SP["Speech-to-Text, then Translation, then Text-to-Speech if needed"]
Q1 -->|"No"| Q2{"Whole files with layout?"}
Q2 -->|"Yes"| DOC["Document translation"]
Q2 -->|"No"| Q3{"Large volume, not urgent?"}
Q3 -->|"Yes"| BAT["Batch translation"]
Q3 -->|"No"| Q4{"Need special tone or context?"}
Q4 -->|"Yes"| LLM["Translation LLM or Gemini"]
Q4 -->|"No"| Q5{"Need fixed terms or your style?"}
Q5 -->|"Terms"| GLO["Advanced with glossary"]
Q5 -->|"Style"| ADA["Adaptive Translation"]
Q5 -->|"Neither"| BAS["Basic or Advanced text translation"]
| Situation | Suggested approach | Why |
|---|---|---|
| Chat messages between customers and agents | Advanced text translation, fast model | Low delay, high volume |
| Product catalogue of fifty thousand items | Batch translation with glossary | Large, consistent, not urgent |
| Marketing campaign slogans | LLM translation with tone instructions, human review | Style and creativity matter |
| Legal contracts | Document translation plus expert human review | Accuracy and layout both matter |
| Support articles in a specialist field | Adaptive Translation or custom model plus glossary | Domain wording |
| Webinar with live subtitles | Speech-to-Text plus Translation | Real-time captions |
| Quick internal prototype | Basic edition | Fastest start |
Real systems often mix methods. A website may use batch translation for pages, instant translation for user comments, a glossary everywhere, and human review only for the checkout and legal pages.
MMeasuring Translation Quality
How to know whether a translation is good enough to publish.
Quality is not a single number. A translation can be fluent but wrong, or accurate but awkward. A good measurement plan looks at several angles and matches the effort to the risk of the content.
BLEU and chrF
Compare the machine output with a reference by counting matching words or character groups. Quick and cheap, but blunt.
COMET and MetricX
Learned scores that look at meaning and correlate better with human judgment, though they still need care.
MQM review
Reviewers mark errors by category and severity, such as accuracy, fluency, terminology and style.
Sampling
Check a random sample each week rather than everything. Increase the sample for risky content.
Outcome metrics
Watch conversion, support satisfaction, complaints and returns by language.
Round-trip checks
Translate back to the original language to spot gross errors. Useful as a rough alarm only.
Build a test set
Collect a few hundred representative sentences per language pair. Include easy cases, tricky ones with idioms and numbers, text with placeholders, and examples of your key terms. Have a skilled person write or approve the reference translations. Re-run this test whenever you change models, glossaries or prompts so you can compare results fairly.
A test set is like an exam paper that stays the same every year. If this year’s students score higher, you can trust the teaching improved. If the exam changed every year, the scores would tell you nothing.
Risk-based review
| Content risk | Examples | Review level |
|---|---|---|
| Low | User comments, internal search | Machine only, spot checks |
| Medium | Product pages, help articles | Machine plus sampled human review |
| High | Legal, medical, safety, finance | Machine draft then full expert review |
LLocalization Workflow and Translation Memory
How translation fits into the way teams actually ship products.
Localization is the full process of preparing a product for a language and region. Translation is one step. Others include adapting dates, currencies, images, colours and legal text, and testing the result with local users. Many teams manage this in a translation management system, a tool that tracks strings, versions, reviewers and deadlines.
A translation memory is a database of past source sentences and their approved translations. When a new sentence is identical or very similar to an old one, the system reuses the approved translation, saving cost and keeping wording consistent. Machine translation fills the gaps where no match exists.
Translation memory is a recipe book of dishes your kitchen already cooked and your customers loved. When an order matches a known dish, you follow the recipe. For a brand new dish, the chef (machine translation) makes a first attempt and the head chef (a reviewer) tastes it.
flowchart LR
A["Developers add or change text"] --> B["Extract strings"]
B --> C{"Match in translation memory?"}
C -->|"Yes"| D["Reuse approved translation"]
C -->|"No"| E["Machine translation with glossary"]
E --> F["Human review where needed"]
F --> G["Save to translation memory"]
D --> H["Merge into product"]
G --> H
H --> I["Test with local users"]
Habits that make localization smooth
- Internationalise first: design software so text, dates and numbers can change without code changes.
- Never glue strings together: write whole sentences with placeholders, since word order differs by language.
- Give translators context: screenshots and notes reduce ambiguity.
- Plan for text expansion: allow extra room in layouts.
- Treat language as continuous: new text arrives every sprint, so automate the flow.
IIntegrating with the Rest of Google Cloud
Translation is most useful when it is wired into your workflows.
Cloud Storage
Holds source files, glossaries and translated output. The foundation of batch and document work.
Pub/Sub and Eventarc
Announce that a new file or message arrived so translation starts automatically.
Cloud Run and Cloud Functions
Small services that receive events, call the API and store results.
Workflows and Cloud Composer
Coordinate multi-step pipelines such as translate, review, publish.
BigQuery
Translate columns of text in place with a built-in function, and analyse results by language.
Document AI and Vision
Extract text from scans and forms before translation.
Dialogflow and contact centre tools
Support multilingual chatbots and agent assistance.
Search and recommendation services
Index translated content so users can search in their own language.
A common event-driven pattern
A new article is saved to a bucket. A storage event notifies a small service. The service starts a translation job for each target language, saves the results to another bucket, and announces completion through a message. A final step publishes the pages and updates the search index. Because each step is small and independent, failures can be retried individually.
It is a postal sorting office. Parcels arrive, are scanned, sent to the right belt, handled by the right worker and delivered. No one person does everything, and a jammed belt does not stop the whole building.
If your text already lives in a data warehouse, translating it where it sits avoids moving data around. Check how the feature is billed and which model it uses before running it over large tables.
SSecurity, Privacy and Compliance
Translation often touches sensitive text, so protect it carefully.
Who can call the service
Access is controlled with IAM, Google Cloud’s identity and access management system. You grant roles, such as a role allowing the use of the Translation API, to specific people or service accounts, which are identities for programs. Follow the principle of least privilege: give each program only the permissions it needs. Basic can use API keys, but keys are easy to leak, so restrict them to specific APIs and applications, and prefer service accounts wherever possible.
IAM is the keycard system of an office building. A cleaner’s card opens the cleaning cupboard and the front door, not the finance office. A service account is the keycard given to a robot.
Protecting data
- In transit: calls use encrypted connections (TLS).
- At rest: files in Cloud Storage and glossaries are encrypted by default, and you can use your own keys for extra control where supported.
- Data use: read Google’s current terms for how customer content is handled and whether it is used to improve models. Confirm this for your edition and contract.
- Sensitive details: consider removing or masking personal data such as names and account numbers before translation, using a data loss prevention tool, and restoring them afterward.
Location and residency
Advanced lets you choose a location for processing and storing glossaries and models. If laws or contracts require data to stay in a region, choose accordingly, and confirm which features and models are available in that region. Additional perimeter controls, such as VPC Service Controls, can reduce the risk of data leaving your protected environment; verify support for the Translation APIs in current documentation.
Audit and accountability
Audit logs record who called which admin operations and, depending on configuration, data access. Review them regularly, alert on unusual patterns such as a sudden jump in usage from one account, and keep an inventory of who owns each glossary and dataset.
A stolen API key can be used to run up large bills quickly, because translation is billed per character. Restrict keys, rotate them, set budget alerts and quotas, and never place keys in public web page code.
Compliance thinking
Regulations such as privacy laws, healthcare rules and sector standards may apply to the text you translate. Ask your compliance team early. Keep records showing that translations of regulated content went through the required human review, because a machine alone is usually not accepted as the final authority for legal or medical meaning.
PPerformance, Quotas and Reliability
Keeping translation fast and dependable when traffic grows.
Quotas
A quota is a limit on how much you can use in a period, for example characters per minute or requests per minute. Quotas protect the shared service and also protect you from runaway bills. You can often view current values in the console and request increases. Plan for peak traffic, not average traffic, such as a sales day when many pages are translated at once.
Handling errors gracefully
Networks and services sometimes fail briefly. Good clients retry failed calls after waiting, and the wait grows with each attempt. This approach, called exponential backoff, prevents a crowd of clients from hammering a struggling service. Add a small random delay, called jitter, so retries do not all land at the same instant. Do not retry errors that will never succeed, such as invalid language codes or permission problems.
sequenceDiagram
participant C as Client
participant API as Translation API
C->>API: Request 1
API-->>C: Temporary error
C->>C: Wait a short time with jitter
C->>API: Request 2
API-->>C: Temporary error
C->>C: Wait longer
C->>API: Request 3
API-->>C: Translation returned
Fallbacks
Decide in advance what happens if translation is unavailable. Options include showing the original text with a small notice, showing a cached older translation, or queuing the request for later. Never block a whole page because a single comment could not be translated.
Speed techniques
- Translate in advance for stable content, not at the moment of the visit.
- Cache results at several levels: application, edge and browser.
- Send several strings in one request, within limits.
- Translate only text that changed.
- Place your services in the same region as the translation location to reduce travel time.
Pre-translating stable content is like cooking meals in advance for a busy week. On the day you only reheat. Translating everything at the moment of the visit is like cooking from scratch for every guest who walks in.
MMonitoring, Logging and Cost Control
See what is happening and keep the bill under control.
What to watch
Cloud Monitoring collects metrics from Google services and lets you draw dashboards and set alerts. Cloud Logging stores log entries. Together they answer questions such as: Did usage double overnight? Are errors rising for one language pair? Is one service account suddenly very busy?
Understanding the bill
Translation is generally billed per character translated, with different rates for different features, such as standard text translation, document translation, custom models and LLM-based options. Some plans include a monthly free amount. Because pricing changes, use the current pricing page and the pricing calculator rather than relying on old numbers.
Estimate
Count characters in your content, multiply by target languages, apply the current rate.
Label
Tag requests so spend can be split by team, product and environment.
Budget and alert
Create budgets with notifications at several thresholds.
Reduce waste
Cache, deduplicate, translate only changes and skip untranslatable text such as codes or already translated content.
Review monthly
Compare cost with business value for each language.
Product codes, URLs, email addresses and text that is already in the target language cost money but add no value. Filter them out before calling the service.
AA Worked Example: A Multilingual Online Shop
Putting the pieces together for a made-up but realistic business.
Imagine a shop called “Lotus Home” that sells kitchenware. It has twelve thousand products, a help centre, customer reviews, and a support chat. It wants to serve customers in Spanish, German, Hindi and Japanese. The team plans the work in layers, using the right tool for each type of content.
| Content | Method | Review |
|---|---|---|
| Product titles and descriptions | Batch translation with a glossary of brand and material terms | Sampled review per language |
| Marketing banners | LLM translation with tone instructions | Human editor approves every banner |
| Help centre articles | Adaptive Translation using approved past answers | Sampled review |
| Customer reviews | On-demand translation with caching | None, labelled as machine translated |
| Support chat | Fast text translation both directions | Agents see original and translation |
| Return policy and terms | Document translation draft | Full legal review |
Build the glossary
The team lists brand names, material words and product line names, and agrees the translations with local staff.
Create the test set
Two hundred sample sentences per language, checked by native speakers, become the benchmark.
Run the catalogue batch
A nightly job translates only changed products and writes results to a bucket per language.
Wire up chat
The chat service translates each message, caches common phrases, and falls back to the original text on errors.
Watch the dashboard
Dashboards show spend, errors and customer satisfaction per language, and alerts fire when spend jumps.
Learn and improve
Reviewer corrections feed back into the glossary and the adaptive dataset every month.
The shop is acting like a hotel that hires different helpers for different guests: a fast phrasebook for quick chats, a polite interpreter for important meetings and a certified translator for contracts. Nobody uses the most expensive helper for everything.
AAdvantages, Disadvantages and Trade-offs
An honest balance sheet before you commit.
Advantages
- Huge language coverage without hiring many people
- Answers in a fraction of a second
- Scales from one sentence to millions of files
- Cost is based on use, with no servers to manage
- Glossaries and adaptive data add control
- Integrates with other Google Cloud services
- Quality keeps improving as models improve
Disadvantages
- Errors still occur, especially with idioms and rare languages
- Weaker handling of cultural nuance and humour
- Quality differs between language pairs
- Costs grow with volume and number of languages
- Product names and features change over time
- Sensitive text needs careful governance
- LLM options can be less predictable
Key trade-offs
| Trade-off | One side | The other side |
|---|---|---|
| Speed versus nuance | Classic model: very fast | LLM: slower, more flexible |
| Cost versus control | Basic: cheap and simple | Advanced and custom: more control, more setup |
| Consistency versus naturalness | Strict glossaries enforce terms | Free translation reads smoother |
| Automation versus assurance | Fully automatic pipelines are cheap | Human review is slower but safer |
| Real time versus quality | Instant translation of live text | Pre-translated, reviewed content |
DDesign Patterns and Anti-patterns
Habits that help, and habits that hurt.
Helpful patterns
Translate once, serve many
Translate when content changes, store the result, and serve the stored copy to all visitors.
Translation gateway
Put one internal service in front of the API so all teams share caching, glossaries, limits and monitoring.
Human in the loop
Route risky or low-confidence content to reviewers, and learn from their edits.
Layered fallbacks
Try the cache, then the live service, then the original text with a notice.
Language-aware routing
Send each language pair to the method that tests best for it.
Feedback loop
Let users flag bad translations and feed confirmed fixes into glossaries and datasets.
Anti-patterns to avoid
Translating at every page view
Calling the service for the same text again and again wastes money and slows pages. Translate once, cache, and refresh only when the source changes.
Building sentences from translated fragments
Joining separately translated words ignores grammar. Translate complete sentences with placeholders.
Trusting machine output for high-risk text
Publishing legal or medical translations without expert review can cause real harm and liability.
Shipping API keys in public code
Keys in browser code can be copied and abused. Call the service from your own back end with a service account.
Never measuring
Switching models or prompts without a test set means you cannot tell whether quality improved or got worse.
One glossary for everything
A giant, unowned glossary full of conflicts hurts quality. Keep focused glossaries with named owners and version history.
BBest Practices, Common Mistakes and Troubleshooting
A checklist you can use on your first project.
Best practices
- Begin with a clear list of languages and content types, ranked by business value.
- Choose Advanced for production, and the simplest method that meets quality needs.
- Create glossaries early, with owners and approval steps.
- Build a test set and keep scores over time.
- Mark machine-translated content honestly when users might rely on it.
- Design layouts for text expansion and right-to-left languages.
- Use service accounts, least privilege, budgets and alerts from day one.
- Keep source text clean: fix typos and ambiguity before translating, since errors multiply.
- Write short, clear source sentences; they translate better.
Common mistakes
- Assuming all languages have equal quality.
- Forgetting that glossary and request locations must match.
- Sending HTML as plain text and breaking tags.
- Translating code, product IDs or URLs.
- Ignoring user feedback from native speakers.
- Treating pricing, limits and product names as permanent.
Troubleshooting guide
| Symptom | Likely cause | What to try |
|---|---|---|
| Permission denied | Missing role, wrong project or API not enabled | Check the service account role, enable the API, confirm the project |
| Glossary not applied | Wrong location, wrong language pair, or term not matching the exact text | Match locations and language codes; test with exact term forms |
| Broken page after translation | HTML sent as plain text | Set the HTML format and protect no-translate parts |
| Wrong source language detected | Very short or mixed-language text | Pass the source language explicitly |
| Quota or rate errors | Traffic spike or tiny requests | Batch strings, add backoff, request quota increases |
| Bill higher than expected | Repeated translation, untranslated codes, leaked key | Add caching and filters, check labels, rotate keys |
| Document layout broken | Text expansion or unusual fonts | Adjust the source layout, review and fix manually |
| Inconsistent LLM output | Loose prompt | Tighten instructions, add examples, test repeatedly |
RReal-World Patterns Across Industries
Illustrative scenarios showing how organisations typically use Translation AI.
Online retail and marketplaces
Sellers list products in their own language. Batch translation publishes listings in many languages, glossaries protect brand names, and reviews are translated on demand with caching so shoppers can read feedback from other countries.
Customer support
An agent sees a customer message in Portuguese, reads the translation, and replies in English that is translated back. The agent can open the original at any time. Common questions are answered by multilingual self-service articles.
Travel and hospitality
Hotels and booking sites translate descriptions, policies and guest messages. Live chat translation helps front desk staff, while reviewed translations are used for cancellation rules and legal terms.
Media and education
Publishers and training teams create subtitles and transcripts for videos using a transcribe, translate and review workflow, widening audiences without recording every lesson again.
Legal, finance and healthcare
Teams use machine translation to understand foreign documents quickly and triage them, then send important ones to certified translators. Strict access control, regional processing and audit trails are central.
Software and gaming
Product teams translate interface strings, release notes and community posts continuously, with translation memory and glossaries ensuring that feature names stay stable across updates.
Public sector and non-profits
Agencies publish forms and notices in the languages their communities speak, using machine drafts that local reviewers refine so that critical information is accurate and respectful.
These are typical patterns, not claims about particular companies. For real customer stories, read the case studies published by Google Cloud.
GGlossary of Terms
Quick definitions of the words used in this guide.
| Term | Plain meaning |
|---|---|
| Source and target language | The language you start with and the one you want |
| Neural machine translation | Translation by learning software that reads whole sentences |
| Transformer and attention | The model design and the trick that lets it focus on relevant words |
| Token | A small piece of text that models read |
| Embedding | A list of numbers that represents meaning |
| LLM | A very large model trained on text that follows instructions |
| Glossary | A list of terms and required translations |
| Adaptive Translation | Steering the model with your own example pairs |
| Fine-tuning | Further training of a model on your own data |
| Batch translation | Background translation of many files |
| Operation | A receipt for a long-running job that you can check |
| OCR | Reading text from images |
| Translation memory | A store of approved past translations |
| Localization | Adapting a product to a language and region |
| BLEU, COMET, MQM | Ways to score translation quality |
| IAM and service account | Access control, and an identity for a program |
| Quota | A usage limit in a period |
| Exponential backoff | Retrying with growing waits |
| Prompt injection | Hidden instructions in text meant to trick a model |
FFrequently Asked Questions
They share technology, but Google Translate is a consumer product. Translation AI in Google Cloud is the set of services developers use to build translation into their own applications, with business controls such as access management, glossaries and billing.
The core service supports well over a hundred languages, but the exact number and which pairs work with each feature change. Check the current supported languages page.
Use Basic for a quick experiment. For anything going to production, plan on Advanced because glossaries, batch, documents and finer security are there.
Yes. Use a glossary that maps the brand name to itself, or mark that text as not to be translated in HTML content.
For HTML text, tags are preserved. For files, document translation keeps layout as far as possible, though you should check the result, especially when text becomes longer.
Choose an LLM when tone, context or rewriting matter, such as marketing text. Choose the classic model for speed, low cost and stable results on large volumes.
Usually not at first. Try the general model, then a glossary, then adaptive examples. Custom training is for cases with large, clean data and a clear need.
Data is encrypted in transit and at rest, and you control access with IAM. For details on how customer content is used and where it is processed, read Google’s current terms and location documentation, and involve your compliance team.
Mostly by the number of characters processed, with different rates by feature and sometimes a free monthly amount. Check the pricing page for current numbers.
Yes, by combining Speech-to-Text, Translation and optionally Text-to-Speech in a pipeline.
For high-stakes content, yes. For everyday content, machine translation with sampled review is often enough. Humans also create the glossaries and approved examples that make the machine better.
Cache translations, translate only changes, filter out text that needs no translation, use the simplest suitable method and set budgets with alerts.
SSummary and Key Takeaways
The whole guide in one short page.
Translation AI in Google Cloud is a toolbox, not a single tool. It begins with fast neural translation of text and grows to include glossaries for consistent terms, adaptive and custom models for your own style, large language models for tone and context, batch and document translation for scale, and speech chains for live and recorded audio. The best results come from matching the method to the content, measuring quality honestly, protecting data and keeping humans involved where the stakes are high.
Key takeaways
- Pick the simplest tool that meets the need: Basic for trials, Advanced for production, LLMs for nuance and batch for volume.
- Use glossaries to protect brand and technical terms, and adaptive data to capture your voice.
- Translate once, cache the result, and send only what changed to save money and time.
- Measure quality with a fixed test set and risk-based human review, never with one score alone.
- Secure access with service accounts and least privilege, choose locations carefully and set budgets and alerts.
- Plan for retries, fallbacks and monitoring so translation never breaks the rest of your product.
- Check current documentation for product names, limits, languages and pricing, because they change often.