🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Translate TXT

by @litousteven

Translate text files using OpenAI-compatible APIs (e.g. SiliconFlow, DeepSeek, OpenAI). Use when the user wants to: translate a txt file, translate text to C...

Versionv1.0.1
βš™οΈ Configuration

The script reads config from the .env file in the skill root directory, falling back to environment variables.

| Variable | Default | Description | |---|---|---| | TRANSLATE_API_KEY | (none, required) | API key for the translation service | | TRANSLATE_BASE_URL | https://api.siliconflow.cn/v1 | Base URL for OpenAI-compatible API | | TRANSLATE_MODEL | Qwen/Qwen2.5-7B-Instruct | Model name to use | | TRANSLATE_THINKING | auto | Thinking mode: auto/disabled (recommended) or enabled | | TRANSLATE_MAX_TOKENS | 4096 | Max output tokens per chunk | | TRANSLATE_TEMPERATURE | 1 | Model temperature | | TRANSLATE_TIMEOUT | 300 | API request timeout in seconds |

Priority: environment variables > .env file > defaults.

πŸ“‹ Tips & Best Practices

  • The script uses only Python standard library (no pip install needed)
  • Translation quality depends on the model; larger models generally produce better translations
  • Keyword extraction adds one API call per chunk but ensures every term is captured
  • Set --concurrency 1 to disable parallel translation if the API has strict rate limits
  • The script preserves original text formatting (paragraphs, line breaks) in the translation
  • Avoid thinking/reasoning models for translation β€” much slower with no quality benefit
  • Sliding-window context scales to any text length β€” 10 chunks or 1000 chunks work the same way
  • View on ClawHub
    TERMINAL
    clawhub install smart-translate-txt

    πŸ§ͺ Use this skill with your agent

    Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

    πŸ” Can't find the right skill?

    Search 60,000+ AI agent skills β€” free, no login needed.

    Search Skills β†’