Metadata-Version: 2.4
Name: pox-convert
Version: 1.0.1
Summary: Convert PO files to Excel Spreadsheets and back.
Project-URL: Homepage, https://github.com/bartTC/pox
Project-URL: Repository, https://github.com/bartTC/pox
Project-URL: Issues, https://github.com/bartTC/pox/issues
Author-email: Martin Mahner <martin@elephant.house>
License: MIT
License-File: LICENSE
Keywords: excel,gettext,i18n,l10n,po,translation,xlsx
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Internationalization
Classifier: Topic :: Software Development :: Localization
Requires-Python: >=3.11
Requires-Dist: openpyxl>=3.1.1
Requires-Dist: polib>=1.2.0
Description-Content-Type: text/markdown

# pox-convert

[![PyPI](https://img.shields.io/pypi/v/pox-convert)](https://pypi.org/project/pox-convert/)
[![Python](https://img.shields.io/pypi/pyversions/pox-convert)](https://pypi.org/project/pox-convert/)
[![License](https://img.shields.io/pypi/l/pox-convert)](https://github.com/bartTC/pox/blob/main/LICENSE)

Convert `.po` (gettext) files to Excel spreadsheets and back. Supports fuzzy entries and multiple plural forms.

![Screenshot](https://github.com/bartTC/pox/raw/main/screenshot.png)

## Usage

### PO to Excel

```bash
uvx pox-convert export path/to/messages.po
```

Use globbing to convert multiple files at once:

```bash
uvx pox-convert export locales/**/django.po
```

Options:

```
-o, --outdir      Output directory (default: current directory)
-f, --filename    Filename template using {lang} and {date} variables
                  (default: translations_{lang}.xlsx)
-l, --language    Override the language metadata from the PO file
--fuzzy           How to handle fuzzy entries: stop, ignore, include (default: stop)
```

### Excel to PO

```bash
uvx pox-convert import path/to/translations.xlsx
```

Options:

```
-o, --outdir      Output directory (default: current directory)
-f, --filename    Filename template using {lang} variable (default: {lang}.po)
```

## Spreadsheet format

The generated Excel file has the following structure:

| id | Context   | Singular Form | Translation |
|----|-----------|---------------|-------------|
| 1  |           | Hello         | Hallo       |
| 2  | adjective | Open          | Offen       |
| 3  |           | Goodbye       |             |

- Empty translations are highlighted in yellow with a black border
- The header row is frozen for easy scrolling
- Alternating row stripes improve readability
- Plural forms get additional translation columns
- Language metadata is stored as a custom document property

## Django integration

pox-convert ships with a Django management command that wraps
`makemessages` to skip fuzzy matching:

```bash
python manage.py makemessages_nofuzzy -l de
```

Add `pox.contrib.django.pox` to your `INSTALLED_APPS` to use it.

