Documentation

Getting Started

Welcome to KineLang! Follow these simple steps to add automated translation to your website.

Prerequisites: You need a KineLang account and at least one project with an API key.

Installation

Add the KineLang widget to your website by inserting this script tag before the closing </body> tag:

<script 
  src="https://cdn.kinelang.com/widget/1.0.8/kinelang.min.js" 
  data-api-key="YOUR_API_KEY"
  data-source-lang="vi"
  data-languages="en,ja,ko"
  data-position="bottom-right">
</script>

Replace YOUR_API_KEY with your actual API key from the dashboard.

Configuration

The widget supports several configuration options via data attributes:

Attribute Description Default
data-api-key Your project API key (required) -
data-source-lang Source language code (e.g., vi, en) vi
data-position Widget position: bottom-right, bottom-left, top-right, top-left bottom-right
data-languages Available target languages (comma-separated) en,ja,ko,zh

API Reference

For advanced usage, you can call our API directly:

POST /api/translate

Translate an array of texts to a target language.

POST https://api.kinelang.com/api/translate
Headers:
  X-Api-Key: YOUR_API_KEY
  Content-Type: application/json

Body:
{
  "targetLang": "en",
  "texts": ["Xin chào", "Giỏ hàng"]
}

Response:
{
  "translations": {
    "Xin chào": "Hello",
    "Giỏ hàng": "Shopping Cart"
  }
}