This project is created for translating markdown files, I only tested for translating AWS workshops. More features will be added soon. Feel free to send a feature request here.
- Support translating file name with different name pattern
- Support using different LLM models
- Support translating PPTX files
- Let llm read an article before translating for improving translation accuracy
- Fine tune the translation using few shot learning prompt
- Add support for
- Node 20: Install Node.js 20 Download Node.js
- AWS credential: Install the AWS CLI, set up the AWS CLI, enable the Anthropic Haiku & Sonnet models from the AWS console and attach an IAM policy to invoke these Amazon Bedrock models (bedrock:InvokeModelWithResponseStream).
npm install -g br-translate
"en": "english",
"es": "spanish",
"ja": "japanese",
"fr": "french",
"ko": "korean",
"pt": "portuguese",
"de": "german",
"it": "italian",
"zh": "chinese (simplified)",
"zh-TW": "chinese (traditional)",
"uk": "ukrainian",
"pl": "polish",
"id": "indonesian",
"nl": "dutch",
"ar": "arabic"
// Simplified Chinese
br-translate start --file content/sms-v2-components/all-together/index.en.md \
--targetLanguageCode zh
// Spanish
br-translate start --file content/sms-v2-components/all-together/index.en.md \
--targetLanguageCode es
// Spanish
br-translate start --dir ./content/clean-up --targetLanguageCode es
// Simplified Chinese
br-translate start --dir ./content --targetLanguageCode zh
If you would like to improve the translation, this package also flexible to add extra prompt and few shot learning. You may follow this guide for more details.
Options:
-d, --dir <directory> Directory containing files to translate
-f, --file <filePath> single file translation
-tlc, --targetLanguageCode <targetLanguageCode> Target language you need
-p, --promptFilePath <promptFilePath> [Optional] Extra prompt for translation
-r, --referenceFilePath <referenceFilePath> [Optional] Sample translations you want the LLM to read before translation
-slc, --sourceLanguageCode <sourceLanguageCode> [Optional] The language you choose to translate from
-h, --help
Alick Wong
Pavlos Ioannou Katidis
Rex Law