A commandline tool to help you work with Qt Linguist-based and Gettext-based translation files, and Transifex platform-related configurations that are used in deepin's workflow.
This program currently supports the following features:
- Converts Chinese texts in Qt linguist TS file or GNU Gettext PO file among regional variants.
- Prints translation statistics of the provided project.
- Generates
.tx/configbased on Transifex GitHub integrationtransifex.yamlconfig file and Transifex API.- Transifex API is used to look up and match the resource slug.
- Local cache can be used without making API request if the resource info data is already fetched previously.
- Generates Transifex GitHub integration
transifex.yamlbased on.tx/config. - Generate a single
.tx/configcontains all linked resources under the given Transifex organization. - Generate
.tx/transifex.yamlor.tx/configbased on the (.poabd.ts) translation files inside the given source repo. - Two-step translation back-fill pipeline driven by an external provider:
export-translation <project> <lang> [--limit N]prints a JSON document listing every unfinished.ts/.pomessage (source, context, placeholders, plural-form count).--limitrestricts the output to the first N messages for batch filling.fill-translation <project> <json>reads the document back once thetranslationfields are filled, validates placeholders and plural-form counts, and writes them into the files. Entries left empty are skipped, so the same document can be applied in several batches.
- Clears the unfinished marks of entries which already have translation content:
clear-unfinished <project> [-l lang1,lang2]removestype="unfinished"from Qt Linguist TS entries with a non-empty translation, and removes thefuzzyflag from GNU Gettext PO entries with a non-emptymsgstr. Entries without translation content are left untouched.
If you have cargo-binstall installed, you can use it to install this program.
cargo binstall deepin-translation-utilscargo install deepin-translation-utilsGet the latest release at GitHub Release page, download it, extract it, and put it in your $PATH (usually we suggest to use ~/.local/bin/).
Please consult deepin-translation-utils --help.
Please consult Cargo.toml.
- Don't blindly pull translation resources after using the
monotxconfigsubcommand to generate.tx/configunless you are absolutely sure what you're doing. Pulling all translation resources directly from Transifex is a very slow process.