mirror of
https://github.com/slint-ui/slint.git
synced 2025-12-23 09:19:32 +00:00
Some checks are pending
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
autofix.ci / format_fix (push) Waiting to run
autofix.ci / lint_typecheck (push) Waiting to run
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / files-changed (push) Waiting to run
CI / build_and_test (--exclude bevy-example, ubuntu-22.04, 1.82) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, --exclude bevy-example, windows-2022, 1.82) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, macos-14, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.82) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
43 lines
1.6 KiB
Markdown
43 lines
1.6 KiB
Markdown
<!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 -->
|
|
|
|
# slint-tr-extractor
|
|
|
|
A command-line tool for extracting translatable strings from `.slint` files and generating gettext-compatible translation files.
|
|
|
|
## Overview
|
|
|
|
`slint-tr-extractor` is part of the [Slint framework](https://slint.dev)'s internationalization (i18n) workflow.
|
|
It scans `.slint` files for strings marked with the `@tr()` macro and extracts them into gettext `.pot`
|
|
(Portable Object Template) files, which can then be translated into multiple languages.
|
|
|
|
See also the [Slint Translations Guide](https://docs.slint.dev/latest/docs/slint/guide/development/translations/) for more information.
|
|
|
|
## Prerequisites
|
|
|
|
* Install Rust by following the [Rust Getting Started Guide](https://www.rust-lang.org/learn/get-started).
|
|
|
|
## Installation
|
|
|
|
Install the tool using Cargo:
|
|
|
|
```bash
|
|
cargo install slint-tr-extractor
|
|
```
|
|
|
|
## Usage
|
|
|
|
```
|
|
Usage: slint-tr-extractor [OPTIONS] [path to .slint file(s)]...
|
|
|
|
Arguments:
|
|
[path to .slint file(s)]...
|
|
|
|
Options:
|
|
-d, --default-domain <DOMAIN>
|
|
-o <file> Write output to specified file (instead of messages.po).
|
|
--package-name <PACKAGE_NAME> Set the package name in the header of the output
|
|
--package-version <PACKAGE_VERSION> Set the package version in the header of the output
|
|
-j, --join-existing Join messages with existing file
|
|
-h, --help Print help
|
|
-V, --version Print version
|
|
```
|