npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

autotranslatedoc

v1.0.11

Published

A tool to automatically translate documentations.

Downloads

2

Readme

Automatic Documentation Translation with LLMs

zh-Hans | es | fr | ru | de | ja | ko | pt | it | ar | tr | pl | nl | vi | th | fa | ro | sv | hu | cs | el | da | fi | he | no | hi | zh_tw | in | sl | se | sk | uk | bg | hr | lt | lv | et | cat

This tool leverages the capabilities of OPEN AI GPT 3.5 / 4 to automatically translate documentation files (i.e., .md/.mdx files) within a GitHub repository.

*** Disclaimer: This tool is currently under development ***

Installation

The tool can be installed via NPM:

    npm install -g autotranslatedoc

Ensure to set up the environment variables: GITHUB_PERSONAL_ACCESS_TOKEN and OPENAI_API_KEY. Alternatively, these tokens can be passed as parameters. Refer to the GitHub documentation for obtaining a GITHUB_PERSONAL_ACCESS_TOKEN.

Usage

Help Page

Access the help page with the following command:

 autotranslatedoc -h

Translating Documentation

Autotranslatedoc take 3 arguments and many options

    autotranslatedoc <command> <repo_org> <repo_name> (options)
  • command can be either: translate (to translate), update (to update a translation), build (to build a translation)
  • repo_org is the org of the target repository on GitHub
  • repo_name is the name of the target repository on GitHub

The main options available are:

  • --language <lang_1>(, <lang_2>)* (or -l) to select the language you want to translate to.
  • --docPath </url/path> (or -d) to limit translation to files in a specific path.
  • --savePath <./localPath> (or -s) to select the directory where the save file will be saved (default to ./save).
  • --outputPath <./localPath> (or -o) when using build, to specified where the translated doc files will be output (default to ./build)

To translate the documentation of a target repository into French and Spanish, use:

    autotranslatedoc translate run-llama llama_index -l fr,es

This command creates a llama_index.json file in the run-lama directory of the specified output directory (default is ./save).

    ls ./save
        run-llama
            llama_index.json 

The save file contains all translations and can be used to generate the documentation in a target format (currently only .md).

To build the translated documentation, use:

    autotranslatedoc build run-llama llama_index -l fr,es

This command generates fr and es directories in the buildPath (default is ./build) containing the translated documentation files.

To update the translated documentation based on changes in the original files, use:

    autotranslatedoc update run-llama llama_index -l fr,es

To review the documentation via a server (experimental feature), use:

    autotranslatedoc serve run-llama llama_index

Translating Docusaurus Documentation

For translating documentation hosted in Docusaurus, use:

    autotranslatedoc translate run-llama LlamaIndexTS --docPath /apps/docs/docs -l fr,es -m docusaurus
    autotranslatedoc build run-llama LlamaIndexTS --docPath /apps/docs/docs -l fr,es -m docusaurus

Translating README.md Only

To translate only the README file, use the readme mode:

    autotranslatedoc translate run-llama LlamaIndexTS -l fr,es -m readme
    autotranslatedoc build run-llama LlamaIndexTS  -l fr,es -m readme

Translating to All Supported Languages

To translate to all supported languages, use the -l all option:

    autotranslatedoc translate run-llama LlamaIndexTS -l all -m readme
    autotranslatedoc build run-llama LlamaIndexTS  -l all -m readme

Known Issues

Currently, translation with -all is only supported from English to all other languages.