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。
Implementierungsschritte
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
Lädt das Glossar beim Start von glossaryinputuri und verwendet es für alle Übersetzungsanfragen wieder.
Organisieren Sie die Begriffe in einem einfachen Format und gruppieren Sie sie nach Languagecodesset, wobei Sie gcssource verwenden, um die Glossarquelle zu identifizieren. Halten Sie die Datei prägnant, mit Spalten wie Begriff, Übersetzung und Notizen, um die Wartung zu vereinfachen.
In Java initialisieren Sie einen Translationsserviceclient und führen Sie einen REST-Flow aus, um das Glossar zu erstellen: POST an den Glossaries-Endpunkt mit einem Body, der glossaryinputuri, gcssource und languagecodesset enthält. Erfassen Sie die resultierende Operation und extrahieren Sie die Glossar-ID für zukünftige Aufrufe.
Referenzieren Sie das erstellte Glossar mit dem Ressourcenpfad project_number_or_idlocationsus-central1glossariesglossary-id und speichern Sie es zusammen mit Ihren Übersetzungs-Workflows. Dadurch bleibt die Zuordnung stabil, wenn Sie die Lokalisierung über verschiedene Sprachen hinweg skalieren.
Wenn Sie übersetzen, fügen Sie das Glossar in Übersetzungsanfragen per REST bei, indem Sie die Glossar-ID angeben. Der TranslationsServiceClient übernimmt die Anfragebearbeitung, und Sie erhalten aktualisierten Text zusammen mit Metadaten in der Antwort, einschließlich Beispieldetails und Anfragezahlen (requests).
Sie sollten einen Antwortstream sehen, der die Felder submittime und post enthält, die bestätigen, dass das Glossar auf die Übersetzung angewendet wurde. Sie sollten eine ähnliche Antwortnutzlast wie die folgende erhalten, die die Glossarverknüpfung und die resultierenden Übersetzungen zeigt.
Überwachen Sie die Leistung, indem Sie den Betriebsstatus verfolgen, die Integrität der Gcssource validieren und mit einem kleinen Beispielset testen, bevor Sie mit der breiteren Einführung beginnen. Halten Sie Glossar-Aktualisierungen inkrementell und veröffentlichen Sie neue Versionen mit eindeutigen Glossar-ID-Werten, um Konflikte zu vermeiden, und machen Sie sie gegebenenfalls rückgängig.
Python: Glossare erstellen und verwenden (Fortgeschritten)
Überblick
Nutzen Sie Python, um Glossare in der Translation API zu erstellen, initialisieren Sie den Client in us-central1 und veröffentlichen Sie ein öffentliches Glossar zur globalen Nutzung. Der Ansatz verwendet eine asynchrone Operation und gibt einen eindeutigen Operation Handle zurück, den Sie über submittime überwachen und Aktualisierungen an result posten können.
Workflow und Details
Definieren Sie glossaryname, geben Sie Sprachen an und legen Sie target_lang_code für Übersetzungen fest. Verwenden Sie Metadaten, um Einträge zu beschreiben, und init, um die Ressource vorzubereiten. Der vollständige Ressourcenpfad wird als project_number_or_idlocationsus-central1glossariesglossary-id angezeigt, wodurch ein konsistenter Speicherort und Bezeichner gewährleistet werden. Mit der CLI-Option cli您可以运行 können Sie die Ersteinrichtung schnell ausführen und die Glossardefinition dann mit asynchroner Verarbeitung an die API senden. Speichern Sie nach dem Veröffentlichen 将请求正文保存在名为,result, um die API-Antwort zu erfassen, einschließlich Betriebsdetails und glossary-id zur späteren Wiederverwendung. Verwenden Sie us-central1 als Region und public mit globaler Sichtbarkeit, um den Zugriff über verschiedene Standorte hinweg zu ermöglichen.
| Field | Usage | Example |
|---|---|---|
| glossaryname | Anzeigename für die Glossarressource | my_tech_terms |
| languages | Quell- oder unterstützte Sprachen für Einträge | ["en","fr","de"] |
| Ziel_Sprachcode | Primärer Übersetzungssprachencode | fr |
| public | Zugriffsebene; „true“ macht öffentlich zugänglich | true |
| us-central1 | Regionale Standorte für das Glossar | us-central1 |
| Projektnummer oder -IDStandorteus-central1Glossareglossar-ID | Ressourcenpfad für das Glossar | projects/12345/locations/us-central1/glossaries/glossary-id |
| Metadaten | Glossarmetadaten, einschliesslich Beschreibung und Begriffe | {"description":"Advanced glossary for tech terms"} |
| init | Initialisierungsflagge für die Glossar-Einrichtung | true |
| Einreichungszeit | Zeitstempel der Einreichung | 2025-09-21T12:34:56Z |
| operation | Asynchroner Operations-Handle, der von der API zurückgegeben wird | operationen/abcdef |
| async | Zeigt asynchrone Verarbeitung an | true |
| post | HTTP-Methode, die zum Erstellen des Glossars verwendet wird | POST |
| result | API-Antwort zur späteren Verwendung gespeichert | result |
| glossary-id | Eindeutige Kennung in der Glossarsammlung | glossary-id |
| global | Globaler Sichtbarkeitsbereich | true |
Go: Implementiere Glossar-Workflows für Konsistenz
Implementieren Sie ein zentrales Glossar-Repository und erzwingen Sie automatisierte Importe, um die sprachübergreifende Konsistenz in allen Projekten aufrechtzuerhalten.
Glossar-Abstimmungs-Grundlagen
Definiere eine einzige Quelle der Wahrheit in 格式Cloud und veröffentliche Begriffe in einem strukturierten Glossar; einschliesslich Feldern für Begriff, Übersetzung und Languagecodesset.
Erstellen Sie einen Workflow, der translationserviceclient verwendet, um Begriffe für Sprachen zur Build-Zeit abzurufen, um sicherzustellen, dass jeder Client das gleiche Glossar verwendet.
Speichern Sie den Speicherort der Glossareingabe als glossaryinputuri und referenzieren Sie ihn in Übersetzungsanfragen, um Abweichungen zu vermeiden.
Bewahren Sie Anmeldeinformationen in cred auf und fordern Sie einen Anmeldeschritt vor jedem Import oder REST-Aufruf an.
Bereiten Sie einen Glossar-Dateinamen für das primäre Glossar vor und verwenden Sie gscloud-samples-datatranslationglossarycsv als kanonisches Beispiel für die Validierung.
Import über REST mit einer Payload, die languagecodesset, glossaryterms und glossarydefinitions enthält; Speichern Sie den Anfragetext zur Rückverfolgbarkeit in glossary-requests.json.
Sie sollten etwas Ähnliches wie das Folgende erhalten, das bestätigt, dass der Glossarimport erfolgreich war, einschließlich eines Glossar-Dateinamens und eines Statusfelds.
Automatisierungsmuster für Konsistenz
Verwenden Sie Powershell, um Anmelde-, Build- und Importschritte zu orchestrieren; erstellen Sie ein Skript, das die REST-API aufruft, Paginierung verarbeitet und bei Fehlern Wiederholungen durchführt.
Implementieren Sie in Go ein kleines Modul, das einen Client namens translationserviceclient und eine Methode importGlossary bereitstellt, die eine Menge von Sprachen und einen glossaryinputuri akzeptiert.
Halten Sie den Workflow zwischen den Ausführungen zustandslos und speichern Sie den Zustand in einem kurzlebigen Speicher, der an den Glossar-Dateinamen gebunden ist, um widersprüchliche Aktualisierungen zu vermeiden.
Bei Import validieren, indem der Antwort-Reststatus mit dem erwarteten Erfolgscode verglichen und die Languagecodesset gegen die Quellsprachen gegen geprüft wird.
Erfassen Sie die Antwortnutzlast und speichern Sie den vollständigen Anfragetext, wo es angebracht ist; 将请求正文保存在名为 glossary-requests.json, und überprüfen Sie dann den Inhalt mit einem Rest-Aufruf.




