Migration (0.6)
CLI
DocTranslater 0.6 uses subcommands only. There is no flat doctranslate --files … or doctranslate --warmup entry point.
| Before (0.5 and earlier) | After (0.6) |
|---|---|
doctranslate --warmup |
doctranslate assets warmup |
doctranslate --files a.pdf … |
doctranslate translate a.pdf … |
doctranslate --generate-offline-assets DIR |
doctranslate assets pack-offline DIR |
doctranslate --restore-offline-assets PATH |
doctranslate assets restore-offline PATH |
doctranslate --validate-translators --translator router -c f.toml |
doctranslate config validate --translator router -c f.toml |
Global defaults still load from -c / --config on the root command, for example:
doctranslate -c doctranslate.toml translate doc.pdf
TOML
Only [doctranslate] is read for nested router/local settings and for flat CLI defaults. Rename [babeldoc] sections to [doctranslate].
Translation memory
Automatic import of ~/.cache/doctranslate/cache.v1.db on startup is removed. Run once if you still have that file:
doctranslate tm migrate-v1-cache
Python API
- Stable embedding: use
doctranslate.apiwithTranslationRequest/TranslationResult(see Stable library API and Public API policy). - Legacy path:
TranslationConfigis constructed with a :class:doctranslate.format.pdf.translation_settings.TranslationSettingsobject (see source underdoctranslate/format/pdf/). Prefer the stable API for new code. - Exceptions live under
doctranslate.exceptions(for examplePriorTranslatedInputErrorreplaces the old “input generated by BabelDOC” error name).
Upstream
This repository is a fork of funstory-ai/DocTranslate. Use miguelenes/doctranslate issues for this fork.