Skip to content

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.

FieldWhat it does
Credential (required)The NappAI-CMS credential. It fills in CMS Address and NappAI-CMS Key for you.
ResourceWhat you work with: Languages, Glossary, Translation Memory or Translations. Default: Languages.
OperationWhat 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

OperationWhat it doesFields
Get Language StatusTranslation 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 example blog/my-article.
  • Shared Section is one of the shared sections: navigation, site-settings, site-seo or site-embeds.
  • With no page, post or section, it returns the status of the whole website.

Glossary

OperationWhat it doesFields
List Glossary TermsLists the glossary terms.Optional: Include Proposed, to also include the proposed terms waiting for approval.
Propose Glossary TermProposes 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, technical or slogan.

Translation Memory

OperationWhat it doesFields
List Translation MemoryLists 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

OperationWhat it doesFields
Save TranslationSaves 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 runId the CMS sends. Optional if you connect to Chat Input the flow’s input message, the JSON {"runId", "task", "contract"} the CMS sends: the runId is 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:

  1. The flow starts with Chat Input and NappAI CMS Run with Get Run Input, which returns the segments, the glossary and the memory.
  2. A model translates the segments following the glossary; a second model reviews the translation and scores it.
  3. Add NappAI CMS Translations with Translations and Save Translation: the chat input in Chat Input, the translated segments in Segments (JSON) and the score in Score (0 to 100).
  4. Finish with NappAI CMS Run and Set Run Status set to done. In the error branch, failed with the reason.

Good practices

  • Always close the run after saving: Set Run Status set to done, or failed with 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 Input of 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.