Coder Social home page Coder Social logo

villares / markdown_translation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from simonxix/markdown_translation

0.0 0.0 0.0 15 KB

A script and Docker environment for running automated open source translations of batches of Markdown files using LibreTranslate

License: GNU Affero General Public License v3.0

Shell 2.23% Python 97.77%

markdown_translation's Introduction

Open source machine translation for Markdown files

A script and Docker environment for running automated open source machine translations of batches of Markdown files, suitable for quickly providing translations for Hugo websites or Flask web applications. This uses LibreTranslate, a free and open source machine translation API initiated as a submodule to this repository: https://github.com/LibreTranslate/LibreTranslate.

As with all machine translations, the outputted translation may be imperfect and ideally all translations should be checked by a human translator.

LibreTranslate API

To start the LibreTranslate server for accessing the API, first ensure Docker is installed. Then simply run

./startLibreTranslate.sh

to run LibreTranslate's own run.sh Bash script for bring the Docker container up. You can then access the locally running LibreTranslate server at http://localhost:5000.

Python script

To run the Python script for machine translation of batches of Markdown files, ensure that Python is installed and run

pip install -r requirements.txt

to install required Python libraries.

Adjust the variables in translate.py to point to whatever directory contains the Markdown files you want translated. By default the script looks at a base directory and looks for a 'en' subdirectory containing English language Markdown files. Set the output_language variable to the language you wish to translate into using the language's two-letter ISO 639-1 code.

Then run

python3 ./translate.py

This will output translated Markdown files into a subdirectory in the base directory using the two-letter ISO 639-1 code for the output language. It will also replicate any directory structure present in the input directory.

markdown_translation's People

Contributors

simonxix avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.