Contents

Wason Language Translator CLI

Using text translation is a common situation in daily life, such as Google TranslateDeepL Translate, Wason Language Translator and other frequently used services.

All of the above services basically support the translation of documents (docx, pptx, pdf, etc.), but the difference is the cost and accuracy of translation.

  1. Cloud Translation | Google Cloud: Google Cloud Translator provides full document translation, the overall translation effect is better, but there is no free quota, you need to bind a settlement account to use.
  2. Wason Language Translator Demo: IBM Cloud also provides file translation. After applying for an account, there is a free plan of 2 MB per file. The overall translation effect is worse than Google Cloud Translate.

This article basically encapsulates Language Translator - IBM Cloud API Docs into cli to facilitate file translation

Wason Language Translator Lite Plan

lite plan

Language Translator - IBM Cloud(https://cloud.ibm.com/apidocs/language-translator) The Lite plan gets you started with 1,000,000 characters per month at no cost and includes the default translation models. When you upgrade to a paid plan, you can create custom models.

Usage

  1. Visit 👉 releases to download latest binary file

  2. Visit 👉 Language Translator - IBM Cloud apply an IBM Cloud account, create Language Translator instance. copy apiKeyurl

    1
    2
    3
    4
    5
    6
    7
    
    API_KEY=<replace-your-api-key>
    URL=<replace-url>
    cat <<EOF >> $HOME/.wason-translator-cli.yaml
    api_key: ${API_KEY}
    url: ${URL}
    version: 2018-05-01
    EOF
    
  3. Translat document by cli and the supported formats are .doc, .docx, .ppt, .pptx, .xls, .xlsx, .rtf, .odt, .odp, .ods, .pdf, .htm, .html, .xml, .json, .txt

  4. Upload document to translate

  5. download translted docuemt file

  6. delete translted docuemt file

Source Code

cage1016/wason-translator-cli: IBM Cloud Language Translator CLI (document translate)