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
- Initialize localizer in your project:
localizer init
- Add languages to your configuration:
localizer config --add-language fr
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb8bb6dd15030ff44c1a2a321a6d821db18e56ed17f26a8886e2e0a5de406c60
|
|
| MD5 |
d21e862766c3c61cc66a0f11cfd72ff8
|
|
| BLAKE2b-256 |
77358c4a13528d558fa766a69bab649dc53653ea57e168f5f294843633161b67
|