Translation

From VectorSpaceLab/AREX-Skill · View interactive version

Translation is an AI agent skill from the GitHub repository VectorSpaceLab/AREX-Skill. Guides Argos Translate text translation through Python APIs, the argos-translate CLI, runtime settings, sentence-boundary modes, and translation troubleshooting.

How to use this skill

Skill file

Translation Workflows

Use this sub-skill when the user wants to translate text, inspect installed languages, route through translate APIs, use argos-translate, tune runtime translation settings, or debug translation failures.

Scope

This sub-skill owns:

Route package index updates, package installation/removal, and .argosmodel archive inspection to ../package-management/ first.

Read these first

Minimal decision flow

  1. Confirm the package imports:

```bash

python scripts/check_runtime.py

```

  1. Confirm the required source and target languages are installed:

```python

from argostranslate import translate

print([(lang.code, lang.name) for lang in translate.get_installed_languages()])

```

  1. If either language or the language pair is missing, switch to ../package-management/ and install the required package.
  2. Use Python API or CLI translation only after the language-pair package exists.
  3. Set runtime variables such as ARGOS_DEVICE_TYPE and ARGOS_CHUNK_TYPE before importing translation modules in a long-running process.

Python translation route

Use the direct helper when a package exists:

from argostranslate import translate

print(translate.translate("Hello world", "en", "es"))

Use object-level APIs when you need to inspect languages, pivot paths, or translation classes:

from argostranslate import translate

languages = {lang.code: lang for lang in translate.get_installed_languages()}
from_lang = languages["en"]
to_lang = languages["es"]
translation = from_lang.get_translation(to_lang)
print(translation.translate("Hello world"))

CLI translation route

Use the installed CLI command:

argos-translate --from-lang en --to-lang es "Hello world"
echo "Text to translate" | argos-translate -f en -t es

Do not rely on older --from / --to aliases unless verified in the target environment. Current installed help uses --from-lang / --to-lang and -f / -t.

Runtime-setting route

Read ../../references/configuration.md before changing:

CUDA, Stanza, SpaCy downloads, and remote provider paths are optional runtime capabilities. Do not present them as verified unless the target environment has been explicitly tested.

Advanced API route

Use ../../references/api-reference.md for:

Native verification anchors

The source repository's safe translation unit-test anchor is tests/test_translate.py. End-to-end language-pair tests depend on installed model packages and may skip or require network/package setup; do not treat those skips as proof that translation works.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.