darkinai
v0.4.21
Published
A CLI AI file translator with context-aware safe text extraction.
Readme
DarkinAI
English
Overview
DarkinAI is an AI-powered file translation tool designed to process real-world project data without breaking structure or logic.
It is built for developers who need to translate large amounts of content such as game data, configuration files, or source code while preserving formatting and consistency.
Features
- Translate single files or entire directories
- Preserve structure, keys, variables, and formatting
- Support multiple file types
- Context-aware translation for better accuracy
- Flexible output (overwrite or separate directory)
Installation
npm install -g darkinaiRun:
darkinConfiguration
Create a config.env file in your working directory:
Path_Input=./input
path_output=./output
lang_input=zh
lang_output=vi
context=Game Pokemon turnbase, keep proper names
parallel_requests=1
glossary_file=
memory_file=
memory_examples=160Description:
- Path_Input: source directory
- path_output: output directory
- lang_input: source language
- lang_output: target language
- context: description to guide AI translation
- parallel_requests: number of translation batches to run at once; start with 2 or 3 for speed
- glossary_file: CSV/TSV file of exact term replacements
- memory_file: existing translated file/folder used as project translation memory/style examples
If path_output is empty, files will be overwritten.
Usage
Run with config:
darkinOr:
darkin translate --input "./input" --output "./output"Supported Formats
txt, md, json, html, xml, csv,
js, ts, jsx, tsx, vue,
php, py, java,
css, scss,
ini, yaml, yml, conf, cfgTranslation Rules
- JSON: translate values only, not keys
- HTML/XML: translate visible text only
- Code: translate strings and comments only
- CSV: preserve structure and delimiters
- Keep URLs, variables, and formatting unchanged
Notes
- Provide clear context for better results
- Review important files after translation
- Avoid translating minified or vendor files
Tiếng Việt
Giới thiệu
DarkinAI là công cụ dịch file bằng AI, được thiết kế để xử lý dữ liệu thực tế trong dự án mà không làm hỏng cấu trúc hoặc logic ban đầu.
Phù hợp cho developer cần dịch số lượng lớn dữ liệu như game, config hệ thống hoặc source code.
Tính năng
- Dịch file hoặc cả thư mục
- Giữ nguyên cấu trúc, key, biến và format
- Hỗ trợ nhiều định dạng file
- Dịch theo ngữ cảnh để tăng độ chính xác
- Có thể ghi đè hoặc xuất ra thư mục mới
Cài đặt
npm install -g darkinaiChạy:
darkinCấu hình
Tạo file config.env:
Path_Input=./input
path_output=./output
lang_input=zh
lang_output=vi
context=Game Pokemon turnbase, giữ nguyên tên riêngGiải thích:
- Path_Input: thư mục nguồn
- path_output: thư mục output
- lang_input: ngôn ngữ đầu vào
- lang_output: ngôn ngữ đầu ra
- context: mô tả nội dung để AI hiểu đúng
Nếu không có path_output, file sẽ bị ghi đè.
Sử dụng
darkinHoặc:
darkin translate --input "./input" --output "./output"Định dạng hỗ trợ
txt, md, json, html, xml, csv,
js, ts, jsx, tsx, vue,
php, py, java,
css, scss,
ini, yaml, yml, conf, cfgNguyên tắc dịch
- JSON: chỉ dịch value, không dịch key
- HTML/XML: chỉ dịch text hiển thị
- Code: chỉ dịch string/comment
- CSV: giữ nguyên cấu trúc
- Giữ nguyên URL, biến và format
Ghi chú
- Nên cung cấp context rõ ràng
- Kiểm tra lại file quan trọng
- Tránh dịch file minified hoặc thư viện
DarkinAI
Tập trung vào dịch chính xác và giữ nguyên cấu trúc dữ liệu trong dự án thực tế.
