### Setup project directory on Windows
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/installation.html
Commands to create a project directory and install the toolkit using uv.
```bash
> mkdir translate-work
> cd translate-work
> uv venv
> uv pip install translate-toolkit
```
--------------------------------
### Install from source
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/installation.html
Commands for installing the toolkit from the local source directory.
```bash
$ uv pip install .
```
--------------------------------
### Install via uv
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/installation.html
Recommended method for installing the toolkit using the uv package manager.
```bash
uv pip install translate-toolkit
```
--------------------------------
### Install Dependencies
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/developers/developers.html
Use uv to sync dependencies and create a virtual environment.
```bash
uv sync --all-extras --dev
```
--------------------------------
### Install test dependencies
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/developers/testing.html
Install all required and optional dependencies for the test suite.
```bash
$ uv sync --all-extras --dev
```
--------------------------------
### Verify installation
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/installation.html
Command to check the currently installed version of the toolkit.
```bash
$ prop2po --version
prop2po 3.19.19
```
--------------------------------
### Install via Linux package managers
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/installation.html
Commands for installing the toolkit on various Linux distributions.
```bash
# Debian / Ubuntu
apt install translate-toolkit
# Fedora / RedHat
dnf install translate-toolkit
# openSUSE
zypper install translate-toolkit
```
--------------------------------
### Quickstart workflow commands
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/guides/using_pofilter.html
A sequence of commands for the standard pofilter and pomerge workflow.
```bash
pofilter -l
pofilter -i existing_files/ -o errors/ [-t specific tests] [--excludefilter don't perform specific tests]
vim errors/*.po
pomerge -i errors/ -o existing_files/ -t existing_files/
cvs diff -u existing_files/ > x.diff
vim x.diff
cvs ci existing_files/
```
--------------------------------
### Java properties file example
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/properties.html
A basic example of key-value pairs in a Java properties file format.
```properties
editmenu.label = "Edit"
saveas.label = "Save As"
```
--------------------------------
### Example command execution
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/odf2po.html
Example commands for converting an ODT file to PO and back to ODT.
```bash
odf2po english.odt english_french.po
po2odf -t english.odt english_french.po french.odt
```
--------------------------------
### Clone and setup development environment
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/developers/contributing.html
Commands to clone the repository and set up the development environment using uv.
```bash
git clone https://github.com/translate/translate.git
cd translate
uv sync --all-extras --dev
```
--------------------------------
### Output format examples
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/pocount.html
Sample output for different reporting formats.
```text
avmedia/source/viewer.po
type strings words (source) words (translation)
translated: 73465 ( 99%) 538598 ( 99%) 513296
fuzzy: 13 ( 0%) 141 ( 0%) n/a
untranslated: 53 ( 0%) 602 ( 0%) n/a
Total: 73531 539341 513296
```
```text
Filename, Translated Messages, Translated Source Words, Translated Target Words, Fuzzy Messages, Fuzzy Source Words, Untranslated Messages, Untranslated Source Words, Review Messages, Review Source Words
avmedia/source/viewer.po, 1, 3, 3, 0, 0, 4, 22, 1, 3
```
```text
test-po/fuzzy.po strings: total: 1 | 0t 1f 0u | 0%t 100%f 0%u
```
```text
test-po/fuzzy.po source words: total: 3 | 0t 3f 0u | 0%t 100%f 0%u
```
--------------------------------
### .properties file formatting examples
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/releases/0.10.html
Demonstrates the change in .properties file output formatting to preserve spacing around the equal sign.
```properties
# Previously if the template had
property = value
```
```properties
# We output
property=translation
```
```properties
# We will now output
property = translation
```
--------------------------------
### Format command line examples
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/developers/styleguide.html
Use the console block type for command line instructions, including prompts and comments.
```console
$ cd docs
$ make html # Build all Sphinx documentation
$ make linkcheck # Report broken links
```
--------------------------------
### Install uv on Windows
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/installation.html
Command to install the uv package manager on Windows via PowerShell.
```powershell
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```
--------------------------------
### Conversion Workflow Examples
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/ini2po.html
Common command sequences for creating POT files, recovering existing translations, and converting back to INI.
```bash
ini2po -P ini/ pot/
```
```bash
ini2po -t lang/ zu/ po-zu/
```
```bash
po2ini -t lang/ po-zu/ zu/
```
--------------------------------
### WiX v3 Localization File Example
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/wxl.html
Demonstrates the WiX v3 structure where translatable strings are defined as element content.
```xml
&VoltarCancelar
```
--------------------------------
### Python Brace Format Example
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/pofilter_tests.html
Demonstrates the syntax for Python brace formatting used in translation strings.
```python
'the {} {0} hungry {insect}'.format('very', insect='caterpillar')
# --> 'the very very hungry caterpillar'
```
--------------------------------
### Customize element and attribute names
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/flatxml.html
Example demonstrating the use of custom element and attribute names, including namespaces.
```xml
Hello World!Translated value.
```
--------------------------------
### WiX v4 Localization File Example
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/wxl.html
Demonstrates the WiX v4 structure where translatable strings are defined using the Value attribute.
```xml
```
--------------------------------
### Example review comment
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/guides/using_pofilter.html
Shows the format for an entry marked for review within a PO file.
```text
# (review) - wrong word for gallery chosen
```
--------------------------------
### Customize indentation styles
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/flatxml.html
Example showing how indentation can be customized, including spaces, tabs, or no indentation.
```xml
This file uses 8 spaces for indentTabs can also be used; but this is limited to the Python API at this pointNo indent (all in one line) is also supportedEnd-of-file *always* has a LF to satisfy VCS
```
--------------------------------
### Example of a simple text document structure
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/text.html
A sample text file demonstrating how the converter groups content into units based on spacing.
```text
Heading
=======
Paragraph One
Paragraph Two:
* First bullet
* Second bullet
```
--------------------------------
### Segmenting an entire project directory
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/posegment.html
Example of segmenting all files within a directory for project-level translation memory.
```bash
posegment af/ af-segmented/
```
--------------------------------
### Demonstrate Unified Storage Conversion API
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/base_classes.html
Example of converting between translation formats by passing a store object directly to another store constructor, relying on a shared base API.
```python
>>> po_store = POStore(filecontent)
>>> print(bytes(po_store))
msgid "bleep"
msgstr "blorp"
>>> xliff_store = XliffStore(po_store)
>>> print(bytes(xliff_store))
bleepblorp
```
--------------------------------
### Example of generated header field
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/symb2po.html
Example of a header field that may appear in generated files.
```text
Description : Localisation File : English
```
--------------------------------
### YAML Boolean non-conformance example
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/yaml.html
Example of a boolean value that may not be correctly handled during round-trip operations.
```yaml
foo: True
```
--------------------------------
### Initialize PO Files with Templates
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/pot2po.html
Initializes new PO files using existing translations from a previous version as templates.
```bash
pot2po -t zu-1.0.1 pot-2.0.2 zu-2.0.2
```
--------------------------------
### Basic command usage
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/fluent2po.html
General syntax for running the fluent2po conversion tool.
```bash
fluent2po [options]
```
--------------------------------
### Preserve non-resource elements
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/flatxml.html
Example demonstrating how non-resource elements and attributes are preserved during conversion.
```xml
This needs to be translated42Some important string
```
--------------------------------
### poswap Translation Examples
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/poswap.html
Common operations for swapping source languages and reversing the process.
```bash
poswap nl.po nl-af.po
```
```bash
poswap --reverse nl.po -t nl-af.po af.po
```
```bash
poswap -i fr/ -t ku/ -o fr-ku/
```
```bash
poswap --reverse -i fr/ -t fr-ku/ -o en-ku/
```
--------------------------------
### Create POT Files
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/flatxml2po.html
Converts all .xml files in the source directory to Gettext POT files.
```bash
flatxml2po -P lang/en pot/
```
--------------------------------
### Access Tool Help
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/general_usage.html
Display available commands and options for any specific tool.
```bash
moz2po --help
```
--------------------------------
### Segmenting a single PO file
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/posegment.html
Example of segmenting a specific Pidgin translation file.
```bash
posegment pidgin-af.po pidgin-af-segmented.po
```
--------------------------------
### Create POT files from properties
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/prop2po.html
Use the -P flag to generate POT files instead of standard PO files from properties sources.
```bash
prop2po -P properties pot
```
```bash
prop2po -P file.properties file.pot
```
--------------------------------
### Displaying phase help
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/phase.html
Command to view available commands and options.
```bash
phase --help
```
--------------------------------
### Counting translations in a directory or files
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/pocount.html
Examples of counting all files in a directory or specific file patterns.
```bash
pocount project/
```
```bash
pocount *.po
```
```bash
pocount $(find . -name "*.properties.po")
```
--------------------------------
### Command Line Usage Syntax
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/wxl2po.html
Basic command line syntax for wxl2po and po2wxl conversion tools.
```bash
wxl2po [options]
po2wxl [options] [-t ]
```
--------------------------------
### Convert ODF to XLIFF
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/odf2xliff.html
Example command to generate an XLIFF file from an ODT source document.
```bash
odf2xliff english.odt english_français.xlf
```
--------------------------------
### Basic usage of posegment
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/posegment.html
General syntax for running the posegment command.
```bash
posegment [options]
```
--------------------------------
### Example pofilter marker format
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/guides/using_pofilter.html
The format used by pofilter to annotate errors within PO files.
```text
# (pofilter) -
```
--------------------------------
### Define translation sections
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/guides/using_csv2po.html
Example directory naming convention for splitting work among multiple translators.
```text
e.g. po-filtered-dir-1 po-filtered-dir-2
or po-filtered-dir-bob po-filtered-dir-mary
```
--------------------------------
### Basic Usage Syntax
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/pot2po.html
General command structure for running the pot2po conversion.
```bash
pot2po [options]
```
--------------------------------
### Convert TS to POT
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/ts2po.html
Create a POT file from a Qt .ts file.
```bash
ts2po -P psi.ts psi.pot
```
--------------------------------
### Define Plain TOML structure
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/toml.html
Example of key-value pairs and nested tables in a plain TOML file.
```toml
# Welcome message
welcome = "Welcome to our application"
[settings]
app_name = "My App"
description = "A great application"
[settings.advanced]
timeout = "30 seconds"
```
--------------------------------
### Define Fluent messages
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/fluent.html
Example of basic message definitions, variable interpolation, and attributes in a .ftl file.
```fluent
# Simple message
hello = Hello World!
# Message with a variable
greeting = Hello { $name }!
# Message with attributes
login-input =
.placeholder = email@example.com
.aria-label = Login input
.title = Login
```
--------------------------------
### PHP Blank Array Initialization
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/php.html
Demonstrates initializing an empty array and filling it later.
```php
array(
"two" => "dous",
),
);
```
--------------------------------
### Add normal comments
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/po.html
Standard comments in PO files start with a hash symbol followed by a space.
```PO
# this is another comment
```
--------------------------------
### Clone the Repository
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/developers/developers.html
Initial step to download the source code from GitHub.
```bash
git clone https://github.com/translate/translate.git
cd translate
```
--------------------------------
### Basic usage syntax
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/po2tmx.html
The standard command structure for executing the po2tmx conversion.
```bash
po2tmx [options] --language
```
--------------------------------
### Identify review flags in PO files
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/pofilter_tests.html
Example of how review comments are structured in a PO file for the isreview test.
```text
# (review) reason for review
# (pofilter) testname: explanation for translator
```
--------------------------------
### Command Line Usage Syntax
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/resx2po.html
Basic command structure for converting files between .resx and PO formats.
```bash
resx2po [options]
po2resx [options] -t
```
--------------------------------
### PHP Nowdoc Syntax
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/php.html
Demonstrates nowdoc string syntax.
```php
po2flatxml [options] [-t ]
```
--------------------------------
### Example .resx data entry
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/resx.html
Shows the structure of a data entry including a key, value, and combined developer/translator comments.
```xml
hello worldOptional developer comment about the string [Translator Comment: Optional translator comment]
```
--------------------------------
### Define a single-level Flat XML structure
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/flatxml.html
Basic example of a single-level XML structure using attributes to identify resources.
```xml
Hello World!Translated value.
```
--------------------------------
### Run Tests
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/developers/developers.html
Execute the test suite using the provided makefile.
```bash
make test
```
--------------------------------
### Activate environment and verify on Windows
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/installation.html
Commands to activate the virtual environment and check the toolkit version.
```bash
> .venv\Scripts\activate
> po2prop --version
```
--------------------------------
### Set language attribute on an iCalendar entry
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/ical.html
Example of setting the LANGUAGE attribute on a SUMMARY entry within an iCalendar file.
```text
SUMMARY:LANGUAGE=af;New Year's Day
```
--------------------------------
### Create POT Files
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/rc2po.html
Converts .rc files from a source directory into Gettext POT files.
```bash
rc2po -P lang/ pot/
```
--------------------------------
### Command Line Usage Syntax
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/mozlang2po.html
Basic command structure for converting between Mozilla .lang and PO formats.
```bash
mozlang2po [options]
po2mozlang [options] -t
```
--------------------------------
### INI File Format Examples
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/ini2po.html
Supported INI file structures including various comment styles and key-value delimiters.
```ini
[Section]
; a comment
a = a string
```
```ini
[Section]
# another comment
b : a string
```
```ini
[Section]
; a comment
a = a string
# another comment
b : a string
c:'other example with apostrophes'
d:"example with double quotes"
```
--------------------------------
### Create POT files from .resx
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/resx2po.html
Converts all .resx files in a directory to Gettext POT files.
```bash
resx2po -P resx/ pot/
```
--------------------------------
### Basic poclean usage
Source: https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/poclean.html
The standard command syntax for running the poclean tool.
```bash
poclean