Prerequisites & Building
Prerequisites
Before building TMT, ensure the following are available on your system:
- Rust toolchain (Edition 2024). Install via rustup.rs.
- C libraries (PDF support only):
freetypeandlibpdfiummust be available in your system path or linker search path.
Building
Standard Build
The default build enables support for DOCX, CSV, and TSV translation:
cargo build --release
The compiled binary will be at target/release/tmt.
Build with PDF Support
PDF support is gated behind an optional feature flag because it depends on the external C libraries pdfium-render and freetype:
cargo build --release --features pdf
Note: Without the
Quick Smoke Test
After building, verify the binary works:
./target/release/tmt --help
Global Constants
These constants are compiled into the binary and cannot be overridden at runtime:
| Constant | Value | Description |
|---|---|---|
DEFAULT_BASE_URL | https://tmt.ilprl.ku.edu.np/lang-translate | Default API endpoint |
MAX_FILE_SIZE_BYTES | 1,000,000 (1 MB) | Hard limit for input files |
MAX_REQUEST_TEXT_BYTES | 5,000 | Maximum characters sent per API request |