translation

Translate Markdown files while preserving code blocks and front-matter.

2|Updated Jan 8, 2023
One-click install
npx skills add https://github.com/raulbethencourt/Fenix --skill translation-raulbethencourt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: translation
Source: https://github.com/raulbethencourt/Fenix/tree/main/dotfiles/.config/opencode/skills/translation
Command: npx skills add https://github.com/raulbethencourt/Fenix --skill translation-raulbethencourt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires deep-translator, and includes scripts (resource) components.

What problem does it solve?

Translating Markdown documents from a source language into a target language while preserving code blocks, front-matter, and overall document structure to reduce manual effort.

Core Features & Use Cases

  • Translates prose content while preserving fenced code blocks and indented code blocks.
  • Maintains YAML/TOML front-matter and overall formatting, suitable for READMEs, guides, and documentation.
  • Supports both single-file translation and batch directory translation with maintained relative paths.

Quick Start

Create a Translator for your target language and run translate_file to translate a Markdown file.

Frequently Asked Questions about translation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I translate Markdown documentation while preserving code blocks and front-matter?

To translate Markdown documentation while preserving code blocks and front-matter, use this Skill to process READMEs and guides. It translates prose content from a source to a target language without altering fenced code blocks, indented code, or YAML/TOML front-matter.

Can I batch translate an entire directory of Markdown files without changing the structure?

Yes, you can batch translate an entire directory of Markdown files without changing the structure. This Skill supports batch directory translation and automatically maintains relative paths while converting prose content to your target language.

Does the deep-translator library support maintaining YAML and TOML front-matter during localization?

The deep-translator library handles the translation engine, while this Skill adds front-matter detection to ensure YAML and TOML metadata is preserved. It isolates front-matter from prose so that only the content text is processed during localization.

What is the best way to localize READMEs and guides written in Markdown to another language?

The best way to localize READMEs and guides is to apply this translation Skill to individual files or directories. It specifically targets Markdown formatting to ensure that structural elements like headings and links remain intact during the localization process.

Do I need Python to run the Markdown translation process?

Yes, you need Python to run the Markdown translation process because this Skill depends on the deep-translator Python library. You must have the Python environment configured and the dependency installed to execute the translation scripts.

Why does my translated Markdown documentation have broken formatting and code blocks?

Translated Markdown documentation often has broken formatting if the tool does not isolate code blocks. This Skill prevents broken formatting by applying code-block preservation logic, ensuring fenced and indented code is skipped during the translation process.