# 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
```bash
pip install localizer-cli
```
## Quick Start
1. Initialize localizer in your project:
```bash
localizer init
```
2. Add languages to your configuration:
```bash
localizer config --add-language fr
```
3. Generate translations:
```bash
localizer translate all -o ./translations
```
## Configuration
When you run `localizer init`, it creates a `.localizer` directory with three files:
### 1. `localizer.config.yaml`
```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:
```yaml
# Example structure
welcome:
title: "Welcome to our app!"
subtitle: "Get started by..."
errors:
not_found: "Page not found"
```
### 3. `docs.md`
Documentation for translators:
```markdown
# 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
```bash
# Add a language
localizer config --add-language fr
# Remove a language
localizer config --remove-language fr
# List configured languages
localizer config --list-languages
```
### Validation
```bash
# Validate all documentation references
localizer validate docs
# Validate specific reference
localizer validate ref welcome.title
```
### Translation Generation
```bash
# 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](LICENSE) for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/dengdengyee/localizer",
"name": "localizer",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": null,
"keywords": "translation, i18n, cli, localization",
"author": "mh",
"author_email": "akic4op4@gmail.com",
"download_url": null,
"platform": null,
"description": "# localizer\n\nManage your app translations with ease. localizer is a command-line tool that helps you manage, validate, and generate translations for your applications.\n\n## Features\n\n- \ud83d\ude80 **Quick Setup**: Initialize translation configs with a single command\n- \u2705 **Validation**: Ensure translation references are valid and documented\n- \ud83c\udf0d **Multi-language**: Generate translations for multiple languages\n- \ud83d\udcdd **Documentation**: Keep translation contexts organized\n\n## Installation\n\n```bash\npip install localizer-cli\n```\n\n## Quick Start\n\n1. Initialize localizer in your project:\n```bash\nlocalizer init\n```\n\n2. Add languages to your configuration:\n```bash\nlocalizer config --add-language fr\n```\n\n3. Generate translations:\n```bash\nlocalizer translate all -o ./translations\n```\n\n## Configuration\n\nWhen you run `localizer init`, it creates a `.localizer` directory with three files:\n\n### 1. `localizer.config.yaml`\n```yaml\nfiles:\n reference: reference.yaml # Source translations file\n docs: docs.md # Documentation file\nlanguages:\n - en # Default languages\n - ko\n - vi\n```\n\n### 2. `reference.yaml`\nYour source translations in YAML format:\n```yaml\n# Example structure\nwelcome:\n title: \"Welcome to our app!\"\n subtitle: \"Get started by...\"\nerrors:\n not_found: \"Page not found\"\n```\n\n### 3. `docs.md`\nDocumentation for translators:\n```markdown\n# Translation Documentation\n\n## Welcome Screen\n- `welcome.title`: Main welcome message on the landing page\n- `welcome.subtitle`: Secondary text below the welcome message\n\n## Error Messages\n- `errors.not_found`: Shown when a page cannot be found\n```\n\n## Commands\n\n### Config Management\n```bash\n# Add a language\nlocalizer config --add-language fr\n\n# Remove a language\nlocalizer config --remove-language fr\n\n# List configured languages\nlocalizer config --list-languages\n```\n\n### Validation\n```bash\n# Validate all documentation references\nlocalizer validate docs\n\n# Validate specific reference\nlocalizer validate ref welcome.title\n```\n\n### Translation Generation\n```bash\n# Generate for specific language\nlocalizer translate generate fr -o fr.json\n\n# Generate for all languages\nlocalizer translate all -o ./translations\n```\n\n## CLI Reference\n\n### `localizer init`\nInitializes the localizer configuration in your project.\n\n### `localizer config`\n| Option | Description |\n|--------|-------------|\n| `--add-language CODE` | Add a language code |\n| `--remove-language CODE` | Remove a language code |\n| `--list-languages` | Show configured languages |\n\n### `localizer validate`\n| Command | Description |\n|---------|-------------|\n| `docs` | Validate all docs references |\n| `ref PATH` | Validate specific reference path |\n\n### `localizer translate`\n| Command | Description |\n|---------|-------------|\n| `generate LANG [-o FILE]` | Generate translation for language |\n| `all -o DIR` | Generate all translations |\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.",
"bugtrack_url": null,
"license": "MIT",
"summary": "Localizer - Manage your app translations with ease.",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/dengdengyee/localizer",
"Repository": "https://github.com/dengdengyee/localizer"
},
"split_keywords": [
"translation",
" i18n",
" cli",
" localization"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "77358c4a13528d558fa766a69bab649dc53653ea57e168f5f294843633161b67",
"md5": "d21e862766c3c61cc66a0f11cfd72ff8",
"sha256": "fb8bb6dd15030ff44c1a2a321a6d821db18e56ed17f26a8886e2e0a5de406c60"
},
"downloads": -1,
"filename": "localizer-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d21e862766c3c61cc66a0f11cfd72ff8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 13001,
"upload_time": "2024-10-25T06:54:35",
"upload_time_iso_8601": "2024-10-25T06:54:35.991047Z",
"url": "https://files.pythonhosted.org/packages/77/35/8c4a13528d558fa766a69bab649dc53653ea57e168f5f294843633161b67/localizer-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-25 06:54:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dengdengyee",
"github_project": "localizer",
"github_not_found": true,
"lcname": "localizer"
}