Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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): freetype and libpdfium must 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 pdf feature, attempting to translate a .pdf file will produce an error at runtime.

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:

ConstantValueDescription
DEFAULT_BASE_URLhttps://tmt.ilprl.ku.edu.np/lang-translateDefault API endpoint
MAX_FILE_SIZE_BYTES1,000,000 (1 MB)Hard limit for input files
MAX_REQUEST_TEXT_BYTES5,000Maximum characters sent per API request