Socket
Socket
Sign inDemoInstall

lugath

Package Overview
Dependencies
2
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lugath

Lugath API wrapper


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

License: MIT npm version

@lugath/node

Wrapper for Lugath public API's.

Please see the SDK usage and configuration at this documentation.

Requirements

Node.js 8 or Higher

Installation

You can install via npm or yarn

$ npm install lugath

or

$ yarn add lugath

Usage

Here is a basic example to use Lugath;

const Lugath =  require('lugath');

Lugath API uses OAuth to authenticate requests. You can view and manage your API key in the account Dashboard.

enter image description here

Don’t have an account yet? You can register here.

Simple Usage Example

You need to pass your API credentials as option to constructor.

const  options  = {
       API_KEY  :  "<YOUR_API_KEY>",
       API_SECRET  :  "<YOUR_SECRET_KEY>"
}

const  lugath  =  new  Lugath(options);

This will manage your authentication process backward. Now you're able to translate a text, from a pair to multiple pairs with category context as you see below;

   lugath.translate({
	      "from":"en",
	      "to":["fr"],
	      "text":"a sample text to translate",
	      "category":"<CategoryOptions>",
	      "options":{
		        "glossaryIDs":[],
		        "useBestMatch":false,
		        "customMTEngineName":""
	      }
    }).then((res) => console.log(res))
    

API Options

from: String

The source language of translate context.

Note: This won't be blank.

to: Array

The target language(s) of translate context.

Note: This won't be blank, assignable multiple values.

text: String

The text you want to translate.

Note: This won't be blank.

category: String

The context of the text to translate.

Note: This won't be blank. You can check the available options section as below

glossaryIDs: Array

Relating to a specific terms in the translate text reserved or not, replaced or not.

Note: If a terminology set already created on the dashboard, you can specify them with this field.

useBestMatch: Boolean

Machine Translation Engines rated by Lugath with the context of category and language pair.

Note: If you don't interest with useBestMatch, you can get results directly from a specific MT.

customMTEngineName: String

You can specifically go to assigned MT with this field.

Note: If you don't interest with useBestMatch, this field is mandatory.

Available Options

LanguageCodeCode3
Arabicarara
Chinesezhzh
Dutchnlnld
Englisheneng
Finnishfifin
Frenchfrfra
Germandedeu
Japanesejajpn
Koreankokor
Polishplpol
Portugueseptpor
Romanianroron
Russianrurus
Spanishesspa
Turkishtrtur
Available Categories
Automotive
Computer Hardware
Computer Software
Consumer Electronics
Finance
Healthcare
Tourism and Arts
Business Services
Other
Available MT Engines
AmazonTranslationEngine
GoogleTranslationEngine
YandexTranslationEngine
ModernTranslationEngine
MicrosoftTranslationEngine
AlibabaECommerceTranslationEngine
AlibabaGeneralTranslationEngine

Contribute

Forks and pull requests welcome!

Author

Supported and maintained by Lugath Developers. If you need any questions, just drop us a line.

Keywords

FAQs

Last updated on 15 Apr 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc