DEV Community

Cover image for Automating Markdown and Image Translations with Co-op Translator
송민석
송민석

Posted on

Automating Markdown and Image Translations with Co-op Translator

Translating project documentation into multiple languages can be a time-consuming process, especially when trying to maintain Markdown formatting and image-based text. That’s where Co-op Translator comes in—a tool I’ve developed to automate the translation of both Markdown files and images using Azure AI services.

In this post, I'll walk you through:

  • The challenges of manual translation in project documentation.
  • How Co-op Translator simplifies the process.
  • A step-by-step guide to automate your own translations.

The Challenges of Manual Translation

Manually translating project documentation, especially in Markdown format, often leads to broken links, formatting issues, and a lot of time spent fixing these problems. For example:

  • Markdown links or images might get corrupted after translation.
  • Code blocks and syntax can easily be misunderstood by general translation tools.
  • Manual work for translating text within images is required, which is time-consuming.

How Co-op Translator Works

Co-op Translator uses Azure OpenAI to translate text from Markdown files and Azure Computer Vision to extract and translate text within images. It automates the entire process with a single command, preserving the correct structure of your project documentation.

Key Features:

  • Translates Markdown files without breaking the syntax.
  • Extracts and translates text within images using Computer Vision.
  • Supports multiple languages, making it easier to localize your project.

Step-by-Step Guide to Automating Translations

Here's how you can get started with Co-op Translator:

  1. Install Co-op Translator using pip or Poetry:

    pip install co-op-translator
    

    Or with Poetry:

    poetry add co-op-translator
    
  2. Set up Azure resources (Azure OpenAI, Computer Vision).

  3. Create an .env file in your project to store API keys.

  4. Run the Co-op Translator on your project:
    For example:

    co-op-translator translate -l "es fr de"
    

    This command will translate the project into Spanish, French, and German, adding new translations without overwriting existing ones.


For more information, check out the GitHub repository and feel free to contribute or leave feedback!

Conclusion

Co-op Translator makes it easier to manage multilingual documentation in your projects, especially when working with Markdown files and images. Whether you’re working on open-source projects or internal documentation, this tool can save you a lot of time.

If you have any questions or suggestions, I'd love to hear them in the comments!

Top comments (1)

Collapse
 
skytin1004 profile image
송민석

I've written a detailed guide on automating markdown and image translations using Co-op Translator on Microsoft Tech Community. You can check it out here:
techcommunity.microsoft.com/t5/edu...