Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion PythonScripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@

Project management is done with [uv](https://docs.astral.sh/uv/).

For example, execute `uv run python -m audit_translations de` to see the translation progress for the German language.
For example, execute `uv run audit-translations de` to see the translation progress for the German language.

If you run from the repo root instead of inside `PythonScripts`, point uv at the project and make sure you've synced once:
```bash
uv sync --project PythonScripts
uv run --project PythonScripts audit-translations de
```
34 changes: 24 additions & 10 deletions PythonScripts/audit_translations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ The tool automatically adjusts its matching logic based on the file type:

**Syntax:**
```bash
uv run python -m audit_translations <language> [--file <specific_file>]
uv run python -m audit_translations --list
# Preferred: console script (no -m needed)
uv run audit-translations <language> [--file <specific_file>]
uv run audit-translations --list

# If running from the repo root, point uv at the project:
uv run --project PythonScripts audit-translations <language>
uv run --project PythonScripts audit-translations --list
```

**Convenience Features:**
Expand All @@ -74,27 +79,36 @@ uv run python -m audit_translations --list

```bash
# List available languages
uv run python -m audit_translations --list
uv run audit-translations --list

# Same from repo root
uv run --project PythonScripts audit-translations --list

# Audit all Spanish translation files
uv run python -m audit_translations es
uv run audit-translations es

# Audit German translations
uv run python -m audit_translations de
uv run audit-translations de

# Audit only a specific file
uv run python -m audit_translations es --file SharedRules/default.yaml
uv run audit-translations es --file SharedRules/default.yaml

# Produce JSONL output for automation or AI workflows
uv run python -m audit_translations es --format jsonl --output es-issues.jsonl
uv run audit-translations es --format jsonl --output es-issues.jsonl

# Audit a regional variant (merges Rules/Languages/de and Rules/Languages/de/CH)
uv run python -m audit_translations de-CH
uv run audit-translations de-CH

# Show detailed output with English/translated snippets for rule differences
uv run python -m audit_translations es --verbose
uv run audit-translations es --verbose
```

**Running from the repo root (without `cd PythonScripts`):**
```bash
uv run --project PythonScripts audit-translations es
uv run --project PythonScripts audit-translations --list
```

### Testing

```uv run python -m pytest```
```uv run python -m pytest```
6 changes: 3 additions & 3 deletions PythonScripts/audit_translations/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def main():
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""
Examples:
python -m audit_translations es
python -m audit_translations de --file SharedRules/default.yaml
python -m audit_translations --list
uv run audit-translations es
uv run audit-translations de --file SharedRules/default.yaml
uv run audit-translations --list
"""
)

Expand Down
11 changes: 11 additions & 0 deletions PythonScripts/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,16 @@ readme = "README.md"
requires-python = ">=3.14"
dependencies = ["rich", "ruamel.yaml"]

[project.scripts]
audit-translations = "audit_translations.cli:main"

[dependency-groups]
dev = ["pytest"]

[build-system]
requires = ["uv_build>=0.9.25,<0.10.0"]
build-backend = "uv_build"

[tool.uv.build-backend]
module-name = "audit_translations"
module-root = ""
2 changes: 1 addition & 1 deletion PythonScripts/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading