Skip to main content

Audit and analyze Xcode String Catalogs (.xcstrings) for localization completeness

Project description

xcstrings-tool

Audit and analyze Xcode String Catalogs (.xcstrings) for localization completeness.

PyPI Tests Python License

The Problem

You built your iOS app in English. Now you need Spanish, French, and 10 other languages. How do you track:

  • Which strings are missing translations?
  • Which translations need review?
  • Your overall completion percentage?

xcstrings-tool answers these questions.

Installation

pip install xcstrings-tool

Or with pipx (recommended for CLI tools):

pipx install xcstrings-tool

Quick Start

# Audit your localization status
xcstrings-tool audit Localizable.xcstrings --target es-MX

# Export missing translations to CSV
xcstrings-tool export Localizable.xcstrings --target fr

# Validate catalog structure
xcstrings-tool validate Localizable.xcstrings

# Show statistics
xcstrings-tool stats Localizable.xcstrings

Features

  • Comprehensive localization reports with progress tracking
  • Multiple output formats: console, JSON, CSV, Markdown
  • CI/CD integration with configurable thresholds
  • Fast and reliable (90%+ test coverage)
  • Python 3.9+ on macOS and Linux

Commands

audit

Analyze localization completeness for a target language.

xcstrings-tool audit Localizable.xcstrings --target es-MX

Options:

  • --target, -t: Target language code (default: es-MX)
  • --format, -f: Output format(s): console, json, csv, markdown (can specify multiple)
  • --output-dir, -o: Directory for output files
  • --verbose, -v: Show detailed entry lists
  • --threshold: Fail if completion below percentage (for CI)

Examples:

# Basic audit
xcstrings-tool audit Localizable.xcstrings

# Multiple formats
xcstrings-tool audit Localizable.xcstrings -f json -f csv -o reports/

# CI integration
xcstrings-tool audit Localizable.xcstrings --threshold 80

export

Export missing translations to CSV for translation vendors.

xcstrings-tool export Localizable.xcstrings --target fr

Options:

  • --target, -t: Target language code (required)
  • --output, -o: Output CSV file path

validate

Validate String Catalog JSON structure.

xcstrings-tool validate Localizable.xcstrings

stats

Show quick statistics about the catalog.

xcstrings-tool stats Localizable.xcstrings

CI/CD Integration

Use the --threshold flag to fail builds when localization falls below a target:

# GitHub Actions example
- name: Check localization
  run: |
    pip install xcstrings-tool
    xcstrings-tool audit Localizable.xcstrings --target es-MX --threshold 80

Exit codes:

  • 0: Success (or above threshold)
  • 1: Error or below threshold

Output Formats

Console

Beautiful terminal output with progress bars and tables.

JSON

{
  "summary": {
    "total_strings": 1231,
    "translated": 638,
    "missing_translation": 593,
    "completion_percentage": 51.8
  },
  "missing_translations": [...]
}

CSV

Import into Google Sheets, Excel, or translation management systems.

Markdown

Generate reports for documentation or GitHub issues.

Development

# Clone repo
git clone https://github.com/jaalbin24/xcstrings-tool.git
cd xcstrings-tool

# Install with Poetry
poetry install

# Run tests
poetry run pytest

# Run linting
poetry run ruff check .
poetry run mypy src/

# Install pre-commit hooks
poetry run pre-commit install

Contributing

Contributions welcome! Please see CONTRIBUTING.md for guidelines.

License

MIT License. See LICENSE for details.

Author

Morgan Olive

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xcstrings_tool-0.1.0.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xcstrings_tool-0.1.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file xcstrings_tool-0.1.0.tar.gz.

File metadata

  • Download URL: xcstrings_tool-0.1.0.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.14 Linux/6.11.0-1018-azure

File hashes

Hashes for xcstrings_tool-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b335e10be1958a5cff3fc1d9fca826c660ff525c17a2e0368f9b1c5374bbfec7
MD5 a9520b5c12a5a74448f9639766e71742
BLAKE2b-256 a0763926fd35822e1e0fb135b6f3b1c567b608573da15474e5e7cde7db8ca7e8

See more details on using hashes here.

File details

Details for the file xcstrings_tool-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: xcstrings_tool-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.14 Linux/6.11.0-1018-azure

File hashes

Hashes for xcstrings_tool-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3503003670faf9899e18c70bf5618abf60ea2d79a47968da41fe5f255d407164
MD5 ac6a6d8664972c6ecbd5ec36eb99a796
BLAKE2b-256 aebc87585ec940e0c35747a29eb2592aa521f47f7ecf18280d3647c3addfe6dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page