Skip to main content

Localizer - Manage your app translations with ease.

Project description

localizer

Manage your app translations with ease. localizer is a command-line tool that helps you manage, validate, and generate translations for your applications.

Features

  • 🚀 Quick Setup: Initialize translation configs with a single command
  • Validation: Ensure translation references are valid and documented
  • 🌍 Multi-language: Generate translations for multiple languages
  • 📝 Documentation: Keep translation contexts organized

Installation

pip install localizer-cli

Quick Start

  1. Initialize localizer in your project:
localizer init
  1. Add languages to your configuration:
localizer config --add-language fr
  1. Generate translations:
localizer translate all -o ./translations

Configuration

When you run localizer init, it creates a .localizer directory with three files:

1. localizer.config.yaml

files:
  reference: reference.yaml  # Source translations file
  docs: docs.md             # Documentation file
languages:
  - en                      # Default languages
  - ko
  - vi

2. reference.yaml

Your source translations in YAML format:

# Example structure
welcome:
  title: "Welcome to our app!"
  subtitle: "Get started by..."
errors:
  not_found: "Page not found"

3. docs.md

Documentation for translators:

# Translation Documentation

## Welcome Screen
- `welcome.title`: Main welcome message on the landing page
- `welcome.subtitle`: Secondary text below the welcome message

## Error Messages
- `errors.not_found`: Shown when a page cannot be found

Commands

Config Management

# Add a language
localizer config --add-language fr

# Remove a language
localizer config --remove-language fr

# List configured languages
localizer config --list-languages

Validation

# Validate all documentation references
localizer validate docs

# Validate specific reference
localizer validate ref welcome.title

Translation Generation

# Generate for specific language
localizer translate generate fr -o fr.json

# Generate for all languages
localizer translate all -o ./translations

CLI Reference

localizer init

Initializes the localizer configuration in your project.

localizer config

Option Description
--add-language CODE Add a language code
--remove-language CODE Remove a language code
--list-languages Show configured languages

localizer validate

Command Description
docs Validate all docs references
ref PATH Validate specific reference path

localizer translate

Command Description
generate LANG [-o FILE] Generate translation for language
all -o DIR Generate all translations

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE for details.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

localizer-0.1.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file localizer-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: localizer-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Darwin/24.0.0

File hashes

Hashes for localizer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fb8bb6dd15030ff44c1a2a321a6d821db18e56ed17f26a8886e2e0a5de406c60
MD5 d21e862766c3c61cc66a0f11cfd72ff8
BLAKE2b-256 77358c4a13528d558fa766a69bab649dc53653ea57e168f5f294843633161b67

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