NappAI CMS Translations
NappAI CMS Translations brings together the translation steps of NappAI CMS: check what is translated in each language, read the glossary and the translation memory, propose a glossary term and save the translation a flow has made.
When the CMS launches a translation, it has already split the text into segments and sends them in the run’s input together with the glossary and the memory. The flow translates, checks and saves the result with Save Translation. A person approves publishing a language in the CMS.
When to use it
- At the end of a translation flow launched by the CMS, to save the translated segments (
Save Translation). - To find out which pages, posts or shared sections are still to be translated (
Get Language Status). - To read the glossary or the translation memory and give them to a model as context.
- To propose a new glossary term for a person to approve.
Configuration
You need a NappAI-CMS credential with the address of your NappAI CMS (for example https://web.your-company.com) and a key that starts with ncms_. See Credentials.
A CMS administrator creates the key in Ajustes › IA › Conexión con NappAI › Claves NappAI-CMS, and the CMS shows it only once. It is a service key: it reads, prepares drafts and saves results, but never publishes. The address must start with https://; http:// is only accepted with localhost, in development.
| Field | What it does |
|---|---|
| Credential (required) | The NappAI-CMS credential. It fills in CMS Address and NappAI-CMS Key for you. |
| Resource | What you work with: Languages, Glossary, Translation Memory or Translations. Default: Languages. |
| Operation | What you do. The list changes with the chosen Resource. See Resources and operations. |
| Idempotency Key (advanced) | Optional, for Save Translation. With the same key, sending again does not save twice. Empty: runId:translation is used, so a retry never saves twice. |
The CMS’s error messages come in Spanish and are shown as they arrive.
Resources and operations
Languages
| Operation | What it does | Fields |
|---|---|---|
Get Language Status | Translation status of the whole website or of one page, post or shared section. | Optional: Page (slug), Post and Shared Section. |
- Page (slug) is a page’s slug; the home page is
home. - Post is a post, as
channel/slug, for exampleblog/my-article. - Shared Section is one of the shared sections:
navigation,site-settings,site-seoorsite-embeds. - With no page, post or section, it returns the status of the whole website.
Glossary
| Operation | What it does | Fields |
|---|---|---|
List Glossary Terms | Lists the glossary terms. | Optional: Include Proposed, to also include the proposed terms waiting for approval. |
Propose Glossary Term | Proposes a glossary term. It stays proposed until a person approves it in the CMS. | Term. Optional: Fixed Translation, Note and Type. |
- Term is the term as it appears in the base language: a name, a brand or an acronym.
- Fixed Translation is how it must be written in the other language. The CMS receives it inside the note, as «Traducción propuesta: «…».».
- Note explains why it is proposed, for whoever approves it.
- Type is the kind of term:
auto(default, the CMS decides),person,brand,company,acronym,universal,technicalorslogan.
Translation Memory
| Operation | What it does | Fields |
|---|---|---|
List Translation Memory | Lists entries of the translation memory, with a filter. | Optional: Limit (1 to 100, default 20) and Filter (JSON), a Payload filter, for example {"locale": {"equals": "en"}}. |
Translations
| Operation | What it does | Fields |
|---|---|---|
Save Translation | Saves the translation of a CMS run, after checking it against the CMS contract. | Run ID or Chat Input, Segments (JSON). Optional: Score (0 to 100), Problems, Back Translation (JSON) and Proposed Terms. |
- Run ID is the
runIdthe CMS sends. Optional if you connect to Chat Input the flow’s input message, the JSON{"runId", "task", "contract"}the CMS sends: therunIdis taken from it. - Segments (JSON) is the translation as a JSON list
[{"key": "hero.title", "text": "…"}], with the same keys as the input. - Score (0 to 100) is the score a second opinion gives the translation.
- Problems are the problems found in the base language, one per line or as a JSON list.
- Back Translation (JSON) is a JSON list
[{"key", "text"}]with the translation turned back into the base language, to check the meaning. - Proposed Terms is a JSON list
[{"source", "target", "note"}]or single terms separated by lines or commas. A single term is proposed to stay untranslated.
If a field of the translation is missing or wrong, the component names it and sends nothing. The CMS checks it again and rejects it (422 error translation_rejected) if the bold text (**…**), the links or the placeholders ({{…}}) are lost, or if the length is far off the original: fix it and send it again.
Output
The Data output returns the CMS’s answer as data. With Save Translation: run, saved (what was saved) and duplicate (whether an earlier send with the same key had already saved it).
The component can be connected to an Agent as a tool. See Tools.
Example
A flow the CMS launches to translate a page:
- The flow starts with Chat Input and NappAI CMS Run with
Get Run Input, which returns the segments, the glossary and the memory. - A model translates the segments following the glossary; a second model reviews the translation and scores it.
- Add NappAI CMS Translations with
TranslationsandSave Translation: the chat input in Chat Input, the translated segments in Segments (JSON) and the score in Score (0 to 100). - Finish with NappAI CMS Run and
Set Run Statusset todone. In the error branch,failedwith the reason.
Good practices
- Always close the run after saving:
Set Run Statusset todone, orfailedwith the reason if something fails. - If the CMS rejects the translation with a 4xx error, fix the data before sending it again.
- To read the run’s input (segments, glossary and memory), use
Get Run Inputof NappAI CMS Run.
Security and limitations
- The key never publishes: a person approves and publishes a language in the CMS.
- Proposed terms don’t enter the glossary until a person approves them.
Related components
- NappAI CMS Run: read the run’s input and close it.
- NappAI CMS Content: read and prepare the website’s content.
- NappAI CMS Tools: all the CMS tools for an agent.