Adopt DeepL Glossary now to unify terminology across your projects and shorten review cycles. A centralized glossary keeps domain terms aligned with client expectations, whether you work in legal, tech, or life sciences, and it scales with your team as you grow.
Monitor progress with precise metrics: term coverage, alias mappings, and per-language overrides. Create a dedicated glossary_id per client or project, then import your lists via glossaryinputuri. Start by init the glossary, then run import through the CLI to populate entries, while keeping a clear parent relationship for nested terms.
Workflow tip: use sample datasets to validate mappings before you deploy, and keep a slim glossary_input file to avoid drift. With a parent project structure and versioned imports, you can roll back a change in minutes if needed.
Note: 将请求正文保存在名为,result,post,版格式的输入文件此示例说明了所需的结构,interruptedexception,construct,glossaryinputuri,init,glossary_id,import,cli您可以运行,sample,parent
Take control of terminology and deliver consistent translations faster with DeepL Glossary–start your trial today and see how term consistency translates into higher client satisfaction and faster delivery.
DeepL Glossary: Terminology for Translators and Language Professionals
Begin with a concrete setup: use project_number_or_idlocationsus-central1glossariesglossary-id, set location to global, and configure inputconfig to map source languages to target languages. Run a sample import from gcssource and submit a rest request using applicationjson payloads. This creates a glossary entry ready for lookups in production.
Glossary setup and workflow
Define parent and child glossary relationships, populate metadata, and construct a clear term map that pairs source terms with translations. Use cred for authentication, then issue requests to the glossary rest API. Monitor running status and catch interruptedexception to retry or route to a fallback path. The result should reflect a kept history for downstream tools.
Validation and auditing
For languagecodesset, include languages and codes, and ensure the payload aligns with languages and languagecodesset before import. The rest API expects languages and languagecodesset fields in the same payload. Validate result and update glossary-id accordingly, without disrupting existing data. Use metadata to store version, source, and gcssource.
重要提示 将请求正文保存在名为 glossary_request.json, global.
Node.js: Build a Glossary Resource for Translators
Use a focused Node.js utility to build a glossary resource for translators. Store assets in utf-8 under a parent folder, and structure data around glossary_id and inputconfig. The CLI accepts a sample input and outputs a complete glossary in both requestjson and applicationjson payloads, with an authorization header to control access and a languagecodesset grouping for languages. The resource is designed to be global for reuse across teams.
The data model centers on glossary_id as the unique key, inputconfig for parsing rules, and a root glossary with entries that map source_term to translations per language. The 版格式的输入文件此示例说明了所需的结构 shows how to shape fields such as source_term, translations, and notes. Use languagecodesset to enumerate codes and target_lang_code to generate results for the destination language.
Data model and workflow
glossary_id identifies the glossary as the primary key, inputconfig defines parsing and validation rules, and global scope ensures reuse across projects. The structure supports languagecodesset mappings and target_lang_code for producing translations in a chosen language. Ensure utf-8 encoding across all saved assets and honor the parent directory layout for easy discovery and backup.
In the input, include sample entries that pair a source_term with translations under languagecodesset entries. The 版格式的输入文件此示例说明了所需的结构 portion demonstrates how to embed notes and metadata alongside term pairs to aid reviewers and QA checks.
cli您可以运行 a compact CLI to trigger glossary generation from a local file; this helps reviewers validate entry pairs before publishing. 您应该收到类似以下内容的 response after a successful run, confirming keys glossary_id and inputconfig exist and the produced files reside under the global namespace.
For API-driven workflows, use requests to POST payloads with authorization headers and accept responses in requestjson and applicationjson formats. On Windows, powershell scripts can automate uploading, validation, and logging to reduce manual steps while handling potential interruptedexception events gracefully.
REST: Clean Up Invalid Search Terms in Glossaries
Validate and filter search terms at the edge using a dedicated REST endpoint that rejects invalid terms before they reach the glossary index.
Validation rules
- Normalize every input: trim, collapse spaces, enforce utf-8, and apply languagecodesset to match target_lang_code.
- Block terms containing control characters or mixed scripts; map to canonical forms via a translation step.
- Limit term length and remove duplicates to prevent bloating the glossary and the downstream csv (gscloud-samples-datatranslationglossarycsv).
- Require authorization for all calls; enforce a signed token in the Authorization header and verify us-central1 region policy.
- Return precise feedback for invalid terms, including which item failed and why, so editors can adjust quickly.
Implementation details
- Endpoint design: expose a REST route that accepts POST with requestjson payload and supports async processing; the response should include a requesturi or a job id.
- Data flow: client sends terms; server validates, sanitizes, and writes clean terms to gcs bucket, then logs metadata to help auditing.
- Storage: store the cleaned terms in a public bucket or cloud storage with a version stamp; use metadata to track processing status.
- Configuration: set application default credentials for authentication; ensure the gcs source is saved in the named location: 将请求正文保存在名为,gcssource,public,格式cloud,target_lang_code,global,gscloud-samples-datatranslationglossarycsv,authorization,us-central1,进行身份验证请设置应用默认凭证, utf-8,translation,requestjson,running,metadata,languagecodesset,inputuri,async,rest.
- Monitoring: observe running jobs in real time, expose a status endpoint, and provide a health check for the glossary ingestion pipeline.
Node.js: Create Glossary Files and Reuse Across Projects
Implement a lightweight Node.js CLI to generate a glossary bundle and reuse it across projects. Create a glossary.json with fields glossary_id, glossaryname, languagecodesset, languages, from, location, operation, metadata, requests, and glossaryinputuri. Use a consistent schema so each project can read the same file without changes.
Store the request payload in a known place: 将请求正文保存在名为 glossary_request.json 的文件中,以便 pipeline 读取。 Include fields such as requestjson and applicationjson, and capture submittime to record when the bundle was created. Ensure the payload is complete and ready for running processes to consume.
When the CLI finishes, it returns a result object with fields: client, glossary_id, glossaryname, glossaryinputuri, metadata, and global. The response should also include location and from so downstream jobs can locate the glossary. 您应该收到类似以下内容的结果结构:包含 glossary_id、glossaryname、result、operation、requests、languagecodesset。
Pasos de implementación
Install Node.js and initialize a small project. Use fs to write glossary.json and create a glossary_input directory. Build a function that validates languagecodesset against supported codes and collects terms into languages. Ensure the CLI outputs a running status and writes glossaryinputuri for access by other projects. Include submittime to timestamp the emission for auditing.
In code, read input via process.stdin or prompts, then assemble a JSON object with glossary_id, glossaryname, languages, languagecodesset, from, location, operation, and metadata. Write to glossaryinputuri and emit a running status to the console. Use requestjson and applicationjson as content types to keep payloads clear and portable.
Reuse and distribution
Publish the glossary bundle to a shared location or a monorepo. Point projects to the same glossaryinputuri and reuse languagecodesset and languages across apps. Use a script to copy glossary.json into each project, or create a symlink to the glossary folder. For workflows, pass the location via from and operation and fetch the glossary via API or local file. cli或者使用了 any runner can load the same glossary.json and apply it to new projects.
Java: Create and Use Glossaries for Localization
Load the glossary from glossaryinputuri at startup and reuse it for all translation requests.
Organize terms into a simple format and group by languagecodesset, using gcssource to identify the glossary source. Keep the file concise, with columns like term, translation, and notes to simplify maintenance.
In Java, initialize a translationserviceclient and perform a REST flow to create the glossary: POST to the glossaries endpoint with a body that includes glossaryinputuri, gcssource, and languagecodesset. Capture the resulting operation and extract the glossary-id for future calls.
Reference the created glossary with the resource path project_number_or_idlocationsus-central1glossariesglossary-id and store it alongside your translation workflows. This keeps the mapping stable as you scale localization across languages.
When you translate, attach the glossary in translation requests via rest by including the glossary-id. The translationserviceclient handles the request wiring, and you receive updated text along with metadata in the response, including sample details and request counts (requests).
You should see a response stream that includes submittime and post fields, confirming the glossary was applied to the translation. 您应该收到类似以下内容的 sample response payload that shows the glossary linkage and the resulting translations.
Monitor performance by tracing the operation status, validating gcssource integrity, and testing with a small sample set before broader rollout. Keep glossary updates incremental and post new versions with unique glossary-id values to avoid conflicts, then revert if needed.
Python: Create and Use Glossaries (Advanced)
Overview
Leverage Python to create glossaries in the Translation API, initialize the client in us-central1, and publish a public glossary for global use. The approach uses an async operation, returning a distinct operation handle you can monitor via submittime and post updates to result.
Workflow and Details
Define glossaryname, specify languages, and set target_lang_code for translations. Use metadata to describe entries, and init to prepare the resource. The full resource path appears as project_number_or_idlocationsus-central1glossariesglossary-id, ensuring a consistent location and identifier. The CLI option cli您可以运行 lets you execute initial setup quickly, then post the glossary definition to the API with asynchronous processing. After posting, 将请求正文保存在名为,result to capture the API response, including operation details and glossary-id for subsequent reuse. Use us-central1 as the region and public with global visibility to enable access across locations.
| Field | Usage | Example |
|---|---|---|
| glossaryname | Display name for the glossary resource | my_tech_terms |
| languages | Source or supported languages for entries | ["en","fr","de"] |
| target_lang_code | Primary translation language code | fr |
| public | Access level; true exposes publicly | true |
| us-central1 | Regional location for the glossary | us-central1 |
| project_number_or_idlocationsus-central1glossariesglossary-id | Resource path for the glossary | projects/12345/locations/us-central1/glossaries/glossary-id |
| metadata | Glossary metadata, including description and terms | {"description":"Advanced glossary for tech terms"} |
| init | Initialization flag for the glossary setup | true |
| submittime | Timestamp of the submission | 2025-09-21T12:34:56Z |
| operation | Async operation handle returned by the API | operations/abcdef |
| async | Indicates asynchronous processing | true |
| post | HTTP method used to create the glossary | POST |
| result | API response saved for later use | result |
| glossary-id | Unique identifier in the glossary collection | glossary-id |
| global | Global visibility scope | true |
Go: Implement Glossary Workflows for Consistency
Implement a centralized glossary repository and enforce automated imports to maintain cross-language consistency across projects.
Glossary Alignment Essentials
Define a single source of truth in 格式cloud and publish terms to a structured glossary; include fields for term, translation, and languagecodesset.
Construct a workflow that uses translationserviceclient to pull terms for languages at build time, ensuring every client uses the same glossary.
Store the glossary input location as glossaryinputuri and reference it from translation requests to avoid drift.
Keep credentials in cred and require a login step before any import or REST call.
Prepare a glossary-filename for the primary glossary and use gscloud-samples-datatranslationglossarycsv as the canonical sample for validation.
Import via rest with a payload that includes languagecodesset, glossaryterms, and glossarydefinitions; 将请求正文保存在名为 glossary-requests.json for traceability.
您应该收到类似以下内容的 confirms the glossary import succeeded, including a glossary-filename and a status field.
Automation Patterns for Consistency
Use powershell to orchestrate login, build, and import steps; construct a script that calls the REST API, handles pagination, and retries on failures.
In Go, implement a small module that exposes a client named translationserviceclient and a method importGlossary that accepts a languages set and a glossaryinputuri.
Keep the workflow stateless between runs and store state in a short-lived storage tied to the glossary-filename to avoid conflicting updates.
Validate on import by comparing the response rest.status to the expected success code and cross-checking the languagecodesset against the source languages.
Capture the response payload and store the full request body where appropriate; 将请求正文保存在名为 glossary-requests.json, then verify the content with a rest call.




