po-llm
A command-line tool for translating .po files using Large Language Models (LLMs). Currently supports OpenAI-compatible APIs only.
Install
cargo install po-llm
yay -S po-llm-bin
Or: release
Usage
You need a toml file to configure the software:
[]
= "https://api.xxx.com/v1"
= "your-token"
= "model-name"
= "your prompt" # option
[]
# Language names provided to the LLM (can be any descriptive string)
= [ "English", "Chinese" ]
= "**/*.pot" # Standard practice uses .pot files as templates
= "{name}_{lang}.po"
= 20 # Number of entries processed in a single prompt
[]
= "Untitled Project"
= "Project description for LLM context."
= "po-files/" # Base directory for input/output patterns
= true # Whether to skip entries that already have translations
To run:
Full Arguments
Credits
This project utilizes the following crates:
anyhowasync-openaiasync-traitclapfuturesglobindicatifpolibschemarsserdeserde_jsontokiotokio-streamtoml