agentskit.js
Skills

translator

High-quality translation between natural languages. Preserves formatting, tone, terminology. Includes translatorWithGlossary for forced term overrides.

import { translator } from '@agentskit/skills'

const runtime = createRuntime({
  adapter,
  skills: [translator],
})

await runtime.run('Translate this product page to pt-BR preserving markdown.')

#When to reach for it

  • App i18n copy drafts (always human-review).
  • Localizing docs + blog posts.
  • Transcript translation paired with whisper.

#Behavior

  • Preserves markdown / HTML / code blocks exactly.
  • Keeps product-name + brand terms untranslated unless told otherwise.
  • Flags untranslatable idioms; proposes locale-aware alternatives.
  • Maintains tone (formal / friendly / technical) from source.

#Glossary mode

translatorWithGlossary(entries) builds a skill with forced term translations. Glossary entries take priority over the model's default phrasing β€” the contract that downstream consumers (UI strings, brand text, legal copy) rely on.

import { translatorWithGlossary } from '@agentskit/skills'

const brandSkill = translatorWithGlossary([
  { term: 'AgentsKit', translation: 'AgentsKit' },                    // never translate
  { term: 'agent', translation: 'agente', context: 'product UI only' },
  { term: 'workspace', translation: 'espacio de trabajo' },
])

Each entry: { term, translation, context? }. The context field is appended to the prompt so the model knows when to apply the entry vs. a natural translation.

The bare translator export is translatorWithGlossary([]) β€” idiomatic translation, no glossary.

Explore nearby

✎ Edit this page on GitHubΒ·Found a problem? Open an issue β†’Β·How to contribute β†’

On this page